/* Generated by Cython 0.29.36 */
#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
#include "Python.h"
#ifndef Py_PYTHON_H
#error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
#error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_36"
#define CYTHON_HEX_VERSION 0x001D24F0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
#define __stdcall
#endif
#ifndef __cdecl
#define __cdecl
#endif
#ifndef __fastcall
#define __fastcall
#endif
#endif
#ifndef DL_IMPORT
#define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
#if PY_VERSION_HEX >= 0x02070000
#define HAVE_LONG_LONG
#endif
#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_NOGIL 0
#undef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 0
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#if PY_VERSION_HEX < 0x03050000
#undef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 0
#elif !defined(CYTHON_USE_ASYNC_SLOTS)
#define CYTHON_USE_ASYNC_SLOTS 1
#endif
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#undef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 0
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#undef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 1
#undef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 0
#undef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 0
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#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_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#undef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 0
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0
#endif
#elif defined(PYSTON_VERSION)
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_NOGIL 0
#ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#endif
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#undef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 0
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#ifndef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 1
#endif
#ifndef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 1
#endif
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#undef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT 0
#undef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE 0
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#undef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 0
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0
#endif
#elif defined(PY_NOGIL)
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_NOGIL 1
#ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#endif
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#ifndef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 1
#endif
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#ifndef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 1
#endif
#ifndef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 1
#endif
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
#endif
#ifndef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE 1
#endif
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#undef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_PYSTON 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#define CYTHON_COMPILING_IN_NOGIL 0
#ifndef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#endif
#if PY_VERSION_HEX < 0x02070000
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
#define CYTHON_USE_PYTYPE_LOOKUP 1
#endif
#if PY_MAJOR_VERSION < 3
#undef CYTHON_USE_ASYNC_SLOTS
#define CYTHON_USE_ASYNC_SLOTS 0
#elif !defined(CYTHON_USE_ASYNC_SLOTS)
#define CYTHON_USE_ASYNC_SLOTS 1
#endif
#if PY_VERSION_HEX < 0x02070000
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#elif !defined(CYTHON_USE_PYLONG_INTERNALS)
#define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
#endif
#ifndef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 1
#endif
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#elif !defined(CYTHON_USE_UNICODE_WRITER)
#define CYTHON_USE_UNICODE_WRITER 1
#endif
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#ifndef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 1
#endif
#ifndef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 1
#endif
#if PY_VERSION_HEX >= 0x030B00A4
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#elif !defined(CYTHON_FAST_THREAD_STATE)
#define CYTHON_FAST_THREAD_STATE 1
#endif
#ifndef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
#endif
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
#endif
#ifndef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
#endif
#ifndef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
#endif
#if PY_VERSION_HEX >= 0x030B00A4
#undef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 0
#elif !defined(CYTHON_USE_EXC_INFO_STACK)
#define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
#endif
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
#define CYTHON_UPDATE_DESCRIPTOR_DOC 1
#endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
#if PY_MAJOR_VERSION < 3
#include "longintrepr.h"
#endif
#undef SHIFT
#undef BASE
#undef MASK
#ifdef SIZEOF_VOID_P
enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
#endif
#endif
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
#define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
#define CYTHON_RESTRICT __restrict__
#elif defined(_MSC_VER) && _MSC_VER >= 1400
#define CYTHON_RESTRICT __restrict
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_RESTRICT restrict
#else
#define CYTHON_RESTRICT
#endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__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_MAYBE_UNUSED_VAR
# if defined(__cplusplus)
template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
# else
# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
# endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
# define CYTHON_NCP_UNUSED
# else
# define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
#ifndef _MSC_STDINT_H_
#if _MSC_VER < 1300
typedef unsigned char uint8_t;
typedef unsigned int uint32_t;
#else
typedef unsigned __int8 uint8_t;
typedef unsigned __int32 uint32_t;
#endif
#endif
#else
#include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
#if defined(__cplusplus) && __cplusplus >= 201103L
#if __has_cpp_attribute(fallthrough)
#define CYTHON_FALLTHROUGH [[fallthrough]]
#elif __has_cpp_attribute(clang::fallthrough)
#define CYTHON_FALLTHROUGH [[clang::fallthrough]]
#elif __has_cpp_attribute(gnu::fallthrough)
#define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
#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 CYTHON_INLINE
#if defined(__clang__)
#define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
#elif defined(__GNUC__)
#define CYTHON_INLINE __inline__
#elif defined(_MSC_VER)
#define CYTHON_INLINE __inline
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_INLINE inline
#else
#define CYTHON_INLINE
#endif
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#define __Pyx_PyCode_New(a, 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)
#define __Pyx_DefaultClassType PyClass_Type
#else
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_DefaultClassType PyType_Type
#if PY_VERSION_HEX >= 0x030B00A1
static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, 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 *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
const char *fn_cstr=NULL;
const char *name_cstr=NULL;
PyCodeObject* co=NULL;
PyObject *type, *value, *traceback;
PyErr_Fetch(&type, &value, &traceback);
if (!(kwds=PyDict_New())) goto end;
if (!(argcount=PyLong_FromLong(a))) goto end;
if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
if (!(nlocals=PyLong_FromLong(l))) goto end;
if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
if (!(stacksize=PyLong_FromLong(s))) goto end;
if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
if (!(flags=PyLong_FromLong(f))) goto end;
if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
Py_XDECREF((PyObject*)co);
co = (PyCodeObject*)call_result;
call_result = NULL;
if (0) {
cleanup_code_too:
Py_XDECREF((PyObject*)co);
co = NULL;
}
end:
Py_XDECREF(kwds);
Py_XDECREF(argcount);
Py_XDECREF(posonlyargcount);
Py_XDECREF(kwonlyargcount);
Py_XDECREF(nlocals);
Py_XDECREF(stacksize);
Py_XDECREF(replace);
Py_XDECREF(call_result);
Py_XDECREF(empty);
if (type) {
PyErr_Restore(type, value, traceback);
}
return co;
}
#else
#define __Pyx_PyCode_New(a, 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
#define __Pyx_DefaultClassType PyType_Type
#endif
#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 METH_STACKLESS
#define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
#ifndef METH_FASTCALL
#define METH_FASTCALL 0x80
#endif
typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
Py_ssize_t nargs, PyObject *kwnames);
#else
#define __Pyx_PyCFunctionFast _PyCFunctionFast
#define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#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_CPYTHON && PY_VERSION_HEX < 0x030400A1
#define PyMem_RawMalloc(n) PyMem_Malloc(n)
#define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
#define PyMem_RawFree(p) PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
#define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
#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_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
#define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
#define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
#define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
#define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
*key = PyThread_create_key();
return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
*key = Py_tss_NEEDS_INIT;
return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
PyThread_delete_key(*key);
*key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
return PyThread_get_key_value(*key);
}
#endif
#if 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
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
#else
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
#if PY_VERSION_HEX >= 0x030C0000
#define __Pyx_PyUnicode_READY(op) (0)
#else
#define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#endif
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) 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, ch)
#if PY_VERSION_HEX >= 0x030C0000
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
#else
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
#else
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#endif
#endif
#else
#define CYTHON_PEP393_ENABLED 0
#define PyUnicode_1BYTE_KIND 1
#define PyUnicode_2BYTE_KIND 2
#define PyUnicode_4BYTE_KIND 4
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
#else
#define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
#define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
#define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
#define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
#else
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
#define PyObject_ASCII(o) PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
#define PyString_Type PyUnicode_Type
#define PyString_Check PyUnicode_Check
#define PyString_CheckExact PyUnicode_CheckExact
#ifndef PyObject_Unicode
#define PyObject_Unicode PyObject_Str
#endif
#endif
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
#define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
#define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
#define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
#define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
#define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
#define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
#define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
#else
#define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
#define PyInt_Check(op) PyLong_Check(op)
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
#define PyInt_FromString PyLong_FromString
#define PyInt_FromUnicode PyLong_FromUnicode
#define PyInt_FromLong PyLong_FromLong
#define PyInt_FromSize_t PyLong_FromSize_t
#define PyInt_FromSsize_t PyLong_FromSsize_t
#define PyInt_AsLong PyLong_AsLong
#define PyInt_AS_LONG PyLong_AS_LONG
#define PyInt_AsSsize_t PyLong_AsSsize_t
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#define PyNumber_Int PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBoolObject PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
#ifndef PyUnicode_InternFromString
#define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#endif
#if PY_VERSION_HEX < 0x030200A4
typedef long Py_hash_t;
#define __Pyx_PyInt_FromHash_t PyInt_FromLong
#define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
#else
#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
#define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
#else
#define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#else
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#endif
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
typedef struct {
unaryfunc am_await;
unaryfunc am_aiter;
unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#endif
#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
#if !defined(_USE_MATH_DEFINES)
#define _USE_MATH_DEFINES
#endif
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
float value;
memset(&value, 0xFF, sizeof(value));
return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif
#define __PYX_MARK_ERR_POS(f_index, lineno) \
{ __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
#define __PYX_ERR(f_index, lineno, Ln_error) \
{ __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
#ifndef __PYX_EXTERN_C
#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 "lib-petsc/compat.h"
#include "lib-petsc/custom.h"
#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"
#include "pystate.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */
#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif
typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
(sizeof(type) < sizeof(Py_ssize_t)) ||\
(sizeof(type) > sizeof(Py_ssize_t) &&\
likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX) &&\
(!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
v == (type)PY_SSIZE_T_MIN))) ||\
(sizeof(type) == sizeof(Py_ssize_t) &&\
(is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
#include <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 const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
#define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
const Py_UNICODE *u_end = u;
while (*u_end++) ;
return (size_t)(u_end - u - 1);
}
#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
(likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
PyObject* sys;
PyObject* default_encoding = NULL;
PyObject* ascii_chars_u = NULL;
PyObject* ascii_chars_b = NULL;
const char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
if (!default_encoding_c) goto bad;
if (strcmp(default_encoding_c, "ascii") == 0) {
__Pyx_sys_getdefaultencoding_not_ascii = 0;
} else {
char ascii_chars[128];
int c;
for (c = 0; c < 128; c++) {
ascii_chars[c] = c;
}
__Pyx_sys_getdefaultencoding_not_ascii = 1;
ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
if (!ascii_chars_u) goto bad;
ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
PyErr_Format(
PyExc_ValueError,
"This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
default_encoding_c);
goto bad;
}
Py_DECREF(ascii_chars_u);
Py_DECREF(ascii_chars_b);
}
Py_DECREF(default_encoding);
return 0;
bad:
Py_XDECREF(default_encoding);
Py_XDECREF(ascii_chars_u);
Py_XDECREF(ascii_chars_b);
return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
PyObject* sys;
PyObject* default_encoding = NULL;
char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
if (!default_encoding_c) goto bad;
__PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
Py_DECREF(default_encoding);
return 0;
bad:
Py_XDECREF(default_encoding);
return -1;
}
#endif
#endif
/* Test for GCC > 2.95 */
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime = NULL;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
static const char *__pyx_f[] = {
"petsc4py/PETSc/Const.pyx",
"petsc4py/PETSc/Error.pyx",
"petsc4py/PETSc/Device.pyx",
"petsc4py/PETSc/petscdef.pxi",
"petsc4py/PETSc/petscopt.pxi",
"petsc4py/PETSc/petscdevice.pxi",
"petsc4py/PETSc/petscis.pxi",
"petsc4py/PETSc/petscvec.pxi",
"petsc4py/PETSc/petscpc.pxi",
"petsc4py/PETSc/petscdmda.pxi",
"petsc4py/PETSc/Comm.pyx",
"petsc4py/PETSc/libpetsc4py.pyx",
"petsc4py/PETSc/PETSc.pyx",
"petsc4py/PETSc/arraynpy.pxi",
"petsc4py/PETSc/dlpack.pxi",
"petsc4py/PETSc/petscmpi.pxi",
"petsc4py/PETSc/petscsys.pxi",
"petsc4py/PETSc/petsclog.pxi",
"petsc4py/PETSc/petscobj.pxi",
"petsc4py/PETSc/petscvwr.pxi",
"petsc4py/PETSc/petscmat.pxi",
"petsc4py/PETSc.pyx",
"petsc4py/PETSc/petscksp.pxi",
"petsc4py/PETSc/petscsnes.pxi",
"petsc4py/PETSc/petscts.pxi",
"petsc4py/PETSc/petsctao.pxi",
"petsc4py/PETSc/petscdm.pxi",
"petsc4py/PETSc/petscdmstag.pxi",
"petsc4py/PETSc/petscdmcomposite.pxi",
"petsc4py/PETSc/petscdmshell.pxi",
"petsc4py/PETSc/petscpyappctx.pxi",
"petsc4py/PETSc/Options.pyx",
"petsc4py/PETSc/Sys.pyx",
"petsc4py/PETSc/Log.pyx",
"petsc4py/PETSc/Object.pyx",
"petsc4py/PETSc/cyclicgc.pxi",
"petsc4py/PETSc/Viewer.pyx",
"petsc4py/PETSc/Random.pyx",
"petsc4py/PETSc/IS.pyx",
"petsc4py/PETSc/SF.pyx",
"petsc4py/PETSc/Vec.pyx",
"petsc4py/PETSc/DT.pyx",
"petsc4py/PETSc/FE.pyx",
"petsc4py/PETSc/Scatter.pyx",
"petsc4py/PETSc/Section.pyx",
"petsc4py/PETSc/Mat.pyx",
"petsc4py/PETSc/MatPartitioning.pyx",
"petsc4py/PETSc/PC.pyx",
"petsc4py/PETSc/KSP.pyx",
"petsc4py/PETSc/SNES.pyx",
"petsc4py/PETSc/TS.pyx",
"petsc4py/PETSc/TAO.pyx",
"petsc4py/PETSc/AO.pyx",
"petsc4py/PETSc/DM.pyx",
"petsc4py/PETSc/DS.pyx",
"petsc4py/PETSc/DMDA.pyx",
"petsc4py/PETSc/DMPlex.pyx",
"petsc4py/PETSc/DMStag.pyx",
"petsc4py/PETSc/DMComposite.pyx",
"petsc4py/PETSc/DMShell.pyx",
"petsc4py/PETSc/DMLabel.pyx",
"petsc4py/PETSc/DMSwarm.pyx",
"petsc4py/PETSc/Partitioner.pyx",
"petsc4py/PETSc/Space.pyx",
"petsc4py/PETSc/DMUtils.pyx",
"petsc4py/PETSc/CAPI.pyx",
"stringsource",
};
/* 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()
/* 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])
/* Atomics.proto */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
#define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __pyx_atomic_int_type int
#if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
(__GNUC_MINOR__ > 1 ||\
(__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
#define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
#define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
#ifdef __PYX_DEBUG_ATOMICS
#warning "Using GNU atomics"
#endif
#elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
#include <intrin.h>
#undef __pyx_atomic_int_type
#define __pyx_atomic_int_type long
#pragma intrinsic (_InterlockedExchangeAdd)
#define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
#define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
#ifdef __PYX_DEBUG_ATOMICS
#pragma message ("Using MSVC atomics")
#endif
#else
#undef CYTHON_ATOMICS
#define CYTHON_ATOMICS 0
#ifdef __PYX_DEBUG_ATOMICS
#warning "Not using atomics"
#endif
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
#define __pyx_add_acquisition_count(memview)\
__pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
#define __pyx_sub_acquisition_count(memview)\
__pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
#else
#define __pyx_add_acquisition_count(memview)\
__pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#define __pyx_sub_acquisition_count(memview)\
__pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif
/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
const char* name;
struct __Pyx_StructField_* fields;
size_t size;
size_t arraysize[8];
int ndim;
char typegroup;
char is_unsigned;
int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
__Pyx_TypeInfo* type;
const char* name;
size_t offset;
} __Pyx_StructField;
typedef struct {
__Pyx_StructField* field;
size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
__Pyx_StructField root;
__Pyx_BufFmt_StackElem* head;
size_t fmt_offset;
size_t new_count, enc_count;
size_t struct_alignment;
int is_complex;
char enc_type;
char new_packmode;
char enc_packmode;
char is_valid_array;
} __Pyx_BufFmt_Context;
/*--- Type declarations ---*/
struct PyPetscCommObject;
struct PyPetscObjectObject;
struct PyPetscViewerObject;
struct PyPetscRandomObject;
struct PyPetscDeviceObject;
struct PyPetscDeviceContextObject;
struct PyPetscISObject;
struct PyPetscLGMapObject;
struct PyPetscSFObject;
struct PyPetscVecObject;
struct PyPetscSpaceObject;
struct PyPetscDualSpaceObject;
struct PyPetscFEObject;
struct PyPetscQuadObject;
struct PyPetscScatterObject;
struct PyPetscSectionObject;
struct PyPetscMatObject;
struct PyPetscMatPartitioningObject;
struct PyPetscNullSpaceObject;
struct PyPetscPCObject;
struct PyPetscKSPObject;
struct PyPetscSNESObject;
struct PyPetscTSObject;
struct PyPetscTAOObject;
struct PyPetscAOObject;
struct PyPetscDMObject;
struct PyPetscDMPlexTransformObject;
struct PyPetscDSObject;
struct PyPetscPartitionerObject;
struct PyPetscDMLabelObject;
struct __pyx_obj_8petsc4py_5PETSc__IS_buffer;
struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer;
struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm;
struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil;
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_DMDA;
struct __pyx_obj_8petsc4py_5PETSc_DMPlex;
struct __pyx_obj_8petsc4py_5PETSc_DMStag;
struct __pyx_obj_8petsc4py_5PETSc_DMComposite;
struct __pyx_obj_8petsc4py_5PETSc_DMShell;
struct __pyx_obj_8petsc4py_5PETSc_DMSwarm;
struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation;
struct __pyx_obj_8petsc4py_5PETSc__PyObj;
struct __pyx_obj_8petsc4py_5PETSc__PyMat;
struct __pyx_obj_8petsc4py_5PETSc__PyPC;
struct __pyx_obj_8petsc4py_5PETSc__PyKSP;
struct __pyx_obj_8petsc4py_5PETSc__PySNES;
struct __pyx_obj_8petsc4py_5PETSc__PyTS;
struct __pyx_obj_8petsc4py_5PETSc__PyTao;
struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator;
struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator;
struct __pyx_array_obj;
struct __pyx_MemviewEnum_obj;
struct __pyx_memoryview_obj;
struct __pyx_memoryviewslice_obj;
struct __pyx_t_8petsc4py_5PETSc_DLDataType;
struct __pyx_t_8petsc4py_5PETSc_DLContext;
typedef struct __pyx_t_8petsc4py_5PETSc_DLContext __pyx_t_8petsc4py_5PETSc_DLContext;
struct __pyx_t_8petsc4py_5PETSc_DLTensor;
struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor;
struct __pyx_opt_args_8petsc4py_5PETSc_getprefix;
/* "petsc4py/PETSc/dlpack.pxi":24
* uint16_t lanes
*
* cdef enum PetscDLDeviceType: # <<<<<<<<<<<<<<
* kDLCPU = <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":103
*
*
* cdef enum PetscOptType: # <<<<<<<<<<<<<<
* OPT_BOOL
* OPT_INT
*/
enum __pyx_t_8petsc4py_5PETSc_PetscOptType {
__pyx_e_8petsc4py_5PETSc_OPT_BOOL,
__pyx_e_8petsc4py_5PETSc_OPT_INT,
__pyx_e_8petsc4py_5PETSc_OPT_REAL,
__pyx_e_8petsc4py_5PETSc_OPT_SCALAR,
__pyx_e_8petsc4py_5PETSc_OPT_STRING
};
/* "petsc4py/PETSc/dlpack.pxi":19
* void* malloc(size_t size)
*
* cdef struct DLDataType: # <<<<<<<<<<<<<<
* uint8_t code
* uint8_t bits
*/
struct __pyx_t_8petsc4py_5PETSc_DLDataType {
uint8_t code;
uint8_t bits;
uint16_t lanes;
};
/* "petsc4py/PETSc/dlpack.pxi":38
* #kDLOneAPI = <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*) 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*) nogil
*
* cdef struct DLManagedTensor: # <<<<<<<<<<<<<<
* DLTensor dl_tensor
* void* manager_ctx
*/
struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor {
struct __pyx_t_8petsc4py_5PETSc_DLTensor dl_tensor;
void *manager_ctx;
void (*manager_deleter)(struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *);
__pyx_t_8petsc4py_5PETSc_dlpack_manager_del_obj del_obj;
};
/* "petsc4py/PETSc/petscopt.pxi":38
* #
*
* cdef getprefix(prefix, deft=None): # <<<<<<<<<<<<<<
* if prefix is None:
* prefix = deft
*/
struct __pyx_opt_args_8petsc4py_5PETSc_getprefix {
int __pyx_n;
PyObject *deft;
};
/* "petsc4py/PETSc/petscmpi.pxi":39
* void *Cython_ImportFunction(object, char[], char[]) except? NULL
*
* ctypedef MPI_Comm* PyMPICommGet(object) except NULL # <<<<<<<<<<<<<<
* ctypedef object PyMPICommNew(MPI_Comm)
* ctypedef MPI_Datatype* PyMPIDatatypeGet(object) except NULL
*/
typedef MPI_Comm *__pyx_t_8petsc4py_5PETSc_PyMPICommGet(PyObject *);
/* "petsc4py/PETSc/petscmpi.pxi":40
*
* ctypedef MPI_Comm* PyMPICommGet(object) except NULL
* ctypedef object PyMPICommNew(MPI_Comm) # <<<<<<<<<<<<<<
* ctypedef MPI_Datatype* PyMPIDatatypeGet(object) except NULL
* ctypedef MPI_Op* PyMPIOpGet(object) except NULL
*/
typedef PyObject *__pyx_t_8petsc4py_5PETSc_PyMPICommNew(MPI_Comm);
/* "petsc4py/PETSc/petscmpi.pxi":41
* ctypedef MPI_Comm* PyMPICommGet(object) except NULL
* ctypedef object PyMPICommNew(MPI_Comm)
* ctypedef MPI_Datatype* PyMPIDatatypeGet(object) except NULL # <<<<<<<<<<<<<<
* ctypedef MPI_Op* PyMPIOpGet(object) except NULL
*
*/
typedef MPI_Datatype *__pyx_t_8petsc4py_5PETSc_PyMPIDatatypeGet(PyObject *);
/* "petsc4py/PETSc/petscmpi.pxi":42
* ctypedef object PyMPICommNew(MPI_Comm)
* ctypedef MPI_Datatype* PyMPIDatatypeGet(object) except NULL
* ctypedef MPI_Op* PyMPIOpGet(object) except NULL # <<<<<<<<<<<<<<
*
* cdef inline MPI_Comm mpi4py_Comm_Get(object comm) except *:
*/
typedef MPI_Op *__pyx_t_8petsc4py_5PETSc_PyMPIOpGet(PyObject *);
/* "petsc4py/PETSc/petscvec.pxi":340
* # --------------------------------------------------------------------
*
* 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":858
* # -----------------------------------------------------------------------------
*
* ctypedef PetscErrorCode MatSetValuesFcn(PetscMat, # <<<<<<<<<<<<<<
* PetscInt,const PetscInt*,
* PetscInt,const PetscInt*,
*/
typedef PetscErrorCode __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn(Mat, PetscInt, PetscInt const *, PetscInt, PetscInt const *, PetscScalar const *, InsertMode);
/* "petsc4py/PETSc/petscdmshell.pxi":1
* ctypedef PetscErrorCode (*PetscDMShellXToYFunction)(PetscDM, # <<<<<<<<<<<<<<
* PetscVec,
* PetscInsertMode,
*/
typedef PetscErrorCode (*__pyx_t_8petsc4py_5PETSc_PetscDMShellXToYFunction)(DM, Vec, InsertMode, Vec);
/* "petsc4py/PETSc.pxd":112
* # --------------------------------------------------------------------
*
* ctypedef public api class Comm [ # <<<<<<<<<<<<<<
* type PyPetscComm_Type,
* object PyPetscCommObject,
*/
struct PyPetscCommObject {
PyObject_HEAD
MPI_Comm comm;
int isdup;
PyObject *base;
};
typedef struct PyPetscCommObject PyPetscCommObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscComm_Type;
/* "petsc4py/PETSc.pxd":120
* cdef object base
*
* ctypedef public api class Object [ # <<<<<<<<<<<<<<
* type PyPetscObject_Type,
* object PyPetscObjectObject,
*/
struct PyPetscObjectObject {
PyObject_HEAD
struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *__pyx_vtab;
PyObject *__weakref__;
PyObject *__pyx___dummy__;
PetscObject oval;
PetscObject *obj;
};
typedef struct PyPetscObjectObject PyPetscObjectObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscObject_Type;
/* "petsc4py/PETSc.pxd":132
* cdef object get_dict(self)
*
* ctypedef public api class Viewer(Object) [ # <<<<<<<<<<<<<<
* type PyPetscViewer_Type,
* object PyPetscViewerObject,
*/
struct PyPetscViewerObject {
struct PyPetscObjectObject __pyx_base;
PetscViewer vwr;
};
typedef struct PyPetscViewerObject PyPetscViewerObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscViewer_Type;
/* "petsc4py/PETSc.pxd":138
* cdef PetscViewer vwr
*
* ctypedef public api class Random(Object) [ # <<<<<<<<<<<<<<
* type PyPetscRandom_Type,
* object PyPetscRandomObject,
*/
struct PyPetscRandomObject {
struct PyPetscObjectObject __pyx_base;
PetscRandom rnd;
};
typedef struct PyPetscRandomObject PyPetscRandomObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscRandom_Type;
/* "petsc4py/PETSc.pxd":144
* cdef PetscRandom rnd
*
* ctypedef public api class Device [ # <<<<<<<<<<<<<<
* type PyPetscDevice_Type,
* object PyPetscDeviceObject,
*/
struct PyPetscDeviceObject {
PyObject_HEAD
PetscDevice device;
PyObject *__weakref__;
};
typedef struct PyPetscDeviceObject PyPetscDeviceObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDevice_Type;
/* "petsc4py/PETSc.pxd":151
* cdef object __weakref__
*
* ctypedef public api class DeviceContext(Object) [ # <<<<<<<<<<<<<<
* type PyPetscDeviceContext_Type,
* object PyPetscDeviceContextObject,
*/
struct PyPetscDeviceContextObject {
struct PyPetscObjectObject __pyx_base;
PetscDeviceContext dctx;
};
typedef struct PyPetscDeviceContextObject PyPetscDeviceContextObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDeviceContext_Type;
/* "petsc4py/PETSc.pxd":157
* cdef PetscDeviceContext dctx
*
* ctypedef public api class IS(Object) [ # <<<<<<<<<<<<<<
* type PyPetscIS_Type,
* object PyPetscISObject,
*/
struct PyPetscISObject {
struct PyPetscObjectObject __pyx_base;
IS iset;
};
typedef struct PyPetscISObject PyPetscISObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscIS_Type;
/* "petsc4py/PETSc.pxd":163
* cdef PetscIS iset
*
* ctypedef public api class LGMap(Object) [ # <<<<<<<<<<<<<<
* type PyPetscLGMap_Type,
* object PyPetscLGMapObject,
*/
struct PyPetscLGMapObject {
struct PyPetscObjectObject __pyx_base;
ISLocalToGlobalMapping lgm;
};
typedef struct PyPetscLGMapObject PyPetscLGMapObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscLGMap_Type;
/* "petsc4py/PETSc.pxd":169
* cdef PetscLGMap lgm
*
* ctypedef public api class SF(Object) [ # <<<<<<<<<<<<<<
* type PyPetscSF_Type,
* object PyPetscSFObject,
*/
struct PyPetscSFObject {
struct PyPetscObjectObject __pyx_base;
PetscSF sf;
};
typedef struct PyPetscSFObject PyPetscSFObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSF_Type;
/* "petsc4py/PETSc.pxd":175
* cdef PetscSF sf
*
* ctypedef public api class Vec(Object) [ # <<<<<<<<<<<<<<
* type PyPetscVec_Type,
* object PyPetscVecObject,
*/
struct PyPetscVecObject {
struct PyPetscObjectObject __pyx_base;
Vec vec;
};
typedef struct PyPetscVecObject PyPetscVecObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscVec_Type;
/* "petsc4py/PETSc.pxd":181
* cdef PetscVec vec
*
* ctypedef public api class Space(Object) [ # <<<<<<<<<<<<<<
* type PyPetscSpace_Type,
* object PyPetscSpaceObject,
*/
struct PyPetscSpaceObject {
struct PyPetscObjectObject __pyx_base;
PetscSpace space;
};
typedef struct PyPetscSpaceObject PyPetscSpaceObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSpace_Type;
/* "petsc4py/PETSc.pxd":187
* cdef PetscSpace space
*
* ctypedef public api class DualSpace(Object) [ # <<<<<<<<<<<<<<
* type PyPetscDualSpace_Type,
* object PyPetscDualSpaceObject,
*/
struct PyPetscDualSpaceObject {
struct PyPetscObjectObject __pyx_base;
PetscDualSpace dualspace;
};
typedef struct PyPetscDualSpaceObject PyPetscDualSpaceObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDualSpace_Type;
/* "petsc4py/PETSc.pxd":193
* cdef PetscDualSpace dualspace
*
* ctypedef public api class FE(Object) [ # <<<<<<<<<<<<<<
* type PyPetscFE_Type,
* object PyPetscFEObject,
*/
struct PyPetscFEObject {
struct PyPetscObjectObject __pyx_base;
PetscFE fe;
};
typedef struct PyPetscFEObject PyPetscFEObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscFE_Type;
/* "petsc4py/PETSc.pxd":199
* cdef PetscFE fe
*
* ctypedef public api class Quad(Object) [ # <<<<<<<<<<<<<<
* type PyPetscQuad_Type,
* object PyPetscQuadObject,
*/
struct PyPetscQuadObject {
struct PyPetscObjectObject __pyx_base;
PetscQuadrature quad;
};
typedef struct PyPetscQuadObject PyPetscQuadObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscQuad_Type;
/* "petsc4py/PETSc.pxd":205
* cdef PetscQuadrature quad
*
* ctypedef public api class Scatter(Object) [ # <<<<<<<<<<<<<<
* type PyPetscScatter_Type,
* object PyPetscScatterObject,
*/
struct PyPetscScatterObject {
struct PyPetscObjectObject __pyx_base;
VecScatter sct;
};
typedef struct PyPetscScatterObject PyPetscScatterObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscScatter_Type;
/* "petsc4py/PETSc.pxd":211
* cdef PetscScatter sct
*
* ctypedef public api class Section(Object) [ # <<<<<<<<<<<<<<
* type PyPetscSection_Type,
* object PyPetscSectionObject,
*/
struct PyPetscSectionObject {
struct PyPetscObjectObject __pyx_base;
PetscSection sec;
};
typedef struct PyPetscSectionObject PyPetscSectionObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSection_Type;
/* "petsc4py/PETSc.pxd":217
* cdef PetscSection sec
*
* ctypedef public api class Mat(Object) [ # <<<<<<<<<<<<<<
* type PyPetscMat_Type,
* object PyPetscMatObject,
*/
struct PyPetscMatObject {
struct PyPetscObjectObject __pyx_base;
Mat mat;
};
typedef struct PyPetscMatObject PyPetscMatObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscMat_Type;
/* "petsc4py/PETSc.pxd":223
* cdef PetscMat mat
*
* ctypedef public api class MatPartitioning(Object) [ # <<<<<<<<<<<<<<
* type PyPetscMatPartitioning_Type,
* object PyPetscMatPartitioningObject,
*/
struct PyPetscMatPartitioningObject {
struct PyPetscObjectObject __pyx_base;
MatPartitioning part;
};
typedef struct PyPetscMatPartitioningObject PyPetscMatPartitioningObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscMatPartitioning_Type;
/* "petsc4py/PETSc.pxd":229
* cdef PetscMatPartitioning part
*
* ctypedef public api class NullSpace(Object) [ # <<<<<<<<<<<<<<
* type PyPetscNullSpace_Type,
* object PyPetscNullSpaceObject,
*/
struct PyPetscNullSpaceObject {
struct PyPetscObjectObject __pyx_base;
MatNullSpace nsp;
};
typedef struct PyPetscNullSpaceObject PyPetscNullSpaceObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscNullSpace_Type;
/* "petsc4py/PETSc.pxd":235
* cdef PetscNullSpace nsp
*
* ctypedef public api class PC(Object) [ # <<<<<<<<<<<<<<
* type PyPetscPC_Type,
* object PyPetscPCObject,
*/
struct PyPetscPCObject {
struct PyPetscObjectObject __pyx_base;
PC pc;
};
typedef struct PyPetscPCObject PyPetscPCObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscPC_Type;
/* "petsc4py/PETSc.pxd":241
* cdef PetscPC pc
*
* ctypedef public api class KSP(Object) [ # <<<<<<<<<<<<<<
* type PyPetscKSP_Type,
* object PyPetscKSPObject,
*/
struct PyPetscKSPObject {
struct PyPetscObjectObject __pyx_base;
KSP ksp;
};
typedef struct PyPetscKSPObject PyPetscKSPObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscKSP_Type;
/* "petsc4py/PETSc.pxd":247
* cdef PetscKSP ksp
*
* ctypedef public api class SNES(Object) [ # <<<<<<<<<<<<<<
* type PyPetscSNES_Type,
* object PyPetscSNESObject,
*/
struct PyPetscSNESObject {
struct PyPetscObjectObject __pyx_base;
SNES snes;
};
typedef struct PyPetscSNESObject PyPetscSNESObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSNES_Type;
/* "petsc4py/PETSc.pxd":253
* cdef PetscSNES snes
*
* ctypedef public api class TS(Object) [ # <<<<<<<<<<<<<<
* type PyPetscTS_Type,
* object PyPetscTSObject,
*/
struct PyPetscTSObject {
struct PyPetscObjectObject __pyx_base;
TS ts;
};
typedef struct PyPetscTSObject PyPetscTSObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTS_Type;
/* "petsc4py/PETSc.pxd":259
* cdef PetscTS ts
*
* ctypedef public api class TAO(Object) [ # <<<<<<<<<<<<<<
* type PyPetscTAO_Type,
* object PyPetscTAOObject,
*/
struct PyPetscTAOObject {
struct PyPetscObjectObject __pyx_base;
Tao tao;
};
typedef struct PyPetscTAOObject PyPetscTAOObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTAO_Type;
/* "petsc4py/PETSc.pxd":265
* cdef PetscTAO tao
*
* ctypedef public api class 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":271
* 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":277
* 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":283
* cdef PetscDMPlexTransform tr
*
* ctypedef public api class DS(Object) [ # <<<<<<<<<<<<<<
* type PyPetscDS_Type,
* object PyPetscDSObject,
*/
struct PyPetscDSObject {
struct PyPetscObjectObject __pyx_base;
PetscDS ds;
};
typedef struct PyPetscDSObject PyPetscDSObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDS_Type;
/* "petsc4py/PETSc.pxd":289
* 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":295
* cdef PetscPartitioner part
*
* ctypedef public api class DMLabel(Object) [ # <<<<<<<<<<<<<<
* type PyPetscDMLabel_Type,
* object PyPetscDMLabelObject,
*/
struct PyPetscDMLabelObject {
struct PyPetscObjectObject __pyx_base;
DMLabel dmlabel;
};
typedef struct PyPetscDMLabelObject PyPetscDMLabelObject;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDMLabel_Type;
/* "petsc4py/PETSc/petscis.pxi":111
* # --------------------------------------------------------------------
*
* cdef class _IS_buffer: # <<<<<<<<<<<<<<
*
* cdef PetscIS iset
*/
struct __pyx_obj_8petsc4py_5PETSc__IS_buffer {
PyObject_HEAD
struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *__pyx_vtab;
IS iset;
PetscInt size;
PetscInt const *data;
int hasarray;
};
/* "petsc4py/PETSc/petscvec.pxi":489
* 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":609
* # --------------------------------------------------------------------
*
* cdef class _Vec_LocalForm: # <<<<<<<<<<<<<<
*
* "Context manager for `Vec` local form"
*/
struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm {
PyObject_HEAD
struct PyPetscVecObject *gvec;
struct PyPetscVecObject *lvec;
};
/* "petsc4py/PETSc/petscmat.pxi":1138
*
* #@cython.internal
* cdef class _Mat_Stencil: # <<<<<<<<<<<<<<
* cdef PetscMatStencil stencil
* property i:
*/
struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil {
PyObject_HEAD
MatStencil stencil;
};
/* "petsc4py/PETSc/petscdmda.pxi":198
* # --------------------------------------------------------------------
*
* cdef class _DMDA_Vec_array(object): # <<<<<<<<<<<<<<
*
* cdef _Vec_buffer vecbuf
*/
struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array {
PyObject_HEAD
struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_vtab;
struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *vecbuf;
PyObject *starts;
PyObject *sizes;
PyObject *shape;
PyObject *strides;
PyArrayObject *array;
};
/* "petsc4py/PETSc/petscdmcomposite.pxi":17
* PetscErrorCode DMCompositeGetISLocalToGlobalMappings(PetscDM,PetscLGMap**)
*
* cdef class _DMComposite_access: # <<<<<<<<<<<<<<
* cdef PetscDM dm
* cdef PetscVec gvec
*/
struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access {
PyObject_HEAD
DM dm;
Vec gvec;
PetscInt nlocs;
PetscInt *locs;
Vec *vecs;
PyObject *locs_mem;
PyObject *vecs_mem;
PyObject *access;
};
/* "petsc4py/PETSc/Options.pyx":3
* # --------------------------------------------------------------------
*
* cdef class Options: # <<<<<<<<<<<<<<
*
* cdef PetscOptions opt
*/
struct __pyx_obj_8petsc4py_5PETSc_Options {
PyObject_HEAD
PetscOptions opt;
PyObject *_prefix;
};
/* "petsc4py/PETSc/Sys.pyx":3
* # --------------------------------------------------------------------
*
* cdef class Sys: # <<<<<<<<<<<<<<
*
* @classmethod
*/
struct __pyx_obj_8petsc4py_5PETSc_Sys {
PyObject_HEAD
};
/* "petsc4py/PETSc/Log.pyx":5
*
*
* cdef class Log: # <<<<<<<<<<<<<<
*
* @classmethod
*/
struct __pyx_obj_8petsc4py_5PETSc_Log {
PyObject_HEAD
};
/* "petsc4py/PETSc/Log.pyx":129
* # --------------------------------------------------------------------
*
* cdef class LogStage: # <<<<<<<<<<<<<<
*
* cdef readonly PetscLogStage id
*/
struct __pyx_obj_8petsc4py_5PETSc_LogStage {
PyObject_HEAD
PetscLogStage id;
};
/* "petsc4py/PETSc/Log.pyx":225
* # --------------------------------------------------------------------
*
* cdef class LogClass: # <<<<<<<<<<<<<<
*
* cdef readonly PetscLogClass id
*/
struct __pyx_obj_8petsc4py_5PETSc_LogClass {
PyObject_HEAD
PetscClassId id;
};
/* "petsc4py/PETSc/Log.pyx":287
* # --------------------------------------------------------------------
*
* cdef class LogEvent: # <<<<<<<<<<<<<<
*
* cdef readonly PetscLogEvent id
*/
struct __pyx_obj_8petsc4py_5PETSc_LogEvent {
PyObject_HEAD
PetscLogEvent id;
};
/* "petsc4py/PETSc/Viewer.pyx":374
* # --------------------------------------------------------------------
*
* cdef class ViewerHDF5(Viewer): # <<<<<<<<<<<<<<
*
* def create(self, name, mode=None, comm=None):
*/
struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 {
struct PyPetscViewerObject __pyx_base;
};
/* "petsc4py/PETSc/DMDA.pyx":17
* # --------------------------------------------------------------------
*
* cdef class DMDA(DM): # <<<<<<<<<<<<<<
*
* StencilType = DMDAStencilType
*/
struct __pyx_obj_8petsc4py_5PETSc_DMDA {
struct PyPetscDMObject __pyx_base;
};
/* "petsc4py/PETSc/DMPlex.pyx":10
* # --------------------------------------------------------------------
*
* cdef class DMPlex(DM): # <<<<<<<<<<<<<<
*
* ReorderDefaultFlag = DMPlexReorderDefaultFlag
*/
struct __pyx_obj_8petsc4py_5PETSc_DMPlex {
struct PyPetscDMObject __pyx_base;
};
/* "petsc4py/PETSc/DMStag.pyx":40
* # --------------------------------------------------------------------
*
* cdef class DMStag(DM): # <<<<<<<<<<<<<<
*
* StencilType = DMStagStencilType
*/
struct __pyx_obj_8petsc4py_5PETSc_DMStag {
struct PyPetscDMObject __pyx_base;
};
/* "petsc4py/PETSc/DMComposite.pyx":3
* # --------------------------------------------------------------------
*
* cdef class DMComposite(DM): # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
struct __pyx_obj_8petsc4py_5PETSc_DMComposite {
struct PyPetscDMObject __pyx_base;
};
/* "petsc4py/PETSc/DMShell.pyx":1
* cdef class DMShell(DM): # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
struct __pyx_obj_8petsc4py_5PETSc_DMShell {
struct PyPetscDMObject __pyx_base;
};
/* "petsc4py/PETSc/DMSwarm.pyx":25
*
*
* cdef class DMSwarm(DM): # <<<<<<<<<<<<<<
*
* Type = DMSwarmType
*/
struct __pyx_obj_8petsc4py_5PETSc_DMSwarm {
struct PyPetscDMObject __pyx_base;
};
/* "petsc4py/PETSc/DMUtils.pyx":2
*
* cdef class DMInterpolation: # <<<<<<<<<<<<<<
*
* cdef PetscDMInterpolation dminterp
*/
struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation {
PyObject_HEAD
DMInterpolationInfo dminterp;
};
/* "petsc4py/PETSc/libpetsc4py.pyx":172
*
* @cython.internal
* cdef class _PyObj: # <<<<<<<<<<<<<<
*
* cdef object self
*/
struct __pyx_obj_8petsc4py_5PETSc__PyObj {
PyObject_HEAD
struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj *__pyx_vtab;
PyObject *self;
PyObject *name;
};
/* "petsc4py/PETSc/libpetsc4py.pyx":343
*
* @cython.internal
* cdef class _PyMat(_PyObj): pass # <<<<<<<<<<<<<<
* cdef inline _PyMat PyMat(PetscMat mat):
* if mat != NULL and mat.data != NULL:
*/
struct __pyx_obj_8petsc4py_5PETSc__PyMat {
struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base;
};
/* "petsc4py/PETSc/libpetsc4py.pyx":1251
*
* @cython.internal
* cdef class _PyPC(_PyObj): pass # <<<<<<<<<<<<<<
* cdef inline _PyPC PyPC(PetscPC pc):
* if pc != NULL and pc.data != NULL:
*/
struct __pyx_obj_8petsc4py_5PETSc__PyPC {
struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base;
};
/* "petsc4py/PETSc/libpetsc4py.pyx":1548
*
* @cython.internal
* cdef class _PyKSP(_PyObj): pass # <<<<<<<<<<<<<<
* cdef inline _PyKSP PyKSP(PetscKSP ksp):
* if ksp != NULL and ksp.data != NULL:
*/
struct __pyx_obj_8petsc4py_5PETSc__PyKSP {
struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base;
};
/* "petsc4py/PETSc/libpetsc4py.pyx":1910
*
* @cython.internal
* cdef class _PySNES(_PyObj): pass # <<<<<<<<<<<<<<
* cdef inline _PySNES PySNES(PetscSNES snes):
* if snes != NULL and snes.data != NULL:
*/
struct __pyx_obj_8petsc4py_5PETSc__PySNES {
struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base;
};
/* "petsc4py/PETSc/libpetsc4py.pyx":2261
*
* @cython.internal
* cdef class _PyTS(_PyObj): pass # <<<<<<<<<<<<<<
* cdef inline _PyTS PyTS(PetscTS ts):
* if ts != NULL and ts.data != NULL:
*/
struct __pyx_obj_8petsc4py_5PETSc__PyTS {
struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base;
};
/* "petsc4py/PETSc/libpetsc4py.pyx":2682
*
* @cython.internal
* cdef class _PyTao(_PyObj): pass # <<<<<<<<<<<<<<
* cdef inline _PyTao PyTao(PetscTAO tao):
* if tao != NULL and tao.data != NULL:
*/
struct __pyx_obj_8petsc4py_5PETSc__PyTao {
struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base;
};
/* "petsc4py/PETSc/Log.pyx":92
*
* @classmethod
* def EventDecorator(cls, name=None, klass=None): # <<<<<<<<<<<<<<
* """Decorate a function with a PETSc event.
*
*/
struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator {
PyObject_HEAD
PyTypeObject *__pyx_v_cls;
PyObject *__pyx_v_klass;
PyObject *__pyx_v_name;
};
/* "petsc4py/PETSc/Log.pyx":108
* ...
* """
* 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":106
*
* @cname("__pyx_array")
* cdef class array: # <<<<<<<<<<<<<<
*
* cdef:
*/
struct __pyx_array_obj {
PyObject_HEAD
struct __pyx_vtabstruct_array *__pyx_vtab;
char *data;
Py_ssize_t len;
char *format;
int ndim;
Py_ssize_t *_shape;
Py_ssize_t *_strides;
Py_ssize_t itemsize;
PyObject *mode;
PyObject *_format;
void (*callback_free_data)(void *);
int free_data;
int dtype_is_object;
};
/* "View.MemoryView":280
*
* @cname('__pyx_MemviewEnum')
* cdef class Enum(object): # <<<<<<<<<<<<<<
* cdef object name
* def __init__(self, name):
*/
struct __pyx_MemviewEnum_obj {
PyObject_HEAD
PyObject *name;
};
/* "View.MemoryView":331
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
*
* cdef object obj
*/
struct __pyx_memoryview_obj {
PyObject_HEAD
struct __pyx_vtabstruct_memoryview *__pyx_vtab;
PyObject *obj;
PyObject *_size;
PyObject *_array_interface;
PyThread_type_lock lock;
__pyx_atomic_int acquisition_count[2];
__pyx_atomic_int *acquisition_count_aligned_p;
Py_buffer view;
int flags;
int dtype_is_object;
__Pyx_TypeInfo *typeinfo;
};
/* "View.MemoryView":967
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
* "Internal class for passing memoryview slices to Python"
*
*/
struct __pyx_memoryviewslice_obj {
struct __pyx_memoryview_obj __pyx_base;
__Pyx_memviewslice from_slice;
PyObject *from_object;
PyObject *(*to_object_func)(char *);
int (*to_dtype_func)(char *, PyObject *);
};
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscObject_Type;
/* "petsc4py/PETSc/Object.pyx":3
* # --------------------------------------------------------------------
*
* cdef class Object: # <<<<<<<<<<<<<<
*
* # --- special methods ---
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc_Object {
PyObject *(*get_attr)(struct PyPetscObjectObject *, char *);
PyObject *(*set_attr)(struct PyPetscObjectObject *, char *, PyObject *);
PyObject *(*get_dict)(struct PyPetscObjectObject *);
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *__pyx_vtabptr_8petsc4py_5PETSc_Object;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscViewer_Type;
/* "petsc4py/PETSc/Viewer.pyx":84
* # --------------------------------------------------------------------
*
* cdef class Viewer(Object): # <<<<<<<<<<<<<<
*
* Type = ViewerType
*/
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":12
* # --------------------------------------------------------------------
*
* cdef class Random(Object): # <<<<<<<<<<<<<<
*
* Type = RandomType
*/
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":109
* # --------------------------------------------------------------------
*
* cdef class DeviceContext(Object): # <<<<<<<<<<<<<<
*
* JoinMode = DeviceJoinMode
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc_DeviceContext {
struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_DeviceContext *__pyx_vtabptr_8petsc4py_5PETSc_DeviceContext;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscIS_Type;
/* "petsc4py/PETSc/IS.pyx":10
* # --------------------------------------------------------------------
*
* cdef class IS(Object): # <<<<<<<<<<<<<<
*
* Type = ISType
*/
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":369
* # --------------------------------------------------------------------
*
* cdef class LGMap(Object): # <<<<<<<<<<<<<<
*
* MapMode = GLMapMode
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc_LGMap {
struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_LGMap *__pyx_vtabptr_8petsc4py_5PETSc_LGMap;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSF_Type;
/* "petsc4py/PETSc/SF.pyx":15
* # --------------------------------------------------------------------
*
* cdef class SF(Object): # <<<<<<<<<<<<<<
*
* Type = SFType
*/
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":28
* # --------------------------------------------------------------------
*
* cdef class Vec(Object): # <<<<<<<<<<<<<<
*
* Type = VecType
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec {
struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *__pyx_vtabptr_8petsc4py_5PETSc_Vec;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSpace_Type;
/* "petsc4py/PETSc/Space.pyx":14
* # --------------------------------------------------------------------
*
* cdef class Space(Object): # <<<<<<<<<<<<<<
*
* 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":192
* # --------------------------------------------------------------------
*
* cdef class DualSpace(Object): # <<<<<<<<<<<<<<
*
* Type = DualSpaceType
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc_DualSpace {
struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_DualSpace *__pyx_vtabptr_8petsc4py_5PETSc_DualSpace;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscFE_Type;
/* "petsc4py/PETSc/FE.pyx":10
* # --------------------------------------------------------------------
*
* cdef class FE(Object): # <<<<<<<<<<<<<<
*
* Type = FEType
*/
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): # <<<<<<<<<<<<<<
*
* 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":15
* # --------------------------------------------------------------------
*
* cdef class Scatter(Object): # <<<<<<<<<<<<<<
*
* Type = ScatterType
*/
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): # <<<<<<<<<<<<<<
*
* def __cinit__(self):
*/
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":206
* # --------------------------------------------------------------------
*
* cdef class Mat(Object): # <<<<<<<<<<<<<<
*
* Type = MatType
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat {
struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *__pyx_vtabptr_8petsc4py_5PETSc_Mat;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscMatPartitioning_Type;
/* "petsc4py/PETSc/MatPartitioning.pyx":15
* # --------------------------------------------------------------------
*
* cdef class MatPartitioning(Object): # <<<<<<<<<<<<<<
*
* Type = MatPartitioningType
*/
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":2011
* # --------------------------------------------------------------------
*
* cdef class 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":146
* # --------------------------------------------------------------------
*
* cdef class PC(Object): # <<<<<<<<<<<<<<
*
* Type = PCType
*/
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":94
* # --------------------------------------------------------------------
*
* cdef class KSP(Object): # <<<<<<<<<<<<<<
*
* Type = KSPType
*/
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":65
* # --------------------------------------------------------------------
*
* cdef class SNES(Object): # <<<<<<<<<<<<<<
*
* Type = SNESType
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES {
struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *__pyx_vtabptr_8petsc4py_5PETSc_SNES;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTS_Type;
/* "petsc4py/PETSc/TS.pyx":103
* # -----------------------------------------------------------------------------
*
* cdef class TS(Object): # <<<<<<<<<<<<<<
*
* Type = TSType
*/
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":66
* # --------------------------------------------------------------------
*
* cdef class TAO(Object): # <<<<<<<<<<<<<<
*
* """
*/
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) PyPetscAO_Type;
/* "petsc4py/PETSc/AO.pyx":11
* # --------------------------------------------------------------------
*
* cdef class AO(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":46
* # --------------------------------------------------------------------
*
* cdef class DM(Object): # <<<<<<<<<<<<<<
*
* Type = DMType
*/
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":1007
* TRANSFORMFILTER = S_(DMPLEXTRANSFORMFILTER)
*
* cdef class DMPlexTransform(Object): # <<<<<<<<<<<<<<
*
* def __cinit__(self):
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc_DMPlexTransform {
struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMPlexTransform *__pyx_vtabptr_8petsc4py_5PETSc_DMPlexTransform;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDS_Type;
/* "petsc4py/PETSc/DS.pyx":8
* # --------------------------------------------------------------------
*
* cdef class DS(Object): # <<<<<<<<<<<<<<
*
* Type = DSType
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc_DS {
struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_DS *__pyx_vtabptr_8petsc4py_5PETSc_DS;
__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscPartitioner_Type;
/* "petsc4py/PETSc/Partitioner.pyx":14
* # --------------------------------------------------------------------
*
* cdef class Partitioner(Object): # <<<<<<<<<<<<<<
*
* Type = PartitionerType
*/
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): # <<<<<<<<<<<<<<
*
* def __cinit__(self):
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc_DMLabel {
struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMLabel *__pyx_vtabptr_8petsc4py_5PETSc_DMLabel;
/* "petsc4py/PETSc/petscis.pxi":111
* # --------------------------------------------------------------------
*
* cdef class _IS_buffer: # <<<<<<<<<<<<<<
*
* cdef PetscIS iset
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer {
int (*acquire)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *);
int (*release)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *);
int (*acquirebuffer)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *, Py_buffer *, int);
int (*releasebuffer)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *, Py_buffer *);
PyObject *(*enter)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *);
PyObject *(*exit)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *);
Py_ssize_t (*getbuffer)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *, void **);
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *__pyx_vtabptr_8petsc4py_5PETSc__IS_buffer;
/* "petsc4py/PETSc/petscvec.pxi":489
* return 0
*
* cdef class _Vec_buffer: # <<<<<<<<<<<<<<
*
* cdef PetscVec vec
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer {
int (*acquire)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *);
int (*release)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *);
int (*acquirebuffer)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *, Py_buffer *, int);
int (*releasebuffer)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *, Py_buffer *);
PyObject *(*enter)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *);
PyObject *(*exit)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *);
Py_ssize_t (*getbuffer)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *, void **);
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *__pyx_vtabptr_8petsc4py_5PETSc__Vec_buffer;
/* "petsc4py/PETSc/petscdmda.pxi":198
* # --------------------------------------------------------------------
*
* cdef class _DMDA_Vec_array(object): # <<<<<<<<<<<<<<
*
* cdef _Vec_buffer vecbuf
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array {
int (*acquire)(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *);
int (*release)(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *);
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_vtabptr_8petsc4py_5PETSc__DMDA_Vec_array;
/* "petsc4py/PETSc/Viewer.pyx":374
* # --------------------------------------------------------------------
*
* cdef class ViewerHDF5(Viewer): # <<<<<<<<<<<<<<
*
* def create(self, name, mode=None, comm=None):
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc_ViewerHDF5 {
struct __pyx_vtabstruct_8petsc4py_5PETSc_Viewer __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_ViewerHDF5 *__pyx_vtabptr_8petsc4py_5PETSc_ViewerHDF5;
/* "petsc4py/PETSc/DMDA.pyx":17
* # --------------------------------------------------------------------
*
* cdef class DMDA(DM): # <<<<<<<<<<<<<<
*
* StencilType = DMDAStencilType
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc_DMDA {
struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMDA *__pyx_vtabptr_8petsc4py_5PETSc_DMDA;
/* "petsc4py/PETSc/DMPlex.pyx":10
* # --------------------------------------------------------------------
*
* cdef class DMPlex(DM): # <<<<<<<<<<<<<<
*
* ReorderDefaultFlag = DMPlexReorderDefaultFlag
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc_DMPlex {
struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMPlex *__pyx_vtabptr_8petsc4py_5PETSc_DMPlex;
/* "petsc4py/PETSc/DMStag.pyx":40
* # --------------------------------------------------------------------
*
* cdef class DMStag(DM): # <<<<<<<<<<<<<<
*
* StencilType = DMStagStencilType
*/
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): # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
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): # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell {
struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *__pyx_vtabptr_8petsc4py_5PETSc_DMShell;
/* "petsc4py/PETSc/DMSwarm.pyx":25
*
*
* cdef class DMSwarm(DM): # <<<<<<<<<<<<<<
*
* Type = DMSwarmType
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc_DMSwarm {
struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMSwarm *__pyx_vtabptr_8petsc4py_5PETSc_DMSwarm;
/* "petsc4py/PETSc/libpetsc4py.pyx":172
*
* @cython.internal
* cdef class _PyObj: # <<<<<<<<<<<<<<
*
* cdef object self
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj {
int (*setcontext)(struct __pyx_obj_8petsc4py_5PETSc__PyObj *, void *, struct PyPetscObjectObject *);
int (*getcontext)(struct __pyx_obj_8petsc4py_5PETSc__PyObj *, void **);
int (*setname)(struct __pyx_obj_8petsc4py_5PETSc__PyObj *, char *);
char *(*getname)(struct __pyx_obj_8petsc4py_5PETSc__PyObj *);
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj *__pyx_vtabptr_8petsc4py_5PETSc__PyObj;
/* "petsc4py/PETSc/libpetsc4py.pyx":343
*
* @cython.internal
* cdef class _PyMat(_PyObj): pass # <<<<<<<<<<<<<<
* cdef inline _PyMat PyMat(PetscMat mat):
* if mat != NULL and mat.data != NULL:
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc__PyMat {
struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyMat *__pyx_vtabptr_8petsc4py_5PETSc__PyMat;
/* "petsc4py/PETSc/libpetsc4py.pyx":1251
*
* @cython.internal
* cdef class _PyPC(_PyObj): pass # <<<<<<<<<<<<<<
* cdef inline _PyPC PyPC(PetscPC pc):
* if pc != NULL and pc.data != NULL:
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc__PyPC {
struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyPC *__pyx_vtabptr_8petsc4py_5PETSc__PyPC;
/* "petsc4py/PETSc/libpetsc4py.pyx":1548
*
* @cython.internal
* cdef class _PyKSP(_PyObj): pass # <<<<<<<<<<<<<<
* cdef inline _PyKSP PyKSP(PetscKSP ksp):
* if ksp != NULL and ksp.data != NULL:
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc__PyKSP {
struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyKSP *__pyx_vtabptr_8petsc4py_5PETSc__PyKSP;
/* "petsc4py/PETSc/libpetsc4py.pyx":1910
*
* @cython.internal
* cdef class _PySNES(_PyObj): pass # <<<<<<<<<<<<<<
* cdef inline _PySNES PySNES(PetscSNES snes):
* if snes != NULL and snes.data != NULL:
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc__PySNES {
struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc__PySNES *__pyx_vtabptr_8petsc4py_5PETSc__PySNES;
/* "petsc4py/PETSc/libpetsc4py.pyx":2261
*
* @cython.internal
* cdef class _PyTS(_PyObj): pass # <<<<<<<<<<<<<<
* cdef inline _PyTS PyTS(PetscTS ts):
* if ts != NULL and ts.data != NULL:
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTS {
struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTS *__pyx_vtabptr_8petsc4py_5PETSc__PyTS;
/* "petsc4py/PETSc/libpetsc4py.pyx":2682
*
* @cython.internal
* cdef class _PyTao(_PyObj): pass # <<<<<<<<<<<<<<
* cdef inline _PyTao PyTao(PetscTAO tao):
* if tao != NULL and tao.data != NULL:
*/
struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTao {
struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyTao *__pyx_vtabptr_8petsc4py_5PETSc__PyTao;
/* "View.MemoryView":106
*
* @cname("__pyx_array")
* cdef class array: # <<<<<<<<<<<<<<
*
* cdef:
*/
struct __pyx_vtabstruct_array {
PyObject *(*get_memview)(struct __pyx_array_obj *);
};
static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
/* "View.MemoryView":331
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
*
* cdef object obj
*/
struct __pyx_vtabstruct_memoryview {
char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
};
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
/* "View.MemoryView":967
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
* "Internal class for passing memoryview slices to Python"
*
*/
struct __pyx_vtabstruct__memoryviewslice {
struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
typedef struct {
void (*INCREF)(void*, PyObject*, int);
void (*DECREF)(void*, PyObject*, int);
void (*GOTREF)(void*, PyObject*, int);
void (*GIVEREF)(void*, PyObject*, int);
void* (*SetupContext)(const char*, int, const char*);
void (*FinishContext)(void**);
} __Pyx_RefNannyAPIStruct;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
if (acquire_gil) {\
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
PyGILState_Release(__pyx_gilstate_save);\
} else {\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
}
#else
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
#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) {__Pyx_INCREF(r); }} while(0)
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
#define __Pyx_RefNannyDeclarations
#define __Pyx_RefNannySetupContext(name, acquire_gil)
#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_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)
/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
/* KeywordStringCheck.proto */
static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
/* decode_c_string_utf16.proto */
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
int byteorder = 0;
return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
int byteorder = -1;
return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
int byteorder = 1;
return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
/* decode_c_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
/* decode_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
PyObject* string, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
return __Pyx_decode_c_bytes(
PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string),
start, stop, encoding, errors, decode_func);
}
/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
__Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
(sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
#if CYTHON_FAST_PYCALL
static size_t __pyx_pyframe_localsplus_offset = 0;
#include "frameobject.h"
#if PY_VERSION_HEX >= 0x030b00a6
#ifndef Py_BUILD_CORE
#define Py_BUILD_CORE 1
#endif
#include "internal/pycore_frame.h"
#endif
#define __Pxy_PyFrame_Initialize_Offsets()\
((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
(void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
#define __Pyx_PyFrame_GetLocalsplus(frame)\
(assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif // CYTHON_FAST_PYCALL
#endif
/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif
/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
#endif
/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred() PyErr_Occurred()
#endif
/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON
#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
/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename,
int full_traceback, int nogil);
/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
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
/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
#endif
/* 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
/* IncludeStringH.proto */
#include <string.h>
/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif
/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
/* PyObjectCall2Args.proto */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
/* 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);
PyList_SET_ITEM(list, len, x);
__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
/* 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
/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
/* pop_index.proto */
static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix);
static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix);
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix);
#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\
(likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\
__Pyx__PyList_PopIndex(L, py_ix, ix) : (\
(unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\
__Pyx__PyObject_PopIndex(L, py_ix)))
#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\
__Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\
__Pyx__PyList_PopIndex(L, py_ix, ix) : (\
(unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\
__Pyx__PyObject_PopIndex(L, py_ix)))
#else
#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\
__Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)
#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\
(unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\
__Pyx__PyObject_PopIndex(L, py_ix))
#endif
/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
int has_cstart, int has_cstop, int wraparound);
/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
(is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
(PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
(PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list, int wraparound, int boundscheck);
/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);
/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
/* 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
/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
const char* function_name);
/* 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);
/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
__Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif
/* dict_getitem_default.proto */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);
/* UnpackUnboundCMethod.proto */
typedef struct {
PyObject *type;
PyObject **method_name;
PyCFunction func;
PyObject *method;
int flag;
} __Pyx_CachedCFunction;
/* CallUnboundCMethod1.proto */
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#else
#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg)
#endif
/* CallUnboundCMethod2.proto */
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif
/* AssertionsEnabled.proto */
#define __Pyx_init_assertions_enabled()
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
#define __pyx_assertions_enabled() (1)
#elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API)
#define __pyx_assertions_enabled() (!Py_OptimizeFlag)
#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6
static int __pyx_assertions_enabled_flag;
#define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
#undef __Pyx_init_assertions_enabled
static void __Pyx_init_assertions_enabled(void) {
__pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
}
#else
#define __pyx_assertions_enabled() (!Py_OptimizeFlag)
#endif
/* py_dict_pop.proto */
static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value);
/* py_dict_keys.proto */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d);
/* CallUnboundCMethod0.proto */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CallUnboundCMethod0(cfunc, self)\
(likely((cfunc)->func) ?\
(likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\
(PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\
(PY_VERSION_HEX >= 0x030700A0 ?\
(*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\
(*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\
(PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\
(*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\
(likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\
__Pyx__CallUnboundCMethod0(cfunc, self)))))) :\
__Pyx__CallUnboundCMethod0(cfunc, self))
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
#endif
/* 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));
}
/* MemviewSliceInit.proto */
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT 1
#define __Pyx_MEMVIEW_PTR 2
#define __Pyx_MEMVIEW_FULL 4
#define __Pyx_MEMVIEW_CONTIG 8
#define __Pyx_MEMVIEW_STRIDED 16
#define __Pyx_MEMVIEW_FOLLOW 32
#define __Pyx_IS_C_CONTIG 1
#define __Pyx_IS_F_CONTIG 2
static int __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
int ndim,
__Pyx_memviewslice *memviewslice,
int memview_is_new_reference);
static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
__pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
__pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
(version_var) = __PYX_GET_DICT_VERSION(dict);\
(cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
static PY_UINT64_T __pyx_dict_version = 0;\
static PyObject *__pyx_dict_cached_value = NULL;\
if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
(VAR) = __pyx_dict_cached_value;\
} else {\
(VAR) = __pyx_dict_cached_value = (LOOKUP);\
__pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
}\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict) (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
#endif
/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name) do {\
static PY_UINT64_T __pyx_dict_version = 0;\
static PyObject *__pyx_dict_cached_value = NULL;\
(var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
(likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
__Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
PY_UINT64_T __pyx_dict_version;\
PyObject *__pyx_dict_cached_value;\
(var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif
/* SetItemInt.proto */
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
(is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
__Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
int is_list, int wraparound, int boundscheck);
/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
(inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif
/* 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);
PyList_SET_ITEM(list, len, x);
__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
/* pyfrozenset_new.proto */
static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it);
/* PySetContains.proto */
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq);
/* StringJoin.proto */
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyString_Join __Pyx_PyBytes_Join
#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
#else
#define __Pyx_PyString_Join PyUnicode_Join
#define __Pyx_PyBaseString_Join PyUnicode_Join
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyBytes_Join _PyString_Join
#else
#define __Pyx_PyBytes_Join _PyBytes_Join
#endif
#else
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
#endif
/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
/* PyObjectLookupSpecial.proto */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
PyObject *res;
PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
if (unlikely(PyInstance_Check(obj)))
return __Pyx_PyObject_GetAttrStr(obj, attr_name);
#endif
res = _PyType_Lookup(tp, attr_name);
if (likely(res)) {
descrgetfunc f = Py_TYPE(res)->tp_descr_get;
if (!f) {
Py_INCREF(res);
} else {
res = f(res, obj, (PyObject *)tp);
}
} else {
PyErr_SetObject(PyExc_AttributeError, attr_name);
}
return res;
}
#else
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif
/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED 1
#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
#define __Pyx_CYFUNCTION_CCLASS 0x04
#define __Pyx_CyFunction_GetClosure(f)\
(((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
(((__pyx_CyFunctionObject *) (f))->func_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 {
PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
PyObject *func_weakreflist;
#endif
PyObject *func_dict;
PyObject *func_name;
PyObject *func_qualname;
PyObject *func_doc;
PyObject *func_globals;
PyObject *func_code;
PyObject *func_closure;
PyObject *func_classobj;
void *defaults;
int defaults_pyobjects;
size_t defaults_size; // used by FusedFunction for copying defaults
int flags;
PyObject *defaults_tuple;
PyObject *defaults_kwdict;
PyObject *(*defaults_getter)(PyObject *);
PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
int flags, PyObject* qualname,
PyObject *self,
PyObject *module, PyObject *globals,
PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
size_t size,
int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
PyObject *dict);
static int __pyx_CyFunction_init(void);
/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
PyObject *closure,
PyObject *module, PyObject *globals,
PyObject* code);
/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
/* pop.proto */
static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L);
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L);
#define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ?\
__Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L))
#else
#define __Pyx_PyList_Pop(L) __Pyx__PyObject_Pop(L)
#define __Pyx_PyObject_Pop(L) __Pyx__PyObject_Pop(L)
#endif
/* PyDictContains.proto */
static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
int result = PyDict_Contains(dict, item);
return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}
/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
(likely(PyDict_CheckExact(obj)) ?\
__Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
#endif
/* SliceObject.proto */
#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
__Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
int has_cstart, int has_cstop, int wraparound);
/* CallableCheck.proto */
#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3
#define __Pyx_PyCallable_Check(obj) (Py_TYPE(obj)->tp_call != NULL)
#else
#define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj)
#endif
/* SliceTupleAndList.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
#else
#define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop)
#define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop)
#endif
/* PyExec.proto */
static PyObject* __Pyx_PyExec3(PyObject*, PyObject*, PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject*, PyObject*);
/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(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)
/* UnaryNegOverflows.proto */
#define UNARY_NEG_WOULD_OVERFLOW(x)\
(((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
static CYTHON_UNUSED 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*/
/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
static CYTHON_INLINE int __Pyx_IsSubtype(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_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
PyObject* none = _PyList_Extend((PyListObject*)L, v);
if (unlikely(!none))
return -1;
Py_DECREF(none);
return 0;
#else
return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
#endif
}
/* PyObject_Unicode.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyObject_Unicode(obj)\
(likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
#else
#define __Pyx_PyObject_Unicode(obj)\
(likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
#endif
/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif
/* PyObject_GenericGetAttr.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
#endif
/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_0_29_36
#define __PYX_HAVE_RT_ImportType_proto_0_29_36
#if __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_0_29_36(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_0_29_36 {
__Pyx_ImportType_CheckSize_Error_0_29_36 = 0,
__Pyx_ImportType_CheckSize_Warn_0_29_36 = 1,
__Pyx_ImportType_CheckSize_Ignore_0_29_36 = 2
};
static PyTypeObject *__Pyx_ImportType_0_29_36(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_0_29_36 check_size);
#endif
/* PyObjectGetAttrStrNoError.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);
/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
#define __Pyx_SetNameInClass(ns, name, value)\
(likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_SetNameInClass(ns, name, value)\
(likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
#else
#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
#endif
/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
/* ClassMethod.proto */
#include "descrobject.h"
static CYTHON_UNUSED PyObject* __Pyx_Method_ClassMethod(PyObject *method);
/* GetNameInClass.proto */
#define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name)
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name);
/* RegisterModuleCleanup.proto */
static void __pyx_module_cleanup(PyObject *self);
#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
static int __Pyx_RegisterCleanup(void);
#else
#define __Pyx_RegisterCleanup() (0)
#endif
/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif
/* CodeObjectCache.proto */
typedef struct {
PyCodeObject* code_object;
int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
int max_count;
__Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
static void __Pyx_ReleaseBuffer(Py_buffer *view);
#else
#define __Pyx_GetBuffer PyObject_GetBuffer
#define __Pyx_ReleaseBuffer PyBuffer_Release
#endif
/* BufferStructDeclare.proto */
typedef struct {
Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
size_t refcount;
Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
__Pyx_Buffer *rcbuffer;
char *data;
__Pyx_Buf_DimInfo diminfo[8];
} __Pyx_LocalBuf_ND;
/* MemviewSliceIsContig.proto */
static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
/* OverlappingSlices.proto */
static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
__Pyx_memviewslice *slice2,
int ndim, size_t itemsize);
/* Capsule.proto */
static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
/* GCCDiagnostics.proto */
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif
/* IsLittleEndian.proto */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
/* BufferFormatCheck.proto */
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
__Pyx_BufFmt_StackElem* stack,
__Pyx_TypeInfo* type);
/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
/* MemviewSliceValidateAndInit.proto */
static int __Pyx_ValidateAndInit_memviewslice(
int *axes_specs,
int c_or_f_flag,
int buf_flags,
int ndim,
__Pyx_TypeInfo *dtype,
__Pyx_BufFmt_StackElem stack[],
__Pyx_memviewslice *memviewslice,
PyObject *original_obj);
/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(PyObject *, int writable_flag);
/* MemviewDtypeToObject.proto */
static CYTHON_INLINE PyObject *__pyx_memview_get_nn_PetscInt(const char *itemp);
static CYTHON_INLINE int __pyx_memview_set_nn_PetscInt(const char *itemp, PyObject *obj);
static PyObject* __pyx_convert__to_py_PetscEventPerfInfo(PetscEventPerfInfo s);
struct __pyx_t_8petsc4py_5PETSc_DLDataType;
static PyObject* __pyx_convert__to_py_struct____pyx_t_8petsc4py_5PETSc_DLDataType(struct __pyx_t_8petsc4py_5PETSc_DLDataType s);
static PyObject* __pyx_convert__to_py_MatInfo(MatInfo s);
/* MemviewSliceCopyTemplate.proto */
static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
const char *mode, int ndim,
size_t sizeof_dtype, int contig_flag,
int dtype_is_object);
/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_InsertMode(InsertMode value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ScatterMode(ScatterMode value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_NormType(NormType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscViewerFormat(PetscViewerFormat value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscFileMode(PetscFileMode value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscDeviceType(PetscDeviceType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscStreamType(PetscStreamType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscDeviceContextJoinMode(PetscDeviceContextJoinMode value);
/* CIntFromPy.proto */
static CYTHON_INLINE PetscInt __Pyx_PyInt_As_PetscInt(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ISGlobalToLocalMappingMode(ISGlobalToLocalMappingMode value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_VecOption(VecOption value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatOption(MatOption value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatAssemblyType(MatAssemblyType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatInfoType(MatInfoType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatStructure(MatStructure value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatDuplicateOption(MatDuplicateOption value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatFactorShiftType(MatFactorShiftType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatSORType(MatSORType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCSide(PCSide value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCASMType(PCASMType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCGASMType(PCGASMType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCMGType(PCMGType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCMGCycleType(PCMGCycleType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCCompositeType(PCCompositeType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCFieldSplitSchurPreType(PCFieldSplitSchurPreType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCFieldSplitSchurFactType(PCFieldSplitSchurFactType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCPatchConstructType(PCPatchConstructType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCHPDDMCoarseCorrectionType(PCHPDDMCoarseCorrectionType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCDeflationSpaceType(PCDeflationSpaceType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCFailedReason(PCFailedReason value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_KSPNormType(KSPNormType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_KSPConvergedReason(KSPConvergedReason value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SNESNormSchedule(SNESNormSchedule value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SNESConvergedReason(SNESConvergedReason value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSProblemType(TSProblemType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSEquationType(TSEquationType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSExactFinalTimeOption(TSExactFinalTimeOption value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSConvergedReason(TSConvergedReason value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TaoConvergedReason(TaoConvergedReason value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMBoundaryType(DMBoundaryType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMPolytopeType(DMPolytopeType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMDAStencilType(DMDAStencilType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMDAInterpolationType(DMDAInterpolationType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMDAElementType(DMDAElementType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMPlexReorderDefaultFlag(DMPlexReorderDefaultFlag value);
/* CIntFromPy.proto */
static CYTHON_INLINE PetscBool __Pyx_PyInt_As_PetscBool(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMStagStencilType(DMStagStencilType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMStagStencilLocation(DMStagStencilLocation value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmType(DMSwarmType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmMigrateType(DMSwarmMigrateType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmCollectType(DMSwarmCollectType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmPICLayoutType(DMSwarmPICLayoutType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscInt(PetscInt value);
/* CIntFromPy.proto */
static CYTHON_INLINE InsertMode __Pyx_PyInt_As_InsertMode(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE ScatterMode __Pyx_PyInt_As_ScatterMode(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PetscFileMode __Pyx_PyInt_As_PetscFileMode(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PetscDeviceType __Pyx_PyInt_As_PetscDeviceType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PetscStreamType __Pyx_PyInt_As_PetscStreamType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PetscDeviceContextJoinMode __Pyx_PyInt_As_PetscDeviceContextJoinMode(PyObject *);
/* TypeInfoToFormat.proto */
struct __pyx_typeinfo_string {
char string[3];
};
static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
/* CIntFromPy.proto */
static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscMemType(PetscMemType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value);
/* CIntFromPy.proto */
static CYTHON_INLINE MatStructure __Pyx_PyInt_As_MatStructure(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE MatAssemblyType __Pyx_PyInt_As_MatAssemblyType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE MatInfoType __Pyx_PyInt_As_MatInfoType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE MatFactorShiftType __Pyx_PyInt_As_MatFactorShiftType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE KSPConvergedReason __Pyx_PyInt_As_KSPConvergedReason(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE SNESConvergedReason __Pyx_PyInt_As_SNESConvergedReason(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE TaoConvergedReason __Pyx_PyInt_As_TaoConvergedReason(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE DMBoundaryType __Pyx_PyInt_As_DMBoundaryType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE DMDAStencilType __Pyx_PyInt_As_DMDAStencilType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE DMDAInterpolationType __Pyx_PyInt_As_DMDAInterpolationType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE DMDAElementType __Pyx_PyInt_As_DMDAElementType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE DMStagStencilType __Pyx_PyInt_As_DMStagStencilType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE DMStagStencilLocation __Pyx_PyInt_As_DMStagStencilLocation(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PetscClassId __Pyx_PyInt_As_PetscClassId(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscLogStage(PetscLogStage value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscClassId(PetscClassId value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscLogEvent(PetscLogEvent value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MPI_Fint(MPI_Fint value);
/* CIntFromPy.proto */
static CYTHON_INLINE PetscViewerFormat __Pyx_PyInt_As_PetscViewerFormat(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value);
/* CIntFromPy.proto */
static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE ISGlobalToLocalMappingMode __Pyx_PyInt_As_ISGlobalToLocalMappingMode(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value);
/* CIntFromPy.proto */
static CYTHON_INLINE enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType __Pyx_PyInt_As_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE VecOption __Pyx_PyInt_As_VecOption(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscOffloadMask(PetscOffloadMask value);
/* CIntFromPy.proto */
static CYTHON_INLINE NormType __Pyx_PyInt_As_NormType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE MatOption __Pyx_PyInt_As_MatOption(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PCFailedReason __Pyx_PyInt_As_PCFailedReason(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PCASMType __Pyx_PyInt_As_PCASMType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PCGASMType __Pyx_PyInt_As_PCGASMType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PCCompositeType __Pyx_PyInt_As_PCCompositeType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PCFieldSplitSchurFactType __Pyx_PyInt_As_PCFieldSplitSchurFactType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PCFieldSplitSchurPreType __Pyx_PyInt_As_PCFieldSplitSchurPreType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PCMGType __Pyx_PyInt_As_PCMGType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PCMGCycleType __Pyx_PyInt_As_PCMGCycleType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PCPatchConstructType __Pyx_PyInt_As_PCPatchConstructType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PCHPDDMCoarseCorrectionType __Pyx_PyInt_As_PCHPDDMCoarseCorrectionType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PCDeflationSpaceType __Pyx_PyInt_As_PCDeflationSpaceType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE PCSide __Pyx_PyInt_As_PCSide(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE KSPNormType __Pyx_PyInt_As_KSPNormType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE SNESNormSchedule __Pyx_PyInt_As_SNESNormSchedule(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE TSProblemType __Pyx_PyInt_As_TSProblemType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE TSEquationType __Pyx_PyInt_As_TSEquationType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE TSExactFinalTimeOption __Pyx_PyInt_As_TSExactFinalTimeOption(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE TSConvergedReason __Pyx_PyInt_As_TSConvergedReason(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscBool(PetscBool value);
/* CIntFromPy.proto */
static CYTHON_INLINE DMPolytopeType __Pyx_PyInt_As_DMPolytopeType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE DMPlexReorderDefaultFlag __Pyx_PyInt_As_DMPlexReorderDefaultFlag(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE DMSwarmType __Pyx_PyInt_As_DMSwarmType(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE DMSwarmPICLayoutType __Pyx_PyInt_As_DMSwarmPICLayoutType(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatProductType(MatProductType value);
/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
/* FunctionExport.proto */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_acquire(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto*/
static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_release(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto*/
static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_acquirebuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto*/
static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_releasebuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_10_IS_buffer_enter(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_10_IS_buffer_exit(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto*/
static Py_ssize_t __pyx_f_8petsc4py_5PETSc_10_IS_buffer_getbuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, void **__pyx_v_p); /* proto*/
static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_acquire(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto*/
static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_release(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto*/
static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_acquirebuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto*/
static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_releasebuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_enter(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_exit(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto*/
static Py_ssize_t __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_getbuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, void **__pyx_v_p); /* proto*/
static int __pyx_f_8petsc4py_5PETSc_15_DMDA_Vec_array_acquire(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto*/
static int __pyx_f_8petsc4py_5PETSc_15_DMDA_Vec_array_release(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_get_attr(struct PyPetscObjectObject *__pyx_v_self, char *__pyx_v_name); /* proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_set_attr(struct PyPetscObjectObject *__pyx_v_self, char *__pyx_v_name, PyObject *__pyx_v_attr); /* proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_get_dict(struct PyPetscObjectObject *__pyx_v_self); /* proto*/
static int __pyx_f_8petsc4py_5PETSc_6_PyObj_setcontext(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self, void *__pyx_v_ctx, struct PyPetscObjectObject *__pyx_v_base); /* proto*/
static int __pyx_f_8petsc4py_5PETSc_6_PyObj_getcontext(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self, void **__pyx_v_ctx); /* proto*/
static int __pyx_f_8petsc4py_5PETSc_6_PyObj_setname(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self, char *__pyx_v_name); /* proto*/
static char *__pyx_f_8petsc4py_5PETSc_6_PyObj_getname(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self); /* proto*/
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_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*/
/* Module declarations from 'cython.view' */
static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
/* Module declarations from 'cython' */
/* Module declarations from 'numpy' */
/* Module declarations from 'petsc4py.PETSc' */
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Comm = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Object = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Viewer = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Random = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Device = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DeviceContext = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_IS = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_LGMap = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_SF = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Vec = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Space = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DualSpace = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_FE = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Quad = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Scatter = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Section = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Mat = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_MatPartitioning = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_NullSpace = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_PC = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_KSP = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_SNES = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TS = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TAO = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_AO = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DM = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DS = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Partitioner = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMLabel = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_dtype = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_ndarray = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__IS_buffer = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__Vec_buffer = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__Mat_Stencil = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__DMComposite_access = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Options = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Sys = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Log = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_LogStage = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_LogClass = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_LogEvent = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5 = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMDA = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMPlex = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMStag = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMComposite = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMShell = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMSwarm = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMInterpolation = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__PyObj = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__PyMat = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__PyPC = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__PyKSP = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__PySNES = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__PyTS = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__PyTao = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator = 0;
static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator = 0;
static PyTypeObject *__pyx_array_type = 0;
static PyTypeObject *__pyx_MemviewEnum_type = 0;
static PyTypeObject *__pyx_memoryview_type = 0;
static PyTypeObject *__pyx_memoryviewslice_type = 0;
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_stage_registry = 0;
static PyObject *__pyx_v_8petsc4py_5PETSc_class_registry = 0;
static PyObject *__pyx_v_8petsc4py_5PETSc_event_registry = 0;
static struct PyPetscCommObject *__pyx_v_8petsc4py_5PETSc___COMM_NULL__ = 0;
static struct PyPetscCommObject *__pyx_v_8petsc4py_5PETSc___COMM_SELF__ = 0;
static struct PyPetscCommObject *__pyx_v_8petsc4py_5PETSc___COMM_WORLD__ = 0;
static MPI_Comm __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT;
static PyObject *__pyx_v_8petsc4py_5PETSc_type_registry = 0;
static char *__pyx_v_8petsc4py_5PETSc_FUNCT;
static char *__pyx_v_8petsc4py_5PETSc_fstack[0x400];
static int __pyx_v_8petsc4py_5PETSc_istack;
static PyObject *__pyx_v_8petsc4py_5PETSc_module_cache = 0;
static PyObject *__pyx_v_8petsc4py_5PETSc_dMatOps = 0;
static PetscInt __pyx_v_8petsc4py_5PETSc_matmatid;
static PyObject *__pyx_v_8petsc4py_5PETSc_tracebacklist = 0;
static int __pyx_v_8petsc4py_5PETSc_PyPetsc_Argc;
static char **__pyx_v_8petsc4py_5PETSc_PyPetsc_Argv;
static PetscErrorCode (*__pyx_v_8petsc4py_5PETSc_prevfprintf)(FILE *, char const *, va_list);
static int __pyx_v_8petsc4py_5PETSc_registercalled;
static char const *__pyx_v_8petsc4py_5PETSc_citation;
static PyObject *generic = 0;
static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
static int __pyx_memoryview_thread_locks_used;
static PyThread_type_lock __pyx_memoryview_thread_locks[8];
static MPI_Comm __pyx_f_8petsc4py_5PETSc_GetComm(PyObject *, MPI_Comm); /*proto*/
static int __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(int, PyTypeObject *); /*proto*/
static PyTypeObject *__pyx_f_8petsc4py_5PETSc_PyPetscType_Lookup(int); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_CHKERR(PetscErrorCode); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_bytes2str(char const *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_str2bytes(PyObject *, char const **); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_S_(char const *); /*proto*/
static PetscErrorCode __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_i(PetscInt); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_r(PetscInt); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_s(PetscInt); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_c(PetscInt); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_p(PetscInt); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_i(PetscInt, PetscInt const *); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_r(PetscInt, PetscReal const *); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_s(PetscInt, PetscScalar const *); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray(PyObject *, int); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_i(PyObject *, PetscInt *, PetscInt **); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_r(PyObject *, PetscInt *, PetscReal **); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_b(PyObject *, PetscInt *, PetscBool **); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_s(PyObject *, PetscInt *, PetscScalar **); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray(PyObject *, int); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_i(PyObject *, PetscInt *, PetscInt **); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_r(PyObject *, PetscInt *, PetscReal **); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_s(PyObject *, PetscInt *, PetscScalar **); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_p(PyObject *, PetscInt *, void **); /*proto*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_ofarray_s(PyObject *, PetscInt *, PetscScalar **); /*proto*/
static void __pyx_f_8petsc4py_5PETSc_pycapsule_deleter(PyObject *); /*proto*/
static void __pyx_f_8petsc4py_5PETSc_manager_deleter(struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *); /*proto*/
static CYTHON_INLINE InsertMode __pyx_f_8petsc4py_5PETSc_insertmode(PyObject *); /*proto*/
static CYTHON_INLINE ScatterMode __pyx_f_8petsc4py_5PETSc_scattermode(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getprefix(PyObject *, struct __pyx_opt_args_8petsc4py_5PETSc_getprefix *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_opt2str(char const *, char const *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Bool(PetscOptions, char const *, char const *, PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Int(PetscOptions, char const *, char const *, PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Real(PetscOptions, char const *, char const *, PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Scalar(PetscOptions, char const *, char const *, PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_String(PetscOptions, char const *, char const *, PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getpair(PyObject *, PyObject *, char const **, char const **); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getopt(PetscOptions, enum __pyx_t_8petsc4py_5PETSc_PetscOptType, PyObject *, PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_tokenize(PyObject *); /*proto*/
static int __pyx_f_8petsc4py_5PETSc_iskey(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_gettok(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getkey(PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_parseopt(PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE MPI_Comm __pyx_f_8petsc4py_5PETSc_mpi4py_Comm_Get(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_mpi4py_Comm_New(MPI_Comm); /*proto*/
static CYTHON_INLINE MPI_Datatype __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(PyObject *); /*proto*/
static CYTHON_INLINE MPI_Op __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(PyObject *); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscCommDEALLOC(MPI_Comm *); /*proto*/
static CYTHON_INLINE MPI_Comm __pyx_f_8petsc4py_5PETSc_def_Comm(PyObject *, MPI_Comm); /*proto*/
static CYTHON_INLINE struct PyPetscCommObject *__pyx_f_8petsc4py_5PETSc_new_Comm(MPI_Comm); /*proto*/
static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_comm_size(MPI_Comm); /*proto*/
static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_comm_rank(MPI_Comm); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Sys_Sizes(PyObject *, PyObject *, PetscInt *, PetscInt *, PetscInt *); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Sys_Layout(MPI_Comm, PetscInt, PetscInt *, PetscInt *); /*proto*/
static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_event_args2objs(PyObject *, PetscObject *); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscINCREF(PetscObject *); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscCLEAR(PetscObject *); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscDEALLOC(PetscObject *); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscINCSTATE(PetscObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_Py_DecRef(PyObject *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscDelPyDict(void *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PetscGetPyDict(PetscObject, int); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PetscGetPyObj(PetscObject, char *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PetscSetPyObj(PetscObject, char *, PyObject *); /*proto*/
static CYTHON_INLINE Py_intptr_t __pyx_f_8petsc4py_5PETSc_Object_toFortran(PetscObject); /*proto*/
static CYTHON_INLINE PyTypeObject *__pyx_f_8petsc4py_5PETSc_subtype_DM(DM); /*proto*/
static CYTHON_INLINE PyTypeObject *__pyx_f_8petsc4py_5PETSc_subtype_Object(PetscObject); /*proto*/
static CYTHON_INLINE PetscFileMode __pyx_f_8petsc4py_5PETSc_filemode(PyObject *); /*proto*/
static CYTHON_INLINE PetscDeviceType __pyx_f_8petsc4py_5PETSc_asDeviceType(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toDeviceType(PetscDeviceType); /*proto*/
static CYTHON_INLINE PetscStreamType __pyx_f_8petsc4py_5PETSc_asStreamType(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStreamType(PetscStreamType); /*proto*/
static CYTHON_INLINE PetscDeviceContextJoinMode __pyx_f_8petsc4py_5PETSc_asJoinMode(PyObject *); /*proto*/
static CYTHON_INLINE struct PyPetscISObject *__pyx_f_8petsc4py_5PETSc_ref_IS(IS); /*proto*/
static CYTHON_INLINE struct PyPetscLGMapObject *__pyx_f_8petsc4py_5PETSc_ref_LGMap(ISLocalToGlobalMapping); /*proto*/
static CYTHON_INLINE struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_ref_Vec(Vec); /*proto*/
static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_pos(struct PyPetscVecObject *); /*proto*/
static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_neg(struct PyPetscVecObject *); /*proto*/
static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_abs(struct PyPetscVecObject *); /*proto*/
static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_iadd(struct PyPetscVecObject *, PyObject *); /*proto*/
static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_isub(struct PyPetscVecObject *, PyObject *); /*proto*/
static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_imul(struct PyPetscVecObject *, PyObject *); /*proto*/
static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_idiv(struct PyPetscVecObject *, PyObject *); /*proto*/
static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_add(struct PyPetscVecObject *, PyObject *); /*proto*/
static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_sub(struct PyPetscVecObject *, PyObject *); /*proto*/
static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_mul(struct PyPetscVecObject *, PyObject *); /*proto*/
static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_div(struct PyPetscVecObject *, PyObject *); /*proto*/
static 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 PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_mul(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_div(struct PyPetscMatObject *, PyObject *); /*proto*/
static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_radd(struct PyPetscMatObject *, PyObject *); /*proto*/
static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_rsub(struct PyPetscMatObject *, PyObject *); /*proto*/
static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_rmul(struct PyPetscMatObject *, PyObject *); /*proto*/
static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_rdiv(struct PyPetscMatObject *, PyObject *); /*proto*/
static CYTHON_INLINE MatStructure __pyx_f_8petsc4py_5PETSc_matstructure(PyObject *); /*proto*/
static CYTHON_INLINE MatAssemblyType __pyx_f_8petsc4py_5PETSc_assemblytype(PyObject *); /*proto*/
static CYTHON_INLINE MatInfoType __pyx_f_8petsc4py_5PETSc_infotype(PyObject *); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_Sizes(PyObject *, PyObject *, PetscInt *, PetscInt *, PetscInt *, PetscInt *, PetscInt *, PetscInt *); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_Create(MatType, PyObject *, PyObject *, PyObject *, Mat *); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_NNZ(Mat, PyObject *); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_CSR(Mat, PyObject *); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ(Mat, PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_Mat_AllocDense(Mat, PyObject *); /*proto*/
static CYTHON_INLINE __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(int, int); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_matsetvalues(Mat, PyObject *, PyObject *, PyObject *, PyObject *, int, int); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_matsetvalues_rcv(Mat, PyObject *, PyObject *, PyObject *, PyObject *, int, int); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(Mat, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int, int); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_matsetvalues_csr(Mat, PyObject *, PyObject *, PyObject *, PyObject *, int, int); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_matgetvalues(Mat, PyObject *, PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE MatFactorShiftType __pyx_f_8petsc4py_5PETSc_matfactorshifttype(PyObject *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_matfactorinfo(PetscBool, PetscBool, PyObject *, MatFactorInfo *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_mat_getitem(struct PyPetscMatObject *, PyObject *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_mat_setitem(struct PyPetscMatObject *, PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_matsetvaluestencil(Mat, struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *, struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *, PyObject *, InsertMode, int); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_mat_get_dlpack_ctx(struct PyPetscMatObject *); /*proto*/
static CYTHON_INLINE struct PyPetscPCObject *__pyx_f_8petsc4py_5PETSc_ref_PC(PC); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperator(PC, PetscInt, Vec, Mat, IS, PetscInt, PetscInt const *, PetscInt const *, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunction(PC, PetscInt, Vec, Vec, IS, PetscInt, PetscInt const *, PetscInt const *, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperatorInteriorFacets(PC, PetscInt, Vec, Mat, IS, PetscInt, PetscInt const *, PetscInt const *, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunctionInteriorFacets(PC, PetscInt, Vec, Vec, IS, PetscInt, PetscInt const *, PetscInt const *, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_UserConstructOperator(PC, PetscInt *, IS **, IS *, void *); /*proto*/
static CYTHON_INLINE struct PyPetscKSPObject *__pyx_f_8petsc4py_5PETSc_ref_KSP(KSP); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_Converged(KSP, PetscInt, PetscReal, KSPConvergedReason *, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_Monitor(KSP, PetscInt, PetscReal, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_ComputeRHS(KSP, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_ComputeOps(KSP, Mat, Mat, void *); /*proto*/
static CYTHON_INLINE struct PyPetscSNESObject *__pyx_f_8petsc4py_5PETSc_ref_SNES(SNES); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_InitialGuess(SNES, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_PreCheck(SNESLineSearch, Vec, Vec, PetscBool *, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Function(SNES, Vec, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Update(SNES, PetscInt); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Jacobian(SNES, Vec, Mat, Mat, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Objective(SNES, Vec, PetscReal *, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_NGS(SNES, Vec, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Converged(SNES, PetscInt, PetscReal, PetscReal, PetscReal, SNESConvergedReason *, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_Monitor(SNES, PetscInt, PetscReal, void *); /*proto*/
static CYTHON_INLINE struct PyPetscTSObject *__pyx_f_8petsc4py_5PETSc_ref_TS(TS); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_RHSFunction(TS, PetscReal, Vec, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_RHSJacobian(TS, PetscReal, Vec, Mat, Mat, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_IFunction(TS, PetscReal, Vec, Vec, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_IJacobian(TS, PetscReal, Vec, Vec, PetscReal, Mat, Mat, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_IJacobianP(TS, PetscReal, Vec, Vec, PetscReal, Mat, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_I2Function(TS, PetscReal, Vec, Vec, Vec, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_I2Jacobian(TS, PetscReal, Vec, Vec, Vec, PetscReal, PetscReal, Mat, Mat, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_Monitor(TS, PetscInt, PetscReal, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_EventHandler(TS, PetscReal, Vec, PetscScalar *, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_PostEvent(TS, PetscInt, PetscInt *, PetscReal, Vec, PetscBool, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_PreStep(TS); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_PostStep(TS); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_RHSJacobianP(TS, PetscReal, Vec, Mat, void *); /*proto*/
static CYTHON_INLINE struct PyPetscTAOObject *__pyx_f_8petsc4py_5PETSc_ref_TAO(Tao); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Objective(Tao, Vec, PetscReal *, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Residual(Tao, Vec, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Gradient(Tao, Vec, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_ObjGrad(Tao, Vec, PetscReal *, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_BRGNRegObjGrad(Tao, Vec, PetscReal *, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Constraints(Tao, Vec, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_VarBounds(Tao, Vec, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Hessian(Tao, Vec, Mat, Mat, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_BRGNRegHessian(Tao, Vec, Mat, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Jacobian(Tao, Vec, Mat, Mat, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_JacobianResidual(Tao, Vec, Mat, Mat, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_JacobianState(Tao, Vec, Mat, Mat, Mat, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_JacobianDesign(Tao, Vec, Mat, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_EqualityConstraints(Tao, Vec, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_JacobianEquality(Tao, Vec, Mat, Mat, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Update(Tao, PetscInt, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Converged(Tao, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Monitor(Tao, void *); /*proto*/
static CYTHON_INLINE 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 *); /*proto*/
static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_setref(void *, void *); /*proto*/
static int __pyx_f_8petsc4py_5PETSc_PyPetscError_Set(PetscErrorCode); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscComm_New(MPI_Comm); /*proto*/
static MPI_Comm __pyx_f_8petsc4py_5PETSc_PyPetscComm_Get(PyObject *); /*proto*/
static MPI_Comm *__pyx_f_8petsc4py_5PETSc_PyPetscComm_GetPtr(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscObject_New(PetscObject); /*proto*/
static PetscObject __pyx_f_8petsc4py_5PETSc_PyPetscObject_Get(PyObject *); /*proto*/
static PetscObject *__pyx_f_8petsc4py_5PETSc_PyPetscObject_GetPtr(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscViewer_New(PetscViewer); /*proto*/
static PetscViewer __pyx_f_8petsc4py_5PETSc_PyPetscViewer_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscRandom_New(PetscRandom); /*proto*/
static PetscRandom __pyx_f_8petsc4py_5PETSc_PyPetscRandom_Get(PyObject *); /*proto*/
static struct PyPetscDeviceObject *__pyx_f_8petsc4py_5PETSc_PyPetscDevice_New(PetscDevice); /*proto*/
static PetscDevice __pyx_f_8petsc4py_5PETSc_PyPetscDevice_Get(PyObject *); /*proto*/
static struct PyPetscDeviceContextObject *__pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_New(PetscDeviceContext); /*proto*/
static PetscDeviceContext __pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscIS_New(IS); /*proto*/
static IS __pyx_f_8petsc4py_5PETSc_PyPetscIS_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscLGMap_New(ISLocalToGlobalMapping); /*proto*/
static ISLocalToGlobalMapping __pyx_f_8petsc4py_5PETSc_PyPetscLGMap_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSF_New(PetscSF); /*proto*/
static PetscSF __pyx_f_8petsc4py_5PETSc_PyPetscSF_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscVec_New(Vec); /*proto*/
static Vec __pyx_f_8petsc4py_5PETSc_PyPetscVec_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscScatter_New(VecScatter); /*proto*/
static VecScatter __pyx_f_8petsc4py_5PETSc_PyPetscScatter_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSection_New(PetscSection); /*proto*/
static PetscSection __pyx_f_8petsc4py_5PETSc_PyPetscSection_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscMat_New(Mat); /*proto*/
static Mat __pyx_f_8petsc4py_5PETSc_PyPetscMat_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscMatPartitioning_New(MatPartitioning); /*proto*/
static MatPartitioning __pyx_f_8petsc4py_5PETSc_PyPetscMatPartitioning_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscPC_New(PC); /*proto*/
static PC __pyx_f_8petsc4py_5PETSc_PyPetscPC_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscKSP_New(KSP); /*proto*/
static KSP __pyx_f_8petsc4py_5PETSc_PyPetscKSP_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSNES_New(SNES); /*proto*/
static SNES __pyx_f_8petsc4py_5PETSc_PyPetscSNES_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscTS_New(TS); /*proto*/
static TS __pyx_f_8petsc4py_5PETSc_PyPetscTS_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscTAO_New(Tao); /*proto*/
static Tao __pyx_f_8petsc4py_5PETSc_PyPetscTAO_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscAO_New(AO); /*proto*/
static AO __pyx_f_8petsc4py_5PETSc_PyPetscAO_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDM_New(DM); /*proto*/
static DM __pyx_f_8petsc4py_5PETSc_PyPetscDM_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDS_New(PetscDS); /*proto*/
static PetscDS __pyx_f_8petsc4py_5PETSc_PyPetscDS_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_New(PetscPartitioner); /*proto*/
static PetscPartitioner __pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscFE_New(PetscFE); /*proto*/
static PetscFE __pyx_f_8petsc4py_5PETSc_PyPetscFE_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscQuad_New(PetscQuadrature); /*proto*/
static PetscQuadrature __pyx_f_8petsc4py_5PETSc_PyPetscQuad_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_New(DMLabel); /*proto*/
static DMLabel __pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSpace_New(PetscSpace); /*proto*/
static PetscSpace __pyx_f_8petsc4py_5PETSc_PyPetscSpace_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDualSpace_New(PetscDualSpace); /*proto*/
static PetscDualSpace __pyx_f_8petsc4py_5PETSc_PyPetscDualSpace_Get(PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_FunctionBegin(char *); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_FunctionEnd(void); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscSETERR(PetscErrorCode, char *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(char *); /*proto*/
static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_getRef(void *); /*proto*/
static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_addRef(void *); /*proto*/
static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_delRef(void *); /*proto*/
static CYTHON_INLINE PetscObject __pyx_f_8petsc4py_5PETSc_newRef(void *); /*proto*/
static CYTHON_INLINE char const *__pyx_f_8petsc4py_5PETSc_getPrefix(void *); /*proto*/
static CYTHON_INLINE struct PyPetscViewerObject *__pyx_f_8petsc4py_5PETSc_Viewer_(PetscViewer); /*proto*/
static CYTHON_INLINE struct PyPetscISObject *__pyx_f_8petsc4py_5PETSc_IS_(IS); /*proto*/
static CYTHON_INLINE struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_Vec_(Vec); /*proto*/
static CYTHON_INLINE struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_Mat_(Mat); /*proto*/
static CYTHON_INLINE struct PyPetscPCObject *__pyx_f_8petsc4py_5PETSc_PC_(PC); /*proto*/
static CYTHON_INLINE struct PyPetscKSPObject *__pyx_f_8petsc4py_5PETSc_KSP_(KSP); /*proto*/
static CYTHON_INLINE struct PyPetscSNESObject *__pyx_f_8petsc4py_5PETSc_SNES_(SNES); /*proto*/
static CYTHON_INLINE struct PyPetscTSObject *__pyx_f_8petsc4py_5PETSc_TS_(TS); /*proto*/
static CYTHON_INLINE struct PyPetscTAOObject *__pyx_f_8petsc4py_5PETSc_TAO_(Tao); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_parse_url(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_load_module(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_createcontext(char *); /*proto*/
static int __pyx_f_8petsc4py_5PETSc_viewcontext(struct __pyx_obj_8petsc4py_5PETSc__PyObj *, PetscViewer); /*proto*/
static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyMat *__pyx_f_8petsc4py_5PETSc_PyMat(Mat); /*proto*/
__PYX_EXTERN_C PetscErrorCode MatPythonGetContext(Mat, void **); /*proto*/
__PYX_EXTERN_C PetscErrorCode MatPythonSetContext(Mat, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatPythonSetType_PYTHON(Mat, char *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatPythonGetType_PYTHON(Mat, char const **); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatCreate_Python(Mat); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatDestroy_Python_inner(Mat); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatDestroy_Python(Mat); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSetFromOptions_Python(Mat, PetscOptionItems *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatView_Python(Mat, PetscViewer); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatDuplicate_Python(Mat, MatDuplicateOption, Mat *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatCopy_Python(Mat, Mat, MatStructure); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatGetDiagonalBlock_Python(Mat, Mat *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatCreateSubMatrix_Python(Mat, IS, IS, MatReuse, Mat *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSetOption_Python(Mat, MatOption, PetscBool); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSetUp_Python(Mat); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatAssemblyBegin_Python(Mat, MatAssemblyType); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatAssemblyEnd_Python(Mat, MatAssemblyType); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatZeroEntries_Python(Mat); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatZeroRowsColumns_Python(Mat, PetscInt, PetscInt const *, PetscScalar, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatScale_Python(Mat, PetscScalar); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatShift_Python(Mat, PetscScalar); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatCreateVecs_Python(Mat, Vec *, Vec *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMult_Python(Mat, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultTranspose_Python(Mat, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultHermitian_Python(Mat, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultAdd_Python(Mat, Vec, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultTransposeAdd_Python(Mat, Vec, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultHermitianAdd_Python(Mat, Vec, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMultDiagonalBlock_Python(Mat, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSolve_Python(Mat, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSolveTranspose_Python(Mat, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSolveAdd_Python(Mat, Vec, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSolveTransposeAdd_Python(Mat, Vec, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSOR_Python(Mat, Vec, PetscReal, MatSORType, PetscReal, PetscInt, PetscInt, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatGetDiagonal_Python(Mat, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSetDiagonal_Python(Mat, Vec, InsertMode); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatDiagonalScale_Python(Mat, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatMissingDiagonal_Python(Mat, PetscBool *, PetscInt *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatNorm_Python(Mat, NormType, PetscReal *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatRealPart_Python(Mat); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatImagPart_Python(Mat); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatConjugate_Python(Mat); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatHasOperation_Python(Mat, MatOperation, PetscBool *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatProductNumeric_Python(Mat); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatProductSymbolic_Python(Mat); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatProductSetFromOptions_Python(Mat); /*proto*/
static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyPC *__pyx_f_8petsc4py_5PETSc_PyPC(PC); /*proto*/
__PYX_EXTERN_C PetscErrorCode PCPythonGetContext(PC, void **); /*proto*/
__PYX_EXTERN_C PetscErrorCode PCPythonSetContext(PC, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPythonSetType_PYTHON(PC, char *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPythonGetType_PYTHON(PC, char const **); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCCreate_Python(PC); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCDestroy_Python_inner(PC); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCDestroy_Python(PC); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCSetUp_Python(PC); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCReset_Python_inner(PC); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCReset_Python(PC); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCSetFromOptions_Python(PC, PetscOptionItems *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCView_Python(PC, PetscViewer); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPreSolve_Python(PC, KSP, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPostSolve_Python(PC, KSP, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCApply_Python(PC, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCApplyTranspose_Python(PC, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCApplySymmetricLeft_Python(PC, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCApplySymmetricRight_Python(PC, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCMatApply_Python(PC, Mat, Mat); /*proto*/
static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyKSP *__pyx_f_8petsc4py_5PETSc_PyKSP(KSP); /*proto*/
__PYX_EXTERN_C PetscErrorCode KSPPythonGetContext(KSP, void **); /*proto*/
__PYX_EXTERN_C PetscErrorCode KSPPythonSetContext(KSP, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPPythonSetType_PYTHON(KSP, char *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPPythonGetType_PYTHON(KSP, char const **); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPCreate_Python(KSP); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPDestroy_Python_inner(KSP); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPDestroy_Python(KSP); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPSetUp_Python(KSP); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPReset_Python_inner(KSP); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPReset_Python(KSP); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPSetFromOptions_Python(KSP, PetscOptionItems *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPView_Python(KSP, PetscViewer); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPBuildSolution_Python(KSP, Vec, Vec *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPBuildResidual_Python(KSP, Vec, Vec, Vec *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPSolve_Python(KSP); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPSolve_Python_default(KSP, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPPreStep_Python(KSP); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPPostStep_Python(KSP); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPStep_Python(KSP, Vec, Vec); /*proto*/
static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PySNES *__pyx_f_8petsc4py_5PETSc_PySNES(SNES); /*proto*/
__PYX_EXTERN_C PetscErrorCode SNESPythonGetContext(SNES, void **); /*proto*/
__PYX_EXTERN_C PetscErrorCode SNESPythonSetContext(SNES, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESPythonSetType_PYTHON(SNES, char *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESPythonGetType_PYTHON(SNES, char const **); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESCreate_Python(SNES); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESDestroy_Python_inner(SNES); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESDestroy_Python(SNES); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESSetUp_Python(SNES); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESReset_Python_inner(SNES); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESReset_Python(SNES); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESSetFromOptions_Python(SNES, PetscOptionItems *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESView_Python(SNES, PetscViewer); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESSolve_Python(SNES); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESSolve_Python_default(SNES); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESPreStep_Python(SNES); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESPostStep_Python(SNES); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESStep_Python(SNES, Vec, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESStep_Python_default(SNES, Vec, Vec, Vec); /*proto*/
static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyTS *__pyx_f_8petsc4py_5PETSc_PyTS(TS); /*proto*/
__PYX_EXTERN_C PetscErrorCode TSPythonGetContext(TS, void **); /*proto*/
__PYX_EXTERN_C PetscErrorCode TSPythonSetContext(TS, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSPythonSetType_PYTHON(TS, char *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSPythonGetType_PYTHON(TS, char const **); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSCreate_Python(TS); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSDestroy_Python_inner(TS); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSDestroy_Python(TS); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSSetUp_Python(TS); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSReset_Python_inner(TS); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSReset_Python(TS); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSSetFromOptions_Python(TS, PetscOptionItems *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSView_Python(TS, PetscViewer); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSStep_Python(TS); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSRollBack_Python(TS); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSInterpolate_Python(TS, PetscReal, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSEvaluateStep_Python(TS, PetscInt, Vec, PetscBool *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESTSFormFunction_Python(SNES, Vec, Vec, TS); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESTSFormJacobian_Python(SNES, Vec, Mat, Mat, TS); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSSolveStep_Python(TS, PetscReal, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSAdaptStep_Python(TS, PetscReal, Vec, PetscReal *, PetscBool *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSStep_Python_default(TS); /*proto*/
static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyTao *__pyx_f_8petsc4py_5PETSc_PyTao(Tao); /*proto*/
__PYX_EXTERN_C PetscErrorCode TaoPythonGetContext(Tao, void **); /*proto*/
__PYX_EXTERN_C PetscErrorCode TaoPythonSetContext(Tao, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoPythonSetType_PYTHON(Tao, char *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoPythonGetType_PYTHON(Tao, char const **); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoCreate_Python(Tao); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoDestroy_Python_inner(Tao); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoDestroy_Python(Tao); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoSetUp_Python(Tao); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoSetFromOptions_Python(Tao, PetscOptionItems *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoView_Python(Tao, PetscViewer); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoSolve_Python(Tao); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoSolve_Python_default(Tao); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoStep_Python(Tao, Vec, Vec, Vec); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoPreStep_Python(Tao); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoPostStep_Python(Tao); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscPythonMonitorSet_Python(PetscObject, char const *); /*proto*/
__PYX_EXTERN_C PetscErrorCode PetscPythonRegisterAll(void); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_traceback(MPI_Comm, int, char const *, char const *, PetscErrorCode, PetscErrorType, char const *, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscPythonErrorHandler(MPI_Comm, int, char const *, char const *, PetscErrorCode, PetscErrorType, char const *, void *); /*proto*/
static int __pyx_f_8petsc4py_5PETSc_getinitargs(PyObject *, int *, char ***); /*proto*/
static void __pyx_f_8petsc4py_5PETSc_delinitargs(int *, char ***); /*proto*/
static void __pyx_f_8petsc4py_5PETSc_finalize(void); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscVFPrintf_PythonStdStream(FILE *, char const *, va_list); /*proto*/
static int __pyx_f_8petsc4py_5PETSc__push_vfprintf(PetscErrorCode (*)(FILE *, char const *, va_list)); /*proto*/
static int __pyx_f_8petsc4py_5PETSc__pop_vfprintf(void); /*proto*/
static int __pyx_f_8petsc4py_5PETSc_initialize(PyObject *, PyObject *); /*proto*/
static int __pyx_f_8petsc4py_5PETSc_register(void); /*proto*/
static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
static void *__pyx_align_pointer(void *, size_t); /*proto*/
static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
static PyObject *_unellipsify(PyObject *, int); /*proto*/
static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn_PetscInt = { "PetscInt", NULL, sizeof(PetscInt), { 0 }, 0, IS_UNSIGNED(PetscInt) ? 'U' : 'I', IS_UNSIGNED(PetscInt), 0 };
#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' */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_SystemError;
static PyObject *__pyx_builtin_Ellipsis;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_NotImplemented;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_compile;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_IndexError;
static const char __pyx_k_[] = " ";
static const char __pyx_k_A[] = "A";
static const char __pyx_k_B[] = "B";
static const char __pyx_k_C[] = "C";
static const char __pyx_k_D[] = "D";
static const char __pyx_k_G[] = "G";
static const char __pyx_k_H[] = "H";
static const char __pyx_k_I[] = "I";
static const char __pyx_k_J[] = "J";
static const char __pyx_k_L[] = "L";
static const char __pyx_k_O[] = "O";
static const char __pyx_k_P[] = "P";
static const char __pyx_k_R[] = "R";
static const char __pyx_k_S[] = "S";
static const char __pyx_k_T[] = "T";
static const char __pyx_k_U[] = "U";
static const char __pyx_k_V[] = "V";
static const char __pyx_k_W[] = "W";
static const char __pyx_k_X[] = "X";
static const char __pyx_k_a[] = "a";
static const char __pyx_k_b[] = "b";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_e[] = "e";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_g[] = "g";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_j[] = "j";
static const char __pyx_k_k[] = "k";
static const char __pyx_k_l[] = "l";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_p[] = "p";
static const char __pyx_k_r[] = "r";
static const char __pyx_k_s[] = "%s";
static const char __pyx_k_t[] = "t";
static const char __pyx_k_u[] = "u";
static const char __pyx_k_v[] = "v";
static const char __pyx_k_w[] = "w";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_y[] = "y";
static const char __pyx_k_AB[] = "AB";
static const char __pyx_k_AO[] = "AO";
static const char __pyx_k_AU[] = "AU";
static const char __pyx_k_BE[] = "BE";
static const char __pyx_k_CG[] = "CG";
static const char __pyx_k_CN[] = "CN";
static const char __pyx_k_CP[] = "CP";
static const char __pyx_k_CR[] = "CR";
static const char __pyx_k_DA[] = "DA";
static const char __pyx_k_DM[] = "DM";
static const char __pyx_k_DS[] = "DS";
static const char __pyx_k_FE[] = "FE";
static const char __pyx_k_IS[] = "IS";
static const char __pyx_k_LU[] = "LU";
static const char __pyx_k_MG[] = "MG";
static const char __pyx_k_ML[] = "ML";
static const char __pyx_k_MS[] = "MS";
static const char __pyx_k_N1[] = "N1";
static const char __pyx_k_N2[] = "N2";
static const char __pyx_k_ND[] = "ND";
static const char __pyx_k_NM[] = "NM";
static const char __pyx_k_NN[] = "NN";
static const char __pyx_k_NO[] = "NO";
static const char __pyx_k_NZ[] = "NZ";
static const char __pyx_k_P1[] = "P1";
static const char __pyx_k_PC[] = "PC";
static const char __pyx_k_PD[] = "PD";
static const char __pyx_k_Q0[] = "Q0";
static const char __pyx_k_Q1[] = "Q1";
static const char __pyx_k_QN[] = "QN";
static const char __pyx_k_QR[] = "QR";
static const char __pyx_k_RK[] = "RK";
static const char __pyx_k_SF[] = "SF";
static const char __pyx_k_TH[] = "TH";
static const char __pyx_k_TS[] = "TS";
static const char __pyx_k_UA[] = "UA";
static const char __pyx_k_UP[] = "UP";
static const char __pyx_k_VU[] = "VU";
static const char __pyx_k__4[] = "-";
static const char __pyx_k__7[] = "";
static const char __pyx_k_au[] = "au";
static const char __pyx_k_bs[] = "bs";
static const char __pyx_k_da[] = "da";
static const char __pyx_k_dm[] = "dm";
static const char __pyx_k_dt[] = "dt";
static const char __pyx_k_gv[] = "gv";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_is[] = "is_";
static const char __pyx_k_lv[] = "lv";
static const char __pyx_k_na[] = "na";
static const char __pyx_k_nc[] = "nc";
static const char __pyx_k_op[] = "op";
static const char __pyx_k_p1[] = "p1";
static const char __pyx_k_pc[] = "pc";
static const char __pyx_k_pd[] = "pd";
static const char __pyx_k_pi[] = "pi";
static const char __pyx_k_pj[] = "pj";
static const char __pyx_k_q0[] = "q0";
static const char __pyx_k_q1[] = "q1";
static const char __pyx_k_rw[] = "rw";
static const char __pyx_k_sf[] = "sf";
static const char __pyx_k_sp[] = "sp";
static const char __pyx_k_sx[] = "sx";
static const char __pyx_k_ua[] = "ua";
static const char __pyx_k_up[] = "up";
static const char __pyx_k_vg[] = "vg";
static const char __pyx_k_vl[] = "vl";
static const char __pyx_k_vm[] = "vm";
static const char __pyx_k_vn[] = "vn";
static const char __pyx_k_xl[] = "xl";
static const char __pyx_k_xu[] = "xu";
static const char __pyx_k_A11[] = "A11";
static const char __pyx_k_ABC[] = "ABC";
static const char __pyx_k_ABt[] = "ABt";
static const char __pyx_k_ADD[] = "ADD";
static const char __pyx_k_AGG[] = "AGG";
static const char __pyx_k_AIJ[] = "AIJ";
static const char __pyx_k_AMD[] = "AMD";
static const char __pyx_k_ASM[] = "ASM";
static const char __pyx_k_AtB[] = "AtB";
static const char __pyx_k_BAS[] = "BAS";
static const char __pyx_k_BDF[] = "BDF";
static const char __pyx_k_BDM[] = "BDM";
static const char __pyx_k_BOX[] = "BOX";
static const char __pyx_k_CGS[] = "CGS";
static const char __pyx_k_DB2[] = "DB2";
static const char __pyx_k_DB4[] = "DB4";
static const char __pyx_k_DB8[] = "DB8";
static const char __pyx_k_DOF[] = "DOF";
static const char __pyx_k_Dup[] = "Dup";
static const char __pyx_k_FAS[] = "FAS";
static const char __pyx_k_FCG[] = "FCG";
static const char __pyx_k_FFT[] = "FFT";
static const char __pyx_k_FRB[] = "FRB";
static const char __pyx_k_GCR[] = "GCR";
static const char __pyx_k_GEO[] = "GEO";
static const char __pyx_k_HIP[] = "HIP";
static const char __pyx_k_HMG[] = "HMG";
static const char __pyx_k_ICC[] = "ICC";
static const char __pyx_k_ILU[] = "ILU";
static const char __pyx_k_INF[] = "INF";
static const char __pyx_k_IPM[] = "IPM";
static const char __pyx_k_KLU[] = "KLU";
static const char __pyx_k_KSP[] = "KSP";
static const char __pyx_k_LCD[] = "LCD";
static const char __pyx_k_LCL[] = "LCL";
static const char __pyx_k_LRC[] = "LRC";
static const char __pyx_k_LSC[] = "LSC";
static const char __pyx_k_Log[] = "Log";
static const char __pyx_k_MAT[] = "MAT";
static const char __pyx_k_MAX[] = "MAX";
static const char __pyx_k_MPI[] = "MPI";
static const char __pyx_k_Mat[] = "Mat";
static const char __pyx_k_N12[] = "N12";
static const char __pyx_k_NCG[] = "NCG";
static const char __pyx_k_NGS[] = "NGS";
static const char __pyx_k_NLS[] = "NLS";
static const char __pyx_k_NTL[] = "NTL";
static const char __pyx_k_NTR[] = "NTR";
static const char __pyx_k_OWD[] = "OWD";
static const char __pyx_k_PIC[] = "PIC";
static const char __pyx_k_QCG[] = "QCG";
static const char __pyx_k_QMD[] = "QMD";
static const char __pyx_k_RCM[] = "RCM";
static const char __pyx_k_RK3[] = "RK3";
static const char __pyx_k_RK4[] = "RK4";
static const char __pyx_k_SEQ[] = "SEQ";
static const char __pyx_k_SOR[] = "SOR";
static const char __pyx_k_SPD[] = "SPD";
static const char __pyx_k_SSP[] = "SSP";
static const char __pyx_k_SUM[] = "SUM";
static const char __pyx_k_SVD[] = "SVD";
static const char __pyx_k_Sys[] = "Sys";
static const char __pyx_k_TAO[] = "TAO";
static const char __pyx_k_TFS[] = "TFS";
static const char __pyx_k_T_2[] = "T{";
static const char __pyx_k_VTK[] = "VTK";
static const char __pyx_k_Vec[] = "Vec";
static const char __pyx_k_WBM[] = "WBM";
static const char __pyx_k_WXY[] = "WXY";
static const char __pyx_k__13[] = "\n";
static const char __pyx_k__14[] = ",";
static const char __pyx_k__20[] = ".";
static const char __pyx_k__57[] = ":";
static const char __pyx_k__78[] = "^";
static const char __pyx_k__79[] = "}";
static const char __pyx_k_a_2[] = "a+";
static const char __pyx_k_adj[] = "adj";
static const char __pyx_k_all[] = "all";
static const char __pyx_k_app[] = "app";
static const char __pyx_k_aux[] = "aux";
static const char __pyx_k_box[] = "box";
static const char __pyx_k_c_d[] = "=%c%d";
static const char __pyx_k_col[] = "col";
static const char __pyx_k_csr[] = "csr";
static const char __pyx_k_d_s[] = "[%*d] %s";
static const char __pyx_k_dim[] = "dim";
static const char __pyx_k_div[] = "div";
static const char __pyx_k_dmf[] = "dmf";
static const char __pyx_k_dms[] = "dms";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_dof[] = "dof";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_eta[] = "eta";
static const char __pyx_k_fix[] = "fix";
static const char __pyx_k_flg[] = "flg";
static const char __pyx_k_get[] = "__get__";
static const char __pyx_k_has[] = "has";
static const char __pyx_k_idx[] = "idx";
static const char __pyx_k_int[] = "int";
static const char __pyx_k_its[] = "its";
static const char __pyx_k_ksp[] = "ksp";
static const char __pyx_k_l2l[] = "l2l";
static const char __pyx_k_lda[] = "lda";
static const char __pyx_k_loc[] = "loc";
static const char __pyx_k_mat[] = "mat";
static const char __pyx_k_max[] = "max";
static const char __pyx_k_min[] = "min";
static const char __pyx_k_mit[] = "mit";
static const char __pyx_k_msg[] = "msg";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_ngs[] = "ngs";
static const char __pyx_k_nnz[] = "nnz";
static const char __pyx_k_nsd[] = "nsd";
static const char __pyx_k_nsp[] = "nsp";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_out[] = "out";
static const char __pyx_k_ozz[] = "ozz";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_pre[] = "pre";
static const char __pyx_k_r_2[] = "r+";
static const char __pyx_k_red[] = "red";
static const char __pyx_k_res[] = "res";
static const char __pyx_k_rhs[] = "rhs";
static const char __pyx_k_row[] = "row";
static const char __pyx_k_s_2[] = "s";
static const char __pyx_k_s_3[] = "(%s)";
static const char __pyx_k_s_s[] = "-%s%s";
static const char __pyx_k_sec[] = "sec";
static const char __pyx_k_sep[] = "sep";
static const char __pyx_k_str[] = "__str__";
static const char __pyx_k_sub[] = "sub";
static const char __pyx_k_sym[] = "sym";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_tab[] = "tab";
static const char __pyx_k_tol[] = "tol";
static const char __pyx_k_typ[] = "typ";
static const char __pyx_k_uis[] = "uis";
static const char __pyx_k_val[] = "val";
static const char __pyx_k_vec[] = "vec";
static const char __pyx_k_vlg[] = "vlg";
static const char __pyx_k_w_2[] = "w+";
static const char __pyx_k_zoz[] = "zoz";
static const char __pyx_k_zzo[] = "zzo";
static const char __pyx_k_ADMM[] = "ADMM";
static const char __pyx_k_ALMM[] = "ALMM";
static const char __pyx_k_BACK[] = "BACK";
static const char __pyx_k_BAIJ[] = "BAIJ";
static const char __pyx_k_BCGS[] = "BCGS";
static const char __pyx_k_BDDC[] = "BDDC";
static const char __pyx_k_BFBT[] = "BFBT";
static const char __pyx_k_BICG[] = "BICG";
static const char __pyx_k_BMRM[] = "BMRM";
static const char __pyx_k_BNCG[] = "BNCG";
static const char __pyx_k_BNLS[] = "BNLS";
static const char __pyx_k_BNTL[] = "BNTL";
static const char __pyx_k_BNTR[] = "BNTR";
static const char __pyx_k_BRGN[] = "BRGN";
static const char __pyx_k_CGLS[] = "CGLS";
static const char __pyx_k_CGNE[] = "CGNE";
static const char __pyx_k_CUDA[] = "CUDA";
static const char __pyx_k_Comm[] = "Comm";
static const char __pyx_k_DB16[] = "DB16";
static const char __pyx_k_DIAG[] = "DIAG";
static const char __pyx_k_DMDA[] = "DMDA";
static const char __pyx_k_DOWN[] = "DOWN";
static const char __pyx_k_DRAW[] = "DRAW";
static const char __pyx_k_DROP[] = "DROP";
static const char __pyx_k_ESSL[] = "ESSL";
static const char __pyx_k_FFTW[] = "FFTW";
static const char __pyx_k_FULL[] = "FULL";
static const char __pyx_k_Free[] = "Free";
static const char __pyx_k_GAMG[] = "GAMG";
static const char __pyx_k_GASM[] = "GASM";
static const char __pyx_k_GLEE[] = "GLEE";
static const char __pyx_k_GLLE[] = "GLLE";
static const char __pyx_k_GLTR[] = "GLTR";
static const char __pyx_k_GPCG[] = "GPCG";
static const char __pyx_k_HAAR[] = "HAAR";
static const char __pyx_k_HALF[] = "HALF";
static const char __pyx_k_HASH[] = "HASH";
static const char __pyx_k_HDF5[] = "HDF5";
static const char __pyx_k_HOST[] = "HOST";
static const char __pyx_k_KAIJ[] = "KAIJ";
static const char __pyx_k_LEFT[] = "LEFT";
static const char __pyx_k_LMVM[] = "LMVM";
static const char __pyx_k_LSQR[] = "LSQR";
static const char __pyx_k_Left[] = "Left";
static const char __pyx_k_MAIJ[] = "MAIJ";
static const char __pyx_k_MASK[] = "MASK";
static const char __pyx_k_MFFD[] = "MFFD";
static const char __pyx_k_MOAB[] = "MOAB";
static const char __pyx_k_MPRK[] = "MPRK";
static const char __pyx_k_Mode[] = "Mode";
static const char __pyx_k_NASH[] = "NASH";
static const char __pyx_k_NASM[] = "NASM";
static const char __pyx_k_NEST[] = "NEST";
static const char __pyx_k_NONE[] = "NONE";
static const char __pyx_k_PFMG[] = "PFMG";
static const char __pyx_k_PLEX[] = "PLEX";
static const char __pyx_k_PtAP[] = "PtAP";
static const char __pyx_k_Quad[] = "Quad";
static const char __pyx_k_RAND[] = "RAND";
static const char __pyx_k_RARt[] = "RARt";
static const char __pyx_k_READ[] = "READ";
static const char __pyx_k_RK2A[] = "RK2A";
static const char __pyx_k_RK2B[] = "RK2B";
static const char __pyx_k_RK5F[] = "RK5F";
static const char __pyx_k_ROSW[] = "ROSW";
static const char __pyx_k_SAME[] = "SAME";
static const char __pyx_k_SAWS[] = "SAWS";
static const char __pyx_k_SELF[] = "SELF";
static const char __pyx_k_SELL[] = "SELL";
static const char __pyx_k_SNES[] = "SNES";
static const char __pyx_k_SPAI[] = "SPAI";
static const char __pyx_k_SPQR[] = "SPQR";
static const char __pyx_k_STAG[] = "STAG";
static const char __pyx_k_STAR[] = "STAR";
static const char __pyx_k_STCG[] = "STCG";
static const char __pyx_k_SYCL[] = "SYCL";
static const char __pyx_k_SYNC[] = "SYNC";
static const char __pyx_k_Side[] = "Side";
static const char __pyx_k_Size[] = "Size";
static const char __pyx_k_TRON[] = "TRON";
static const char __pyx_k_TRUE[] = "TRUE";
static const char __pyx_k_Type[] = "Type";
static const char __pyx_k_USER[] = "USER";
static const char __pyx_k_addv[] = "addv";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_atol[] = "atol";
static const char __pyx_k_attr[] = "attr";
static const char __pyx_k_axpy[] = "axpy";
static const char __pyx_k_back[] = "back";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_beta[] = "beta";
static const char __pyx_k_bits[] = "bits";
static const char __pyx_k_bndr[] = "bndr";
static const char __pyx_k_cell[] = "cell";
static const char __pyx_k_cgid[] = "cgid";
static const char __pyx_k_cmap[] = "cmap";
static const char __pyx_k_code[] = "code";
static const char __pyx_k_cols[] = "cols";
static const char __pyx_k_comm[] = "comm";
static const char __pyx_k_comp[] = "comp";
static const char __pyx_k_cone[] = "cone";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_date[] = "date";
static const char __pyx_k_dctx[] = "dctx";
static const char __pyx_k_diag[] = "diag";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_dims[] = "dims";
static const char __pyx_k_disc[] = "disc";
static const char __pyx_k_dist[] = "dist";
static const char __pyx_k_dmTo[] = "dmTo";
static const char __pyx_k_dofs[] = "dofs";
static const char __pyx_k_down[] = "down";
static const char __pyx_k_drop[] = "drop";
static const char __pyx_k_exec[] = "exec";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_fact[] = "fact";
static const char __pyx_k_fget[] = "fget";
static const char __pyx_k_file[] = "__file__";
static const char __pyx_k_fill[] = "fill";
static const char __pyx_k_flag[] = "flag";
static const char __pyx_k_flip[] = "flip";
static const char __pyx_k_func[] = "func";
static const char __pyx_k_gord[] = "gord";
static const char __pyx_k_gsec[] = "gsec";
static const char __pyx_k_gtol[] = "gtol";
static const char __pyx_k_gvec[] = "gvec";
static const char __pyx_k_hmax[] = "hmax";
static const char __pyx_k_hmin[] = "hmin";
static const char __pyx_k_idxm[] = "idxm";
static const char __pyx_k_ierr[] = "ierr";
static const char __pyx_k_imag[] = "imag";
static const char __pyx_k_imex[] = "imex";
static const char __pyx_k_info[] = "info";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_iset[] = "iset";
static const char __pyx_k_ival[] = "ival";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_kind[] = "kind";
static const char __pyx_k_left[] = "left";
static const char __pyx_k_lits[] = "lits";
static const char __pyx_k_locC[] = "locC";
static const char __pyx_k_locX[] = "locX";
static const char __pyx_k_locs[] = "locs";
static const char __pyx_k_ltog[] = "ltog";
static const char __pyx_k_ltol[] = "ltol";
static const char __pyx_k_lvec[] = "lvec";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_mats[] = "mats";
static const char __pyx_k_memo[] = "memo";
static const char __pyx_k_mode[] = "mode";
static const char __pyx_k_mult[] = "mult";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_ndim[] = "ndim";
static const char __pyx_k_nmax[] = "nmax";
static const char __pyx_k_nmin[] = "nmin";
static const char __pyx_k_none[] = "none";
static const char __pyx_k_norm[] = "norm";
static const char __pyx_k_null[] = "null";
static const char __pyx_k_onnz[] = "onnz";
static const char __pyx_k_open[] = "open";
static const char __pyx_k_opts[] = "opts";
static const char __pyx_k_pEnd[] = "pEnd";
static const char __pyx_k_pack[] = "pack";
static const char __pyx_k_part[] = "part";
static const char __pyx_k_perm[] = "perm";
static const char __pyx_k_ptap[] = "ptap";
static const char __pyx_k_push[] = "push";
static const char __pyx_k_quad[] = "quad";
static const char __pyx_k_rank[] = "rank";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_real[] = "real";
static const char __pyx_k_repr[] = "__repr__";
static const char __pyx_k_rmap[] = "rmap";
static const char __pyx_k_rows[] = "rows";
static const char __pyx_k_rtol[] = "rtol";
static const char __pyx_k_seed[] = "seed";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_sfxc[] = "sfxc";
static const char __pyx_k_side[] = "side";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_skip[] = "skip";
static const char __pyx_k_snes[] = "snes";
static const char __pyx_k_star[] = "star";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_stol[] = "stol";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_supp[] = "supp";
static const char __pyx_k_tabs[] = "tabs";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_uaux[] = "uaux";
static const char __pyx_k_unit[] = "unit";
static const char __pyx_k_vecs[] = "vecs";
static const char __pyx_k_view[] = "view";
static const char __pyx_k_vtol[] = "vtol";
static const char __pyx_k_xdot[] = "xdot";
static const char __pyx_k_xmax[] = "xmax";
static const char __pyx_k_xmin[] = "xmin";
static const char __pyx_k_ymax[] = "ymax";
static const char __pyx_k_ymin[] = "ymin";
static const char __pyx_k_zmax[] = "zmax";
static const char __pyx_k_zmin[] = "zmin";
static const char __pyx_k_ADIOS[] = "ADIOS";
static const char __pyx_k_ALPHA[] = "ALPHA";
static const char __pyx_k_ASCII[] = "ASCII";
static const char __pyx_k_ASFLS[] = "ASFLS";
static const char __pyx_k_ASILS[] = "ASILS";
static const char __pyx_k_ASPIN[] = "ASPIN";
static const char __pyx_k_BASIC[] = "BASIC";
static const char __pyx_k_BCGSL[] = "BCGSL";
static const char __pyx_k_BLMVM[] = "BLMVM";
static const char __pyx_k_BLOCK[] = "BLOCK";
static const char __pyx_k_BQNLS[] = "BQNLS";
static const char __pyx_k_BQPIP[] = "BQPIP";
static const char __pyx_k_CHACO[] = "CHACO";
static const char __pyx_k_Class[] = "Class";
static const char __pyx_k_Clone[] = "Clone";
static const char __pyx_k_DENSE[] = "DENSE";
static const char __pyx_k_DUMMY[] = "DUMMY";
static const char __pyx_k_EIMEX[] = "EIMEX";
static const char __pyx_k_EULER[] = "EULER";
static const char __pyx_k_Error[] = "Error";
static const char __pyx_k_Event[] = "Event";
static const char __pyx_k_FALSE[] = "FALSE";
static const char __pyx_k_FBCGS[] = "FBCGS";
static const char __pyx_k_FINAL[] = "FINAL";
static const char __pyx_k_FLUSH[] = "FLUSH";
static const char __pyx_k_FRONT[] = "FRONT";
static const char __pyx_k_GLVIS[] = "GLVIS";
static const char __pyx_k_GMRES[] = "GMRES";
static const char __pyx_k_HPDDM[] = "HPDDM";
static const char __pyx_k_HYPRE[] = "HYPRE";
static const char __pyx_k_IBCGS[] = "IBCGS";
static const char __pyx_k_LGMap[] = "LGMap";
static const char __pyx_k_LOCAL[] = "LOCAL";
static const char __pyx_k_LOWER[] = "LOWER";
static const char __pyx_k_LUSOL[] = "LUSOL";
static const char __pyx_k_MEYER[] = "MEYER";
static const char __pyx_k_MIMEX[] = "MIMEX";
static const char __pyx_k_MUMPS[] = "MUMPS";
static const char __pyx_k_ND_Pi[] = "ND_Pi";
static const char __pyx_k_OWLQN[] = "OWLQN";
static const char __pyx_k_P4EST[] = "P4EST";
static const char __pyx_k_P8EST[] = "P8EST";
static const char __pyx_k_PARMS[] = "PARMS";
static const char __pyx_k_PATCH[] = "PATCH";
static const char __pyx_k_PDIPM[] = "PDIPM";
static const char __pyx_k_PETSC[] = "PETSC";
static const char __pyx_k_POINT[] = "POINT";
static const char __pyx_k_Print[] = "Print";
static const char __pyx_k_RIGHT[] = "RIGHT";
static const char __pyx_k_RK1FE[] = "RK1FE";
static const char __pyx_k_RK3BS[] = "RK3BS";
static const char __pyx_k_RK5BS[] = "RK5BS";
static const char __pyx_k_RK5DP[] = "RK5DP";
static const char __pyx_k_RK6VR[] = "RK6VR";
static const char __pyx_k_RK7VR[] = "RK7VR";
static const char __pyx_k_RK8VR[] = "RK8VR";
static const char __pyx_k_RT_Pi[] = "RT_Pi";
static const char __pyx_k_Right[] = "Right";
static const char __pyx_k_SBAIJ[] = "SBAIJ";
static const char __pyx_k_SCHUR[] = "SCHUR";
static const char __pyx_k_SELFP[] = "SELFP";
static const char __pyx_k_SHELL[] = "SHELL";
static const char __pyx_k_SPRNG[] = "SPRNG";
static const char __pyx_k_SSFLS[] = "SSFLS";
static const char __pyx_k_SSILS[] = "SSILS";
static const char __pyx_k_SWARM[] = "SWARM";
static const char __pyx_k_Space[] = "Space";
static const char __pyx_k_Stage[] = "Stage";
static const char __pyx_k_TCQMR[] = "TCQMR";
static const char __pyx_k_TFQMR[] = "TFQMR";
static const char __pyx_k_THETA[] = "THETA";
static const char __pyx_k_THIRD[] = "THIRD";
static const char __pyx_k_TSIRM[] = "TSIRM";
static const char __pyx_k_TWIST[] = "TWIST";
static const char __pyx_k_UPPER[] = "UPPER";
static const char __pyx_k_VANKA[] = "VANKA";
static const char __pyx_k_WRITE[] = "WRITE";
static const char __pyx_k_a_max[] = "a_max";
static const char __pyx_k_abort[] = "abort";
static const char __pyx_k_alpha[] = "alpha";
static const char __pyx_k_apply[] = "apply";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_begin[] = "begin";
static const char __pyx_k_bsize[] = "bsize";
static const char __pyx_k_catol[] = "catol";
static const char __pyx_k_ccomm[] = "ccomm";
static const char __pyx_k_cdctx[] = "cdctx";
static const char __pyx_k_cells[] = "cells";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_cnorm[] = "cnorm";
static const char __pyx_k_comms[] = "comms";
static const char __pyx_k_count[] = "count";
static const char __pyx_k_crank[] = "crank";
static const char __pyx_k_crtol[] = "crtol";
static const char __pyx_k_csize[] = "csize";
static const char __pyx_k_ctype[] = "ctype";
static const char __pyx_k_dense[] = "dense";
static const char __pyx_k_devel[] = "devel";
static const char __pyx_k_dtcol[] = "dtcol";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_emacs[] = "emacs";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_entry[] = "entry";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_exoid[] = "exoid";
static const char __pyx_k_faces[] = "faces";
static const char __pyx_k_field[] = "field";
static const char __pyx_k_first[] = "first";
static const char __pyx_k_flags[] = "flags";
static const char __pyx_k_flops[] = "flops";
static const char __pyx_k_flush[] = "flush";
static const char __pyx_k_fnorm[] = "fnorm";
static const char __pyx_k_force[] = "force";
static const char __pyx_k_front[] = "front";
static const char __pyx_k_gamma[] = "gamma";
static const char __pyx_k_gatol[] = "gatol";
static const char __pyx_k_getDM[] = "getDM";
static const char __pyx_k_getDS[] = "getDS";
static const char __pyx_k_getPC[] = "getPC";
static const char __pyx_k_get_2[] = "get";
static const char __pyx_k_group[] = "group";
static const char __pyx_k_grtol[] = "grtol";
static const char __pyx_k_gttol[] = "gttol";
static const char __pyx_k_h_max[] = "h_max";
static const char __pyx_k_h_min[] = "h_min";
static const char __pyx_k_hausd[] = "hausd";
static const char __pyx_k_icntl[] = "icntl";
static const char __pyx_k_imode[] = "imode";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_is_to[] = "is_to";
static const char __pyx_k_iscol[] = "iscol";
static const char __pyx_k_isets[] = "isets";
static const char __pyx_k_isrow[] = "isrow";
static const char __pyx_k_kargs[] = "kargs";
static const char __pyx_k_klass[] = "klass";
static const char __pyx_k_label[] = "label";
static const char __pyx_k_lanes[] = "lanes";
static const char __pyx_k_level[] = "level";
static const char __pyx_k_lgmap[] = "lgmap";
static const char __pyx_k_local[] = "local";
static const char __pyx_k_lower[] = "lower";
static const char __pyx_k_lvecs[] = "lvecs";
static const char __pyx_k_major[] = "major";
static const char __pyx_k_minor[] = "minor";
static const char __pyx_k_model[] = "model";
static const char __pyx_k_omega[] = "omega";
static const char __pyx_k_order[] = "order";
static const char __pyx_k_other[] = "other";
static const char __pyx_k_otype[] = "otype";
static const char __pyx_k_petsc[] = "petsc";
static const char __pyx_k_point[] = "point";
static const char __pyx_k_primv[] = "primv";
static const char __pyx_k_ptype[] = "ptype";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_ready[] = "ready";
static const char __pyx_k_reset[] = "reset";
static const char __pyx_k_reuse[] = "reuse";
static const char __pyx_k_right[] = "right";
static const char __pyx_k_rnorm[] = "rnorm";
static const char __pyx_k_scale[] = "scale";
static const char __pyx_k_setDM[] = "setDM";
static const char __pyx_k_setDS[] = "setDS";
static const char __pyx_k_setUp[] = "setUp";
static const char __pyx_k_setup[] = "setup";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_shift[] = "shift";
static const char __pyx_k_sizes[] = "sizes";
static const char __pyx_k_sleep[] = "sleep";
static const char __pyx_k_solve[] = "solve";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_stage[] = "stage";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_strip[] = "strip";
static const char __pyx_k_subdm[] = "subdm";
static const char __pyx_k_subsp[] = "subsp";
static const char __pyx_k_theta[] = "theta";
static const char __pyx_k_title[] = "title";
static const char __pyx_k_toAll[] = "toAll";
static const char __pyx_k_trans[] = "trans";
static const char __pyx_k_tspan[] = "tspan";
static const char __pyx_k_twist[] = "twist";
static const char __pyx_k_upper[] = "upper";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_vecTo[] = "vecTo";
static const char __pyx_k_width[] = "width";
static const char __pyx_k_wraps[] = "wraps";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_xnorm[] = "xnorm";
static const char __pyx_k_ynorm[] = "ynorm";
static const char __pyx_k_ADD_BC[] = "ADD_BC";
static const char __pyx_k_AIJCRL[] = "AIJCRL";
static const char __pyx_k_AIJMKL[] = "AIJMKL";
static const char __pyx_k_ALPHA2[] = "ALPHA2";
static const char __pyx_k_ALWAYS[] = "ALWAYS";
static const char __pyx_k_AOType[] = "AOType";
static const char __pyx_k_APPEND[] = "APPEND";
static const char __pyx_k_BEULER[] = "BEULER";
static const char __pyx_k_BINARY[] = "BINARY";
static const char __pyx_k_BQNKLS[] = "BQNKLS";
static const char __pyx_k_BQNKTL[] = "BQNKTL";
static const char __pyx_k_BQNKTR[] = "BQNKTR";
static const char __pyx_k_DECIDE[] = "DECIDE";
static const char __pyx_k_DGMRES[] = "DGMRES";
static const char __pyx_k_DMPlex[] = "DMPlex";
static const char __pyx_k_DMStag[] = "DMStag";
static const char __pyx_k_DMType[] = "DMType";
static const char __pyx_k_DSType[] = "DSType";
static const char __pyx_k_Device[] = "Device";
static const char __pyx_k_EXOTIC[] = "EXOTIC";
static const char __pyx_k_FAILED[] = "FAILED";
static const char __pyx_k_FBCGSR[] = "FBCGSR";
static const char __pyx_k_FETIDP[] = "FETIDP";
static const char __pyx_k_FEType[] = "FEType";
static const char __pyx_k_FGMRES[] = "FGMRES";
static const char __pyx_k_FOREST[] = "FOREST";
static const char __pyx_k_Format[] = "Format";
static const char __pyx_k_GATHER[] = "GATHER";
static const char __pyx_k_H2OPUS[] = "H2OPUS";
static const char __pyx_k_INSERT[] = "INSERT";
static const char __pyx_k_ISType[] = "ISType";
static const char __pyx_k_JACOBI[] = "JACOBI";
static const char __pyx_k_KOKKOS[] = "KOKKOS";
static const char __pyx_k_LGMRES[] = "LGMRES";
static const char __pyx_k_LINEAR[] = "LINEAR";
static const char __pyx_k_MATLAB[] = "MATLAB";
static const char __pyx_k_MGType[] = "MGType";
static const char __pyx_k_MINRES[] = "MINRES";
static const char __pyx_k_MIRROR[] = "MIRROR";
static const char __pyx_k_MPIADJ[] = "MPIADJ";
static const char __pyx_k_MPIAIJ[] = "MPIAIJ";
static const char __pyx_k_MPIHIP[] = "MPIHIP";
static const char __pyx_k_NATIVE[] = "NATIVE";
static const char __pyx_k_NGMRES[] = "NGMRES";
static const char __pyx_k_NORMAL[] = "NORMAL";
static const char __pyx_k_NORM_1[] = "NORM_1";
static const char __pyx_k_NORM_2[] = "NORM_2";
static const char __pyx_k_NOTSET[] = "NOTSET";
static const char __pyx_k_OPENCL[] = "OPENCL";
static const char __pyx_k_Object[] = "Object";
static const char __pyx_k_Option[] = "Option";
static const char __pyx_k_PASTIX[] = "PASTIX";
static const char __pyx_k_PCSide[] = "PCSide";
static const char __pyx_k_PCType[] = "PCType";
static const char __pyx_k_PGMRES[] = "PGMRES";
static const char __pyx_k_PIPECG[] = "PIPECG";
static const char __pyx_k_PIPECR[] = "PIPECR";
static const char __pyx_k_PSEUDO[] = "PSEUDO";
static const char __pyx_k_PYTHON[] = "PYTHON";
static const char __pyx_k_QMRCGS[] = "QMRCGS";
static const char __pyx_k_RADAU5[] = "RADAU5";
static const char __pyx_k_RAND48[] = "RAND48";
static const char __pyx_k_RKType[] = "RKType";
static const char __pyx_k_Random[] = "Random";
static const char __pyx_k_Reason[] = "Reason";
static const char __pyx_k_SEQAIJ[] = "SEQAIJ";
static const char __pyx_k_SEQHIP[] = "SEQHIP";
static const char __pyx_k_SFType[] = "SFType";
static const char __pyx_k_SHARED[] = "SHARED";
static const char __pyx_k_SIMPLE[] = "SIMPLE";
static const char __pyx_k_SLICED[] = "SLICED";
static const char __pyx_k_SOCKET[] = "SOCKET";
static const char __pyx_k_STDERR[] = "STDERR";
static const char __pyx_k_STDOUT[] = "STDOUT";
static const char __pyx_k_STRIDE[] = "STRIDE";
static const char __pyx_k_STRING[] = "STRING";
static const char __pyx_k_SUBSET[] = "SUBSET";
static const char __pyx_k_SYMMLQ[] = "SYMMLQ";
static const char __pyx_k_TENSOR[] = "TENSOR";
static const char __pyx_k_TSType[] = "TSType";
static const char __pyx_k_UPDATE[] = "UPDATE";
static const char __pyx_k_Viewer[] = "Viewer";
static const char __pyx_k_WINDOW[] = "WINDOW";
static const char __pyx_k_alpha2[] = "alpha2";
static const char __pyx_k_alphas[] = "alphas";
static const char __pyx_k_amount[] = "amount";
static const char __pyx_k_appctx[] = "appctx";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_atexit[] = "atexit";
static const char __pyx_k_author[] = "author";
static const char __pyx_k_buffer[] = "buffer";
static const char __pyx_k_column[] = "column";
static const char __pyx_k_coords[] = "coords";
static const char __pyx_k_cratio[] = "cratio";
static const char __pyx_k_create[] = "create";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_decomp[] = "decomp";
static const char __pyx_k_degree[] = "degree";
static const char __pyx_k_design[] = "design";
static const char __pyx_k_device[] = "device";
static const char __pyx_k_divtol[] = "divtol";
static const char __pyx_k_dlpack[] = "__dlpack__";
static const char __pyx_k_dmtype[] = "dmtype";
static const char __pyx_k_dosort[] = "dosort";
static const char __pyx_k_dspace[] = "dspace";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_eqtype[] = "eqtype";
static const char __pyx_k_fields[] = "fields";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_getDim[] = "getDim";
static const char __pyx_k_getDof[] = "getDof";
static const char __pyx_k_getKSP[] = "getKSP";
static const char __pyx_k_getNPC[] = "getNPC";
static const char __pyx_k_getRhs[] = "getRhs";
static const char __pyx_k_ghosts[] = "ghosts";
static const char __pyx_k_handle[] = "handle";
static const char __pyx_k_ignore[] = "ignore";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_intdim[] = "intdim";
static const char __pyx_k_invert[] = "invert";
static const char __pyx_k_iscols[] = "iscols";
static const char __pyx_k_isperm[] = "isperm";
static const char __pyx_k_isrows[] = "isrows";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_lambda[] = "<lambda>";
static const char __pyx_k_length[] = "length";
static const char __pyx_k_levels[] = "levels";
static const char __pyx_k_lgmapc[] = "lgmapc";
static const char __pyx_k_lgmapr[] = "lgmapr";
static const char __pyx_k_max_it[] = "max_it";
static const char __pyx_k_maxval[] = "maxval";
static const char __pyx_k_memory[] = "memory";
static const char __pyx_k_metric[] = "metric";
static const char __pyx_k_mgtype[] = "mgtype";
static const char __pyx_k_mirror[] = "mirror";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_mpi4py[] = "mpi4py";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_name_3[] = "name_";
static const char __pyx_k_newsec[] = "newsec";
static const char __pyx_k_newvec[] = "newvec";
static const char __pyx_k_nlocal[] = "nlocal";
static const char __pyx_k_noMove[] = "noMove";
static const char __pyx_k_noSurf[] = "noSurf";
static const char __pyx_k_noSwap[] = "noSwap";
static const char __pyx_k_nroots[] = "nroots";
static const char __pyx_k_numDof[] = "numDof";
static const char __pyx_k_nzdiag[] = "nzdiag";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_offset[] = "offset";
static const char __pyx_k_option[] = "option";
static const char __pyx_k_output[] = "output";
static const char __pyx_k_pStart[] = "pStart";
static const char __pyx_k_parent[] = "parent";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_points[] = "points";
static const char __pyx_k_prefix[] = "prefix";
static const char __pyx_k_python[] = "python";
static const char __pyx_k_qorder[] = "qorder";
static const char __pyx_k_radius[] = "radius";
static const char __pyx_k_random[] = "random";
static const char __pyx_k_ranges[] = "ranges";
static const char __pyx_k_reason[] = "reason";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_refine[] = "refine";
static const char __pyx_k_remote[] = "remote";
static const char __pyx_k_remove[] = "remove";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_rowmap[] = "rowmap";
static const char __pyx_k_rscale[] = "rscale";
static const char __pyx_k_rsplit[] = "rsplit";
static const char __pyx_k_rtol_0[] = "rtol_0";
static const char __pyx_k_setKSP[] = "setKSP";
static const char __pyx_k_setNPC[] = "setNPC";
static const char __pyx_k_solver[] = "solver";
static const char __pyx_k_starts[] = "starts";
static const char __pyx_k_stderr[] = "stderr";
static const char __pyx_k_stdout[] = "stdout";
static const char __pyx_k_strata[] = "strata";
static const char __pyx_k_stream[] = "stream";
static const char __pyx_k_string[] = "string";
static const char __pyx_k_struct[] = "struct";
static const char __pyx_k_submat[] = "submat";
static const char __pyx_k_subvec[] = "subvec";
static const char __pyx_k_svalue[] = "svalue";
static const char __pyx_k_swidth[] = "swidth";
static const char __pyx_k_tbline[] = "tbline";
static const char __pyx_k_tblist[] = "tblist";
static const char __pyx_k_tensor[] = "tensor";
static const char __pyx_k_toZero[] = "toZero";
static const char __pyx_k_toindx[] = "toindx";
static const char __pyx_k_unpack[] = "unpack";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_vec_to[] = "vec_to";
static const char __pyx_k_viewer[] = "viewer";
static const char __pyx_k_weight[] = "weight";
static const char __pyx_k_ADD_ALL[] = "ADD_ALL";
static const char __pyx_k_AIJPERM[] = "AIJPERM";
static const char __pyx_k_AIJSELL[] = "AIJSELL";
static const char __pyx_k_ARKIMEX[] = "ARKIMEX";
static const char __pyx_k_ASMType[] = "ASMType";
static const char __pyx_k_BACK_UP[] = "BACK_UP";
static const char __pyx_k_BAIJMKL[] = "BAIJMKL";
static const char __pyx_k_BJACOBI[] = "BJACOBI";
static const char __pyx_k_Barrier[] = "Barrier";
static const char __pyx_k_CHOLMOD[] = "CHOLMOD";
static const char __pyx_k_DEFAULT[] = "DEFAULT";
static const char __pyx_k_DESTROY[] = "DESTROY";
static const char __pyx_k_DMLabel[] = "DMLabel";
static const char __pyx_k_DMShell[] = "DMShell";
static const char __pyx_k_DMSwarm[] = "DMSwarm";
static const char __pyx_k_DRAW_LG[] = "DRAW_LG";
static const char __pyx_k_ELEMENT[] = "ELEMENT";
static const char __pyx_k_EXTRUDE[] = "EXTRUDE";
static const char __pyx_k_FORWARD[] = "FORWARD";
static const char __pyx_k_GATHERV[] = "GATHERV";
static const char __pyx_k_GENERAL[] = "GENERAL";
static const char __pyx_k_GHOSTED[] = "GHOSTED";
static const char __pyx_k_GROPPCG[] = "GROPPCG";
static const char __pyx_k_IntType[] = "IntType";
static const char __pyx_k_KASKADE[] = "KASKADE";
static const char __pyx_k_KSPONLY[] = "KSPONLY";
static const char __pyx_k_KSPType[] = "KSPType";
static const char __pyx_k_LMVMDFP[] = "LMVMDFP";
static const char __pyx_k_LMVMSR1[] = "LMVMSR1";
static const char __pyx_k_MAPPING[] = "MAPPING";
static const char __pyx_k_METISND[] = "METISND";
static const char __pyx_k_MPIBAIJ[] = "MPIBAIJ";
static const char __pyx_k_MPICUDA[] = "MPICUDA";
static const char __pyx_k_MPIKAIJ[] = "MPIKAIJ";
static const char __pyx_k_MPIMAIJ[] = "MPIMAIJ";
static const char __pyx_k_MPISELL[] = "MPISELL";
static const char __pyx_k_MapMode[] = "MapMode";
static const char __pyx_k_MatType[] = "MatType";
static const char __pyx_k_NATURAL[] = "NATURAL";
static const char __pyx_k_NETWORK[] = "NETWORK";
static const char __pyx_k_NOERROR[] = "NOERROR";
static const char __pyx_k_NONZERO[] = "NONZERO";
static const char __pyx_k_NO_SYNC[] = "NO_SYNC";
static const char __pyx_k_NULLLOC[] = "NULLLOC";
static const char __pyx_k_Options[] = "Options";
static const char __pyx_k_PIPECG2[] = "PIPECG2";
static const char __pyx_k_PIPEFCG[] = "PIPEFCG";
static const char __pyx_k_PIPEGCR[] = "PIPEGCR";
static const char __pyx_k_PIPELCG[] = "PIPELCG";
static const char __pyx_k_PREONLY[] = "PREONLY";
static const char __pyx_k_PRODUCT[] = "PRODUCT";
static const char __pyx_k_PYRAMID[] = "PYRAMID";
static const char __pyx_k_QUARTER[] = "QUARTER";
static const char __pyx_k_REFINED[] = "REFINED";
static const char __pyx_k_REVERSE[] = "REVERSE";
static const char __pyx_k_SAME_NZ[] = "SAME_NZ";
static const char __pyx_k_SCATTER[] = "SCATTER";
static const char __pyx_k_SEGMENT[] = "SEGMENT";
static const char __pyx_k_SEQBAIJ[] = "SEQBAIJ";
static const char __pyx_k_SEQCUDA[] = "SEQCUDA";
static const char __pyx_k_SEQKAIJ[] = "SEQKAIJ";
static const char __pyx_k_SEQMAIJ[] = "SEQMAIJ";
static const char __pyx_k_SEQSELL[] = "SEQSELL";
static const char __pyx_k_SORType[] = "SORType";
static const char __pyx_k_SPECIAL[] = "SPECIAL";
static const char __pyx_k_SUPERLU[] = "SUPERLU";
static const char __pyx_k_SYSPFMG[] = "SYSPFMG";
static const char __pyx_k_Scatter[] = "Scatter";
static const char __pyx_k_Section[] = "Section";
static const char __pyx_k_Stencil[] = "Stencil";
static const char __pyx_k_TAOType[] = "TAOType";
static const char __pyx_k_UMFPACK[] = "UMFPACK";
static const char __pyx_k_UNKNOWN[] = "UNKNOWN";
static const char __pyx_k_UP_LEFT[] = "UP_LEFT";
static const char __pyx_k_VTK_VTR[] = "VTK_VTR";
static const char __pyx_k_VTK_VTS[] = "VTK_VTS";
static const char __pyx_k_VTK_VTU[] = "VTK_VTU";
static const char __pyx_k_VecType[] = "VecType";
static const char __pyx_k_alpha_f[] = "alpha_f";
static const char __pyx_k_alpha_m[] = "alpha_m";
static const char __pyx_k_array_w[] = "array_w";
static const char __pyx_k_asmtype[] = "asmtype";
static const char __pyx_k_back_up[] = "back_up";
static const char __pyx_k_barrier[] = "barrier";
static const char __pyx_k_bcComps[] = "bcComps";
static const char __pyx_k_bcField[] = "bcField";
static const char __pyx_k_bdLabel[] = "bdLabel";
static const char __pyx_k_bdlabel[] = "bdlabel";
static const char __pyx_k_bdvalue[] = "bdvalue";
static const char __pyx_k_coarsen[] = "coarsen";
static const char __pyx_k_compile[] = "compile";
static const char __pyx_k_conePos[] = "conePos";
static const char __pyx_k_context[] = "context";
static const char __pyx_k_default[] = "default";
static const char __pyx_k_destroy[] = "destroy";
static const char __pyx_k_display[] = "display";
static const char __pyx_k_dm_type[] = "dm_type";
static const char __pyx_k_ds_type[] = "ds_type";
static const char __pyx_k_dtcount[] = "dtcount";
static const char __pyx_k_element[] = "element";
static const char __pyx_k_epsilon[] = "epsilon";
static const char __pyx_k_fe_type[] = "fe_type";
static const char __pyx_k_fortran[] = "fortran";
static const char __pyx_k_forward[] = "forward";
static const char __pyx_k_getComm[] = "getComm";
static const char __pyx_k_getInfo[] = "getInfo";
static const char __pyx_k_getName[] = "getName";
static const char __pyx_k_getRank[] = "getRank";
static const char __pyx_k_getSNES[] = "getSNES";
static const char __pyx_k_getSeed[] = "getSeed";
static const char __pyx_k_getSize[] = "getSize";
static const char __pyx_k_getTime[] = "getTime";
static const char __pyx_k_getType[] = "getType";
static const char __pyx_k_getVecs[] = "getVecs";
static const char __pyx_k_ghosted[] = "ghosted";
static const char __pyx_k_hasName[] = "hasName";
static const char __pyx_k_hessian[] = "hessian";
static const char __pyx_k_indices[] = "indices";
static const char __pyx_k_is_from[] = "is_from";
static const char __pyx_k_is_type[] = "is_type";
static const char __pyx_k_mallocs[] = "mallocs";
static const char __pyx_k_matMult[] = "matMult";
static const char __pyx_k_maxrank[] = "maxrank";
static const char __pyx_k_memview[] = "memview";
static const char __pyx_k_metric1[] = "metric1";
static const char __pyx_k_metric2[] = "metric2";
static const char __pyx_k_metric3[] = "metric3";
static const char __pyx_k_monitor[] = "monitor";
static const char __pyx_k_multAdd[] = "multAdd";
static const char __pyx_k_nbsteps[] = "nbsteps";
static const char __pyx_k_nlevels[] = "nlevels";
static const char __pyx_k_nonzero[] = "nonzero";
static const char __pyx_k_npoints[] = "npoints";
static const char __pyx_k_numComp[] = "numComp";
static const char __pyx_k_numIter[] = "numIter";
static const char __pyx_k_nz_used[] = "nz_used";
static const char __pyx_k_objgrad[] = "objgrad";
static const char __pyx_k_ometric[] = "ometric";
static const char __pyx_k_options[] = "options";
static const char __pyx_k_overlap[] = "overlap";
static const char __pyx_k_package[] = "package";
static const char __pyx_k_pc_type[] = "pc_type";
static const char __pyx_k_preStep[] = "preStep";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_prestep[] = "prestep";
static const char __pyx_k_py_type[] = "py_type";
static const char __pyx_k_release[] = "release";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_reshape[] = "reshape";
static const char __pyx_k_restart[] = "restart";
static const char __pyx_k_reverse[] = "reverse";
static const char __pyx_k_rgLabel[] = "rgLabel";
static const char __pyx_k_scatter[] = "scatter";
static const char __pyx_k_seconds[] = "seconds";
static const char __pyx_k_setName[] = "setName";
static const char __pyx_k_setSeed[] = "setSeed";
static const char __pyx_k_setTime[] = "setTime";
static const char __pyx_k_setType[] = "setType";
static const char __pyx_k_sf_type[] = "sf_type";
static const char __pyx_k_simplex[] = "simplex";
static const char __pyx_k_smooths[] = "smooths";
static const char __pyx_k_sortype[] = "sortype";
static const char __pyx_k_stratum[] = "stratum";
static const char __pyx_k_strides[] = "strides";
static const char __pyx_k_subcomm[] = "subcomm";
static const char __pyx_k_submats[] = "submats";
static const char __pyx_k_tr_type[] = "tr_type";
static const char __pyx_k_trimmed[] = "trimmed";
static const char __pyx_k_ts_type[] = "ts_type";
static const char __pyx_k_typestr[] = "typestr";
static const char __pyx_k_uniform[] = "uniform";
static const char __pyx_k_unnamed[] = "unnamed";
static const char __pyx_k_up_left[] = "up_left";
static const char __pyx_k_useCone[] = "useCone";
static const char __pyx_k_vectors[] = "vectors";
static const char __pyx_k_version[] = "version";
static const char __pyx_k_xdotdot[] = "xdotdot";
static const char __pyx_k_ADDITIVE[] = "ADDITIVE";
static const char __pyx_k_ADVANCED[] = "ADVANCED";
static const char __pyx_k_ALLTOALL[] = "ALLTOALL";
static const char __pyx_k_ANDERSON[] = "ANDERSON";
static const char __pyx_k_ARKIMEX3[] = "ARKIMEX3";
static const char __pyx_k_ARKIMEX4[] = "ARKIMEX4";
static const char __pyx_k_ARKIMEX5[] = "ARKIMEX5";
static const char __pyx_k_BALANCED[] = "BALANCED";
static const char __pyx_k_BIORTH22[] = "BIORTH22";
static const char __pyx_k_BLOCKMAT[] = "BLOCKMAT";
static const char __pyx_k_CHOLESKY[] = "CHOLESKY";
static const char __pyx_k_CUSPARSE[] = "CUSPARSE";
static const char __pyx_k_DEFLATED[] = "DEFLATED";
static const char __pyx_k_DISCGRAD[] = "DISCGRAD";
static const char __pyx_k_DrawSize[] = "DrawSize";
static const char __pyx_k_EXODUSII[] = "EXODUSII";
static const char __pyx_k_EXPLICIT[] = "EXPLICIT";
static const char __pyx_k_Ellipsis[] = "Ellipsis";
static const char __pyx_k_FRONT_UP[] = "FRONT_UP";
static const char __pyx_k_FV_GHOST[] = "FV_GHOST";
static const char __pyx_k_FileMode[] = "FileMode";
static const char __pyx_k_GALERKIN[] = "GALERKIN";
static const char __pyx_k_GAMGType[] = "GAMGType";
static const char __pyx_k_GASMType[] = "GASMType";
static const char __pyx_k_GIT_Date[] = "GIT Date:";
static const char __pyx_k_Get_rank[] = "Get_rank";
static const char __pyx_k_Get_size[] = "Get_size";
static const char __pyx_k_HDF5_MAT[] = "HDF5_MAT";
static const char __pyx_k_HDF5_VIZ[] = "HDF5_VIZ";
static const char __pyx_k_IMPLICIT[] = "IMPLICIT";
static const char __pyx_k_INBLOCKS[] = "INBLOCKS";
static const char __pyx_k_INFINITY[] = "INFINITY";
static const char __pyx_k_InfoType[] = "InfoType";
static const char __pyx_k_JoinMode[] = "JoinMode";
static const char __pyx_k_KACZMARZ[] = "KACZMARZ";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_LAGRANGE[] = "LAGRANGE";
static const char __pyx_k_LMVMBFGS[] = "LMVMBFGS";
static const char __pyx_k_LOCALREF[] = "LOCALREF";
static const char __pyx_k_LogClass[] = "LogClass";
static const char __pyx_k_LogEvent[] = "LogEvent";
static const char __pyx_k_LogStage[] = "LogStage";
static const char __pyx_k_MPIDENSE[] = "MPIDENSE";
static const char __pyx_k_MPISBAIJ[] = "MPISBAIJ";
static const char __pyx_k_NEIGHBOR[] = "NEIGHBOR";
static const char __pyx_k_NEWTONLS[] = "NEWTONLS";
static const char __pyx_k_NEWTONTR[] = "NEWTONTR";
static const char __pyx_k_NOFORMAT[] = "NOFORMAT";
static const char __pyx_k_NORM_MAX[] = "NORM_MAX";
static const char __pyx_k_NormType[] = "NormType";
static const char __pyx_k_PARMETIS[] = "PARMETIS";
static const char __pyx_k_PBJACOBI[] = "PBJACOBI";
static const char __pyx_k_PCMGType[] = "PCMGType";
static const char __pyx_k_PERIODIC[] = "PERIODIC";
static const char __pyx_k_PIPEBCGS[] = "PIPEBCGS";
static const char __pyx_k_PIPECGRR[] = "PIPECGRR";
static const char __pyx_k_PIPEPRCG[] = "PIPEPRCG";
static const char __pyx_k_POUNDERS[] = "POUNDERS";
static const char __pyx_k_PTRIMMED[] = "PTRIMMED";
static const char __pyx_k_PTSCOTCH[] = "PTSCOTCH";
static const char __pyx_k_RANDER48[] = "RANDER48";
static const char __pyx_k_REFINE1D[] = "REFINE1D";
static const char __pyx_k_RESTRICT[] = "RESTRICT";
static const char __pyx_k_RealType[] = "RealType";
static const char __pyx_k_SEQCUFFT[] = "SEQCUFFT";
static const char __pyx_k_SEQDENSE[] = "SEQDENSE";
static const char __pyx_k_SEQSBAIJ[] = "SEQSBAIJ";
static const char __pyx_k_SNESType[] = "SNESType";
static const char __pyx_k_SPECTRAL[] = "SPECTRAL";
static const char __pyx_k_STANDARD[] = "STANDARD";
static const char __pyx_k_STEPOVER[] = "STEPOVER";
static const char __pyx_k_SUBSPACE[] = "SUBSPACE";
static const char __pyx_k_SUNDIALS[] = "SUNDIALS";
static const char __pyx_k_TRIANGLE[] = "TRIANGLE";
static const char __pyx_k_TSRKType[] = "TSRKType";
static const char __pyx_k_UP_RIGHT[] = "UP_RIGHT";
static const char __pyx_k_VIENNACL[] = "VIENNACL";
static const char __pyx_k_addFlops[] = "addFlops";
static const char __pyx_k_assembly[] = "assembly";
static const char __pyx_k_bcPoints[] = "bcPoints";
static const char __pyx_k_boundary[] = "boundary";
static const char __pyx_k_buffer_w[] = "buffer_w";
static const char __pyx_k_builtins[] = "__builtins__";
static const char __pyx_k_citation[] = "citation";
static const char __pyx_k_constant[] = "constant";
static const char __pyx_k_cpuarray[] = "cpuarray";
static const char __pyx_k_debugger[] = "debugger";
static const char __pyx_k_delValue[] = "delValue";
static const char __pyx_k_dltensor[] = "dltensor";
static const char __pyx_k_end_args[] = "end_args";
static const char __pyx_k_enum2str[] = "__enum2str";
static const char __pyx_k_filename[] = "filename";
static const char __pyx_k_finalize[] = "_finalize";
static const char __pyx_k_front_up[] = "front_up";
static const char __pyx_k_function[] = "function";
static const char __pyx_k_gamgtype[] = "gamgtype";
static const char __pyx_k_gasmtype[] = "gasmtype";
static const char __pyx_k_getArray[] = "getArray";
static const char __pyx_k_getFlops[] = "getFlops";
static const char __pyx_k_getSizes[] = "getSizes";
static const char __pyx_k_getUseEW[] = "getUseEW";
static const char __pyx_k_getUseFD[] = "getUseFD";
static const char __pyx_k_getUseMF[] = "getUseMF";
static const char __pyx_k_getValue[] = "getValue";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_gradient[] = "gradient";
static const char __pyx_k_hasLabel[] = "hasLabel";
static const char __pyx_k_imagPart[] = "imagPart";
static const char __pyx_k_inblocks[] = "inblocks";
static const char __pyx_k_interior[] = "interior";
static const char __pyx_k_interval[] = "interval";
static const char __pyx_k_isActive[] = "isActive";
static const char __pyx_k_isSorted[] = "isSorted";
static const char __pyx_k_is_local[] = "is_local";
static const char __pyx_k_isfields[] = "isfields";
static const char __pyx_k_itemsize[] = "itemsize";
static const char __pyx_k_jacobian[] = "jacobian";
static const char __pyx_k_ksp_type[] = "ksp_type";
static const char __pyx_k_leafdata[] = "leafdata";
static const char __pyx_k_leafsize[] = "leafsize";
static const char __pyx_k_localsec[] = "localsec";
static const char __pyx_k_logFlops[] = "logFlops";
static const char __pyx_k_matApply[] = "matApply";
static const char __pyx_k_mat_type[] = "mat_type";
static const char __pyx_k_max_time[] = "max_time";
static const char __pyx_k_mpiabort[] = "mpiabort";
static const char __pyx_k_noInsert[] = "noInsert";
static const char __pyx_k_normtype[] = "normtype";
static const char __pyx_k_nsubcomm[] = "nsubcomm";
static const char __pyx_k_numProcs[] = "numProcs";
static const char __pyx_k_only_and[] = "only '==' and '!='";
static const char __pyx_k_operator[] = "operator";
static const char __pyx_k_ord_type[] = "ord_type";
static const char __pyx_k_parallel[] = "parallel";
static const char __pyx_k_periodic[] = "periodic";
static const char __pyx_k_plexname[] = "plexname";
static const char __pyx_k_position[] = "position";
static const char __pyx_k_postStep[] = "postStep";
static const char __pyx_k_poststep[] = "poststep";
static const char __pyx_k_preSolve[] = "preSolve";
static const char __pyx_k_precheck[] = "precheck";
static const char __pyx_k_property[] = "property";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_readonly[] = "readonly";
static const char __pyx_k_realPart[] = "realPart";
static const char __pyx_k_refine_x[] = "refine_x";
static const char __pyx_k_refine_y[] = "refine_y";
static const char __pyx_k_refine_z[] = "refine_z";
static const char __pyx_k_register[] = "register";
static const char __pyx_k_residual[] = "residual";
static const char __pyx_k_rnd_type[] = "rnd_type";
static const char __pyx_k_rollback[] = "rollback";
static const char __pyx_k_rootdata[] = "rootdata";
static const char __pyx_k_rtol_max[] = "rtol_max";
static const char __pyx_k_s_at_s_d[] = "%s() at %s:%d";
static const char __pyx_k_selected[] = "selected";
static const char __pyx_k_setSizes[] = "setSizes";
static const char __pyx_k_setUseEW[] = "setUseEW";
static const char __pyx_k_setUseFD[] = "setUseFD";
static const char __pyx_k_setUseMF[] = "setUseMF";
static const char __pyx_k_setValue[] = "setValue";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_solveAdd[] = "solveAdd";
static const char __pyx_k_stderr_2[] = "__stderr__";
static const char __pyx_k_stdout_2[] = "__stdout__";
static const char __pyx_k_subminor[] = "subminor";
static const char __pyx_k_tao_type[] = "tao_type";
static const char __pyx_k_timestep[] = "timestep";
static const char __pyx_k_toDLPack[] = "toDLPack";
static const char __pyx_k_up_right[] = "up_right";
static const char __pyx_k_vec_from[] = "vec_from";
static const char __pyx_k_vec_type[] = "vec_type";
static const char __pyx_k_vwr_type[] = "vwr_type";
static const char __pyx_k_ALLGATHER[] = "ALLGATHER";
static const char __pyx_k_ARKIMEX2C[] = "ARKIMEX2C";
static const char __pyx_k_ARKIMEX2D[] = "ARKIMEX2D";
static const char __pyx_k_ARKIMEX2E[] = "ARKIMEX2E";
static const char __pyx_k_ARKIMEXA2[] = "ARKIMEXA2";
static const char __pyx_k_ARKIMEXL2[] = "ARKIMEXL2";
static const char __pyx_k_ASCII_CSV[] = "ASCII_CSV";
static const char __pyx_k_ASCII_VTK[] = "ASCII_VTK";
static const char __pyx_k_ASCII_XML[] = "ASCII_XML";
static const char __pyx_k_BACK_DOWN[] = "BACK_DOWN";
static const char __pyx_k_BACK_LEFT[] = "BACK_LEFT";
static const char __pyx_k_CHEBYSHEV[] = "CHEBYSHEV";
static const char __pyx_k_CLASSICAL[] = "CLASSICAL";
static const char __pyx_k_COMM_NULL[] = "COMM_NULL";
static const char __pyx_k_COMM_SELF[] = "COMM_SELF";
static const char __pyx_k_COMPOSITE[] = "COMPOSITE";
static const char __pyx_k_DEFLATION[] = "DEFLATION";
static const char __pyx_k_DENSECUDA[] = "DENSECUDA";
static const char __pyx_k_DETERMINE[] = "DETERMINE";
static const char __pyx_k_DIFFERENT[] = "DIFFERENT";
static const char __pyx_k_DOWN_LEFT[] = "DOWN_LEFT";
static const char __pyx_k_DualSpace[] = "DualSpace";
static const char __pyx_k_EISENSTAT[] = "EISENSTAT";
static const char __pyx_k_ELEMENTAL[] = "ELEMENTAL";
static const char __pyx_k_FROBENIUS[] = "FROBENIUS";
static const char __pyx_k_FULL_SIZE[] = "FULL_SIZE";
static const char __pyx_k_GLMapMode[] = "GLMapMode";
static const char __pyx_k_HALF_SIZE[] = "HALF_SIZE";
static const char __pyx_k_HDF5_XDMF[] = "HDF5_XDMF";
static const char __pyx_k_HERMITIAN[] = "HERMITIAN";
static const char __pyx_k_INSERT_BC[] = "INSERT_BC";
static const char __pyx_k_IS_buffer[] = "_IS_buffer";
static const char __pyx_k_ITERATING[] = "ITERATING";
static const char __pyx_k_LGMapType[] = "LGMapType";
static const char __pyx_k_MATCHSTEP[] = "MATCHSTEP";
static const char __pyx_k_MPIAIJCRL[] = "MPIAIJCRL";
static const char __pyx_k_MPIAIJMKL[] = "MPIAIJMKL";
static const char __pyx_k_MPIKOKKOS[] = "MPIKOKKOS";
static const char __pyx_k_MPI_Error[] = "MPI Error ";
static const char __pyx_k_MatOption[] = "MatOption";
static const char __pyx_k_NINFINITY[] = "NINFINITY";
static const char __pyx_k_NONLINEAR[] = "NONLINEAR";
static const char __pyx_k_NORM_NONE[] = "NORM_NONE";
static const char __pyx_k_NullSpace[] = "NullSpace";
static const char __pyx_k_PARDECOMP[] = "PARDECOMP";
static const char __pyx_k_PCASMType[] = "PCASMType";
static const char __pyx_k_PINFINITY[] = "PINFINITY";
static const char __pyx_k_RANDOM123[] = "RANDOM123";
static const char __pyx_k_REDUNDANT[] = "REDUNDANT";
static const char __pyx_k_REFINESBR[] = "REFINESBR";
static const char __pyx_k_ROWLENGTH[] = "ROWLENGTH";
static const char __pyx_k_SCALAPACK[] = "SCALAPACK";
static const char __pyx_k_SEQAIJCRL[] = "SEQAIJCRL";
static const char __pyx_k_SEQAIJMKL[] = "SEQAIJMKL";
static const char __pyx_k_SEQKOKKOS[] = "SEQKOKKOS";
static const char __pyx_k_STRUMPACK[] = "STRUMPACK";
static const char __pyx_k_SUBMATRIX[] = "SUBMATRIX";
static const char __pyx_k_SUBSET_NZ[] = "SUBSET_NZ";
static const char __pyx_k_SYMMETRIC[] = "SYMMETRIC";
static const char __pyx_k_SpaceType[] = "SpaceType";
static const char __pyx_k_Structure[] = "Structure";
static const char __pyx_k_TELESCOPE[] = "TELESCOPE";
static const char __pyx_k_TRANSPOSE[] = "TRANSPOSE";
static const char __pyx_k_TRI_PRISM[] = "TRI_PRISM";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_VPBJACOBI[] = "VPBJACOBI";
static const char __pyx_k_VecOption[] = "VecOption";
static const char __pyx_k_adaptStep[] = "adaptStep";
static const char __pyx_k_back_down[] = "back_down";
static const char __pyx_k_back_left[] = "back_left";
static const char __pyx_k_batchSize[] = "batchSize";
static const char __pyx_k_blockSize[] = "blockSize";
static const char __pyx_k_blocksize[] = "blocksize";
static const char __pyx_k_col_bsize[] = "col_bsize";
static const char __pyx_k_conePoint[] = "conePoint";
static const char __pyx_k_conjugate[] = "conjugate";
static const char __pyx_k_converged[] = "converged";
static const char __pyx_k_createMat[] = "createMat";
static const char __pyx_k_decorator[] = "decorator";
static const char __pyx_k_device_id[] = "device_id";
static const char __pyx_k_direction[] = "direction";
static const char __pyx_k_down_left[] = "down_left";
static const char __pyx_k_duplicate[] = "duplicate";
static const char __pyx_k_elem_type[] = "elem_type";
static const char __pyx_k_end_kargs[] = "end_kargs";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_fieldName[] = "fieldName";
static const char __pyx_k_fieldname[] = "fieldname";
static const char __pyx_k_functools[] = "functools";
static const char __pyx_k_getActive[] = "getActive";
static const char __pyx_k_getAppCtx[] = "getAppCtx";
static const char __pyx_k_getBuffer[] = "getBuffer";
static const char __pyx_k_getDevice[] = "getDevice";
static const char __pyx_k_getMatrix[] = "getMatrix";
static const char __pyx_k_getNumber[] = "getNumber";
static const char __pyx_k_getPCSide[] = "getPCSide";
static const char __pyx_k_getRanges[] = "getRanges";
static const char __pyx_k_getString[] = "getString";
static const char __pyx_k_globalsec[] = "globalsec";
static const char __pyx_k_hiphandle[] = "hiphandle";
static const char __pyx_k_hypretype[] = "hypretype";
static const char __pyx_k_indicator[] = "indicator";
static const char __pyx_k_infoAllow[] = "infoAllow";
static const char __pyx_k_isSimplex[] = "isSimplex";
static const char __pyx_k_isotropic[] = "isotropic";
static const char __pyx_k_jacobianp[] = "jacobianp";
static const char __pyx_k_join_mode[] = "join_mode";
static const char __pyx_k_labelName[] = "labelName";
static const char __pyx_k_maxDegree[] = "maxDegree";
static const char __pyx_k_max_fails[] = "max_fails";
static const char __pyx_k_max_funcs[] = "max_funcs";
static const char __pyx_k_max_steps[] = "max_steps";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_metricAvg[] = "metricAvg";
static const char __pyx_k_metricInt[] = "metricInt";
static const char __pyx_k_nonzero_2[] = "__nonzero__";
static const char __pyx_k_norm_type[] = "norm_type";
static const char __pyx_k_normsched[] = "normsched";
static const char __pyx_k_numBlocks[] = "numBlocks";
static const char __pyx_k_numFields[] = "numFields";
static const char __pyx_k_objective[] = "objective";
static const char __pyx_k_operators[] = "operators";
static const char __pyx_k_package_2[] = "__package__";
static const char __pyx_k_part_type[] = "part_type";
static const char __pyx_k_postSolve[] = "postSolve";
static const char __pyx_k_postevent[] = "postevent";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_redundant[] = "redundant";
static const char __pyx_k_row_bsize[] = "row_bsize";
static const char __pyx_k_sectiondm[] = "sectiondm";
static const char __pyx_k_setActive[] = "setActive";
static const char __pyx_k_setAppCtx[] = "setAppCtx";
static const char __pyx_k_setDevice[] = "setDevice";
static const char __pyx_k_setOption[] = "setOption";
static const char __pyx_k_setPCSide[] = "setPCSide";
static const char __pyx_k_shifttype[] = "shifttype";
static const char __pyx_k_snes_type[] = "snes_type";
static const char __pyx_k_solveStep[] = "solveStep";
static const char __pyx_k_structure[] = "structure";
static const char __pyx_k_symmetric[] = "symmetric";
static const char __pyx_k_syncFlush[] = "syncFlush";
static const char __pyx_k_syncPrint[] = "syncPrint";
static const char __pyx_k_terminate[] = "terminate";
static const char __pyx_k_threshold[] = "threshold";
static const char __pyx_k_time_step[] = "time_step";
static const char __pyx_k_traceback[] = "_traceback_";
static const char __pyx_k_transpose[] = "transpose";
static const char __pyx_k_varbounds[] = "varbounds";
static const char __pyx_k_verbosity[] = "verbosity";
static const char __pyx_k_zeropivot[] = "zeropivot";
static const char __pyx_k_ADD_VALUES[] = "ADD_VALUES";
static const char __pyx_k_ALLGATHERV[] = "ALLGATHERV";
static const char __pyx_k_ASCII_IMPL[] = "ASCII_IMPL";
static const char __pyx_k_ASCII_INFO[] = "ASCII_INFO";
static const char __pyx_k_BACK_RIGHT[] = "BACK_RIGHT";
static const char __pyx_k_COMM_WORLD[] = "COMM_WORLD";
static const char __pyx_k_DOWN_RIGHT[] = "DOWN_RIGHT";
static const char __pyx_k_DRAW_BASIC[] = "DRAW_BASIC";
static const char __pyx_k_DRAW_PORTS[] = "DRAW_PORTS";
static const char __pyx_k_DeviceType[] = "DeviceType";
static const char __pyx_k_FIELDSPLIT[] = "FIELDSPLIT";
static const char __pyx_k_FINAL_ONLY[] = "FINAL_ONLY";
static const char __pyx_k_FRONT_DOWN[] = "FRONT_DOWN";
static const char __pyx_k_FRONT_LEFT[] = "FRONT_LEFT";
static const char __pyx_k_GLOBAL_MAX[] = "GLOBAL_MAX";
static const char __pyx_k_GLOBAL_SUM[] = "GLOBAL_SUM";
static const char __pyx_k_HDF5_PETSC[] = "HDF5_PETSC";
static const char __pyx_k_HEXAHEDRON[] = "HEXAHEDRON";
static const char __pyx_k_INSERT_ALL[] = "INSERT_ALL";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_InsertMode[] = "InsertMode";
static const char __pyx_k_MAX_VALUES[] = "MAX_VALUES";
static const char __pyx_k_MPIAIJPERM[] = "MPIAIJPERM";
static const char __pyx_k_MPIAIJSELL[] = "MPIAIJSELL";
static const char __pyx_k_MPIBAIJMKL[] = "MPIBAIJMKL";
static const char __pyx_k_MatSORType[] = "MatSORType";
static const char __pyx_k_ND_Pi_Full[] = "ND_Pi_Full";
static const char __pyx_k_OPTION_MAX[] = "OPTION_MAX";
static const char __pyx_k_OPTION_MIN[] = "OPTION_MIN";
static const char __pyx_k_PCGAMGType[] = "PCGAMGType";
static const char __pyx_k_PCGASMType[] = "PCGASMType";
static const char __pyx_k_PIPEFGMRES[] = "PIPEFGMRES";
static const char __pyx_k_POLYNOMIAL[] = "POLYNOMIAL";
static const char __pyx_k_RICHARDSON[] = "RICHARDSON";
static const char __pyx_k_RT_Pi_Full[] = "RT_Pi_Full";
static const char __pyx_k_RandomType[] = "RandomType";
static const char __pyx_k_SAVIENNACL[] = "SAVIENNACL";
static const char __pyx_k_SEQAIJPERM[] = "SEQAIJPERM";
static const char __pyx_k_SEQAIJSELL[] = "SEQAIJSELL";
static const char __pyx_k_SEQBAIJMKL[] = "SEQBAIJMKL";
static const char __pyx_k_ScalarType[] = "ScalarType";
static const char __pyx_k_SolverType[] = "SolverType";
static const char __pyx_k_StreamType[] = "StreamType";
static const char __pyx_k_THIRD_SIZE[] = "THIRD_SIZE";
static const char __pyx_k_UNKNOWN_NZ[] = "UNKNOWN_NZ";
static const char __pyx_k_USE_INODES[] = "USE_INODES";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_Vec_buffer[] = "_Vec_buffer";
static const char __pyx_k_ViewerHDF5[] = "ViewerHDF5";
static const char __pyx_k_ViewerType[] = "ViewerType";
static const char __pyx_k_assemblies[] = "assemblies";
static const char __pyx_k_authorinfo[] = "authorinfo";
static const char __pyx_k_back_right[] = "back_right";
static const char __pyx_k_begin_args[] = "begin_args";
static const char __pyx_k_block_size[] = "block_size";
static const char __pyx_k_compressed[] = "compressed";
static const char __pyx_k_conforming[] = "conforming";
static const char __pyx_k_continuous[] = "continuous";
static const char __pyx_k_createVecs[] = "createVecs";
static const char __pyx_k_cudahandle[] = "cudahandle";
static const char __pyx_k_cycle_type[] = "cycle_type";
static const char __pyx_k_down_right[] = "down_right";
static const char __pyx_k_empty_name[] = "empty name";
static const char __pyx_k_errhandler[] = "errhandler";
static const char __pyx_k_fieldnames[] = "fieldnames";
static const char __pyx_k_fill_param[] = "fill_param";
static const char __pyx_k_formDegree[] = "formDegree";
static const char __pyx_k_front_down[] = "front_down";
static const char __pyx_k_front_left[] = "front_left";
static const char __pyx_k_functional[] = "functional";
static const char __pyx_k_getCPUTime[] = "getCPUTime";
static const char __pyx_k_getClassId[] = "getClassId";
static const char __pyx_k_getCorners[] = "getCorners";
static const char __pyx_k_getCurrent[] = "getCurrent";
static const char __pyx_k_getIndices[] = "getIndices";
static const char __pyx_k_getMaxTime[] = "getMaxTime";
static const char __pyx_k_getSection[] = "getSection";
static const char __pyx_k_getStencil[] = "getStencil";
static const char __pyx_k_getVecLeft[] = "getVecLeft";
static const char __pyx_k_getVersion[] = "getVersion";
static const char __pyx_k_getVisible[] = "getVisible";
static const char __pyx_k_initialize[] = "_initialize";
static const char __pyx_k_isIdentity[] = "isIdentity";
static const char __pyx_k_layoutType[] = "layoutType";
static const char __pyx_k_leafupdate[] = "leafupdate";
static const char __pyx_k_lgmap_type[] = "lgmap_type";
static const char __pyx_k_linear_its[] = "linear_its";
static const char __pyx_k_mpi4py_MPI[] = "mpi4py.MPI";
static const char __pyx_k_numBatches[] = "numBatches";
static const char __pyx_k_proc_sizes[] = "proc_sizes";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_reciprocal[] = "reciprocal";
static const char __pyx_k_setCurrent[] = "setCurrent";
static const char __pyx_k_setInitial[] = "setInitial";
static const char __pyx_k_setMaxTime[] = "setMaxTime";
static const char __pyx_k_setMonitor[] = "setMonitor";
static const char __pyx_k_setSection[] = "setSection";
static const char __pyx_k_setVisible[] = "setVisible";
static const char __pyx_k_shift_type[] = "shift_type";
static const char __pyx_k_space_type[] = "space_type";
static const char __pyx_k_startswith[] = "startswith";
static const char __pyx_k_useAnchors[] = "useAnchors";
static const char __pyx_k_useClosure[] = "useClosure";
static const char __pyx_k_AGGERGATION[] = "AGGERGATION";
static const char __pyx_k_AIJCUSPARSE[] = "AIJCUSPARSE";
static const char __pyx_k_AIJVIENNACL[] = "AIJVIENNACL";
static const char __pyx_k_APPLY_LOWER[] = "APPLY_LOWER";
static const char __pyx_k_APPLY_UPPER[] = "APPLY_UPPER";
static const char __pyx_k_ARKIMEX1BEE[] = "ARKIMEX1BEE";
static const char __pyx_k_ARKIMEXBPR3[] = "ARKIMEXBPR3";
static const char __pyx_k_ARKIMEXType[] = "ARKIMEXType";
static const char __pyx_k_ASCII_DENSE[] = "ASCII_DENSE";
static const char __pyx_k_ASCII_GLVIS[] = "ASCII_GLVIS";
static const char __pyx_k_ASCII_INDEX[] = "ASCII_INDEX";
static const char __pyx_k_ASCII_LATEX[] = "ASCII_LATEX";
static const char __pyx_k_ASCII_PCICE[] = "ASCII_PCICE";
static const char __pyx_k_COPY_VALUES[] = "COPY_VALUES";
static const char __pyx_k_CollectType[] = "CollectType";
static const char __pyx_k_ComplexType[] = "ComplexType";
static const char __pyx_k_DMComposite[] = "DMComposite";
static const char __pyx_k_DMSwarmType[] = "DMSwarmType";
static const char __pyx_k_ElementType[] = "ElementType";
static const char __pyx_k_Error___str[] = "Error.__str__";
static const char __pyx_k_FRONT_RIGHT[] = "FRONT_RIGHT";
static const char __pyx_k_HYPRESTRUCT[] = "HYPRESTRUCT";
static const char __pyx_k_INTERPOLATE[] = "INTERPOLATE";
static const char __pyx_k_KSPNormType[] = "KSPNormType";
static const char __pyx_k_LMVMBROYDEN[] = "LMVMBROYDEN";
static const char __pyx_k_MATHEMATICA[] = "MATHEMATICA";
static const char __pyx_k_MGCycleType[] = "MGCycleType";
static const char __pyx_k_MKL_PARDISO[] = "MKL_PARDISO";
static const char __pyx_k_MPIVIENNACL[] = "MPIVIENNACL";
static const char __pyx_k_MatInfoType[] = "MatInfoType";
static const char __pyx_k_Mat_Stencil[] = "_Mat_Stencil";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_MigrateType[] = "MigrateType";
static const char __pyx_k_NORM_ALWAYS[] = "NORM_ALWAYS";
static const char __pyx_k_NRICHARDSON[] = "NRICHARDSON";
static const char __pyx_k_Partitioner[] = "Partitioner";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_ProblemType[] = "ProblemType";
static const char __pyx_k_REFINETOBOX[] = "REFINETOBOX";
static const char __pyx_k_RUNGE_KUTTA[] = "RUNGE_KUTTA";
static const char __pyx_k_SEQVIENNACL[] = "SEQVIENNACL";
static const char __pyx_k_SETUP_ERROR[] = "SETUP_ERROR";
static const char __pyx_k_SORTED_FULL[] = "SORTED_FULL";
static const char __pyx_k_SUBPC_ERROR[] = "SUBPC_ERROR";
static const char __pyx_k_ScatterMode[] = "ScatterMode";
static const char __pyx_k_ScatterType[] = "ScatterType";
static const char __pyx_k_StencilType[] = "StencilType";
static const char __pyx_k_SystemError[] = "SystemError";
static const char __pyx_k_TETRAHEDRON[] = "TETRAHEDRON";
static const char __pyx_k_UNSPECIFIED[] = "UNSPECIFIED";
static const char __pyx_k_assemblyEnd[] = "assemblyEnd";
static const char __pyx_k_begin_kargs[] = "begin_kargs";
static const char __pyx_k_coarsenhook[] = "coarsenhook";
static const char __pyx_k_concatenate[] = "concatenate";
static const char __pyx_k_constraints[] = "constraints";
static const char __pyx_k_coordinates[] = "coordinates";
static const char __pyx_k_createLabel[] = "createLabel";
static const char __pyx_k_create_gvec[] = "create_gvec";
static const char __pyx_k_create_lvec[] = "create_lvec";
static const char __pyx_k_determinant[] = "determinant";
static const char __pyx_k_device_type[] = "device_type";
static const char __pyx_k_entityDepth[] = "entityDepth";
static const char __pyx_k_front_right[] = "front_right";
static const char __pyx_k_getDeviceId[] = "getDeviceId";
static const char __pyx_k_getDiagonal[] = "getDiagonal";
static const char __pyx_k_getGradient[] = "getGradient";
static const char __pyx_k_getInterval[] = "getInterval";
static const char __pyx_k_getMaxSteps[] = "getMaxSteps";
static const char __pyx_k_getNormType[] = "getNormType";
static const char __pyx_k_getNumberDM[] = "getNumberDM";
static const char __pyx_k_getRefCount[] = "getRefCount";
static const char __pyx_k_getSolution[] = "getSolution";
static const char __pyx_k_getTimeStep[] = "getTimeStep";
static const char __pyx_k_getVecRight[] = "getVecRight";
static const char __pyx_k_hasLagrange[] = "hasLagrange";
static const char __pyx_k_interp_type[] = "interp_type";
static const char __pyx_k_interpolate[] = "interpolate";
static const char __pyx_k_isAssembled[] = "isAssembled";
static const char __pyx_k_isFinalized[] = "isFinalized";
static const char __pyx_k_isHermitian[] = "isHermitian";
static const char __pyx_k_isSymmetric[] = "isSymmetric";
static const char __pyx_k_leafSection[] = "leafSection";
static const char __pyx_k_numMessages[] = "numMessages";
static const char __pyx_k_nz_unneeded[] = "nz_unneeded";
static const char __pyx_k_orientation[] = "orientation";
static const char __pyx_k_permutation[] = "permutation";
static const char __pyx_k_py_sub_ctxs[] = "py_sub_ctxs";
static const char __pyx_k_rootSection[] = "rootSection";
static const char __pyx_k_setDiagonal[] = "setDiagonal";
static const char __pyx_k_setInterval[] = "setInterval";
static const char __pyx_k_setMaxSteps[] = "setMaxSteps";
static const char __pyx_k_setNormType[] = "setNormType";
static const char __pyx_k_setParamsEW[] = "setParamsEW";
static const char __pyx_k_setSolution[] = "setSolution";
static const char __pyx_k_setTimeStep[] = "setTimeStep";
static const char __pyx_k_shiftamount[] = "shiftamount";
static const char __pyx_k_stenciltype[] = "stenciltype";
static const char __pyx_k_step_number[] = "step_number";
static const char __pyx_k_stream_type[] = "stream_type";
static const char __pyx_k_traceback_2[] = "traceback";
static const char __pyx_k_zeroEntries[] = "zeroEntries";
static const char __pyx_k_ASCII_COMMON[] = "ASCII_COMMON";
static const char __pyx_k_ASCII_MATLAB[] = "ASCII_MATLAB";
static const char __pyx_k_ASCII_PYTHON[] = "ASCII_PYTHON";
static const char __pyx_k_AssemblyType[] = "AssemblyType";
static const char __pyx_k_BACK_UP_LEFT[] = "BACK_UP_LEFT";
static const char __pyx_k_BoundaryType[] = "BoundaryType";
static const char __pyx_k_COLLECT_USER[] = "COLLECT_USER";
static const char __pyx_k_DIFFERENT_NZ[] = "DIFFERENT_NZ";
static const char __pyx_k_DIVERGED_NAN[] = "DIVERGED_NAN";
static const char __pyx_k_DRAW_CONTOUR[] = "DRAW_CONTOUR";
static const char __pyx_k_EquationType[] = "EquationType";
static const char __pyx_k_Error___init[] = "Error.__init__";
static const char __pyx_k_Error___repr[] = "Error.__repr__";
static const char __pyx_k_FACTOR_OTHER[] = "FACTOR_OTHER";
static const char __pyx_k_FailedReason[] = "FailedReason";
static const char __pyx_k_HYPRESSTRUCT[] = "HYPRESSTRUCT";
static const char __pyx_k_INITIAL_ONLY[] = "INITIAL_ONLY";
static const char __pyx_k_LAYOUT_GAUSS[] = "LAYOUT_GAUSS";
static const char __pyx_k_LOAD_BALANCE[] = "LOAD_BALANCE";
static const char __pyx_k_MIGRATE_USER[] = "MIGRATE_USER";
static const char __pyx_k_MKL_CPARDISO[] = "MKL_CPARDISO";
static const char __pyx_k_MPIDENSECUDA[] = "MPIDENSECUDA";
static const char __pyx_k_MatStructure[] = "MatStructure";
static const char __pyx_k_NORM_1_AND_2[] = "NORM_1_AND_2";
static const char __pyx_k_NORM_DEFAULT[] = "NORM_DEFAULT";
static const char __pyx_k_NORM_NATURAL[] = "NORM_NATURAL";
static const char __pyx_k_NormSchedule[] = "NormSchedule";
static const char __pyx_k_Not_for_type[] = "Not for type {}";
static const char __pyx_k_ODE_EXPLICIT[] = "ODE_EXPLICIT";
static const char __pyx_k_ODE_IMPLICIT[] = "ODE_IMPLICIT";
static const char __pyx_k_OrderingType[] = "OrderingType";
static const char __pyx_k_PREALLOCATOR[] = "PREALLOCATOR";
static const char __pyx_k_PolytopeType[] = "PolytopeType";
static const char __pyx_k_QUARTER_SIZE[] = "QUARTER_SIZE";
static const char __pyx_k_REDISTRIBUTE[] = "REDISTRIBUTE";
static const char __pyx_k_REFINEALFELD[] = "REFINEALFELD";
static const char __pyx_k_ROW_ORIENTED[] = "ROW_ORIENTED";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_SEQDENSECUDA[] = "SEQDENSECUDA";
static const char __pyx_k_SUPERLU_DIST[] = "SUPERLU_DIST";
static const char __pyx_k_SchurPreType[] = "SchurPreType";
static const char __pyx_k_VINEWTONRSLS[] = "VINEWTONRSLS";
static const char __pyx_k_VINEWTONSSLS[] = "VINEWTONSSLS";
static const char __pyx_k_ViewerFormat[] = "ViewerFormat";
static const char __pyx_k_back_up_left[] = "back_up_left";
static const char __pyx_k_cdevice_type[] = "cdevice_type";
static const char __pyx_k_cellNodeMaps[] = "cellNodeMaps";
static const char __pyx_k_createMatrix[] = "createMatrix";
static const char __pyx_k_create_subdm[] = "create_subdm";
static const char __pyx_k_dmswarm_type[] = "dmswarm_type";
static const char __pyx_k_error_code_d[] = "error code %d";
static const char __pyx_k_evaluatestep[] = "evaluatestep";
static const char __pyx_k_eventhandler[] = "eventhandler";
static const char __pyx_k_garbage_view[] = "garbage_view";
static const char __pyx_k_getActiveAll[] = "getActiveAll";
static const char __pyx_k_getBlockInfo[] = "getBlockInfo";
static const char __pyx_k_getBlockSize[] = "getBlockSize";
static const char __pyx_k_getClassName[] = "getClassName";
static const char __pyx_k_getDefaultSF[] = "getDefaultSF";
static const char __pyx_k_getDimension[] = "getDimension";
static const char __pyx_k_getLocalSize[] = "getLocalSize";
static const char __pyx_k_getOperators[] = "getOperators";
static const char __pyx_k_getProcSizes[] = "getProcSizes";
static const char __pyx_k_getSectionSF[] = "getSectionSF";
static const char __pyx_k_ghostBcNodes[] = "ghostBcNodes";
static const char __pyx_k_initialguess[] = "initialguess";
static const char __pyx_k_numSumSpaces[] = "numSumSpaces";
static const char __pyx_k_nz_allocated[] = "nz_allocated";
static const char __pyx_k_partitioning[] = "partitioning";
static const char __pyx_k_pre_finalize[] = "_pre_finalize";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_restricthook[] = "restricthook";
static const char __pyx_k_rhsjacobianp[] = "rhsjacobianp";
static const char __pyx_k_scatter_type[] = "scatter_type";
static const char __pyx_k_setActiveAll[] = "setActiveAll";
static const char __pyx_k_setDefaultSF[] = "setDefaultSF";
static const char __pyx_k_setDimension[] = "setDimension";
static const char __pyx_k_setSectionSF[] = "setSectionSF";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_stencil_type[] = "stencil_type";
static const char __pyx_k_stringsource[] = "stringsource";
static const char __pyx_k_wrapped_func[] = "wrapped_func";
static const char __pyx_k_ADD_BC_VALUES[] = "ADD_BC_VALUES";
static const char __pyx_k_APPEND_UPDATE[] = "APPEND_UPDATE";
static const char __pyx_k_ARKIMEXARS122[] = "ARKIMEXARS122";
static const char __pyx_k_ARKIMEXARS443[] = "ARKIMEXARS443";
static const char __pyx_k_ARKIMEXPRSSP2[] = "ARKIMEXPRSSP2";
static const char __pyx_k_ASCII_SYMMODU[] = "ASCII_SYMMODU";
static const char __pyx_k_BACK_UP_RIGHT[] = "BACK_UP_RIGHT";
static const char __pyx_k_BINARY_MATLAB[] = "BINARY_MATLAB";
static const char __pyx_k_COLLECT_BASIC[] = "COLLECT_BASIC";
static const char __pyx_k_CONVERGED_ITS[] = "CONVERGED_ITS";
static const char __pyx_k_CompositeType[] = "CompositeType";
static const char __pyx_k_DIVERGED_DTOL[] = "DIVERGED_DTOL";
static const char __pyx_k_DIVERGED_NULL[] = "DIVERGED_NULL";
static const char __pyx_k_DIVERGED_USER[] = "DIVERGED_USER";
static const char __pyx_k_DeviceContext[] = "DeviceContext";
static const char __pyx_k_DualSpaceType[] = "DualSpaceType";
static const char __pyx_k_FORWARD_LOCAL[] = "FORWARD_LOCAL";
static const char __pyx_k_FORWARD_SWEEP[] = "FORWARD_SWEEP";
static const char __pyx_k_FRONT_UP_LEFT[] = "FRONT_UP_LEFT";
static const char __pyx_k_INSERT_VALUES[] = "INSERT_VALUES";
static const char __pyx_k_MIGRATE_BASIC[] = "MIGRATE_BASIC";
static const char __pyx_k_MatSolverType[] = "MatSolverType";
static const char __pyx_k_NORM_INFINITY[] = "NORM_INFINITY";
static const char __pyx_k_PCMGCycleType[] = "PCMGCycleType";
static const char __pyx_k_PETSc_Error_d[] = "PETSc.Error(%d)";
static const char __pyx_k_PICLayoutType[] = "PICLayoutType";
static const char __pyx_k_QUADRILATERAL[] = "QUADRILATERAL";
static const char __pyx_k_REFINEREGULAR[] = "REFINEREGULAR";
static const char __pyx_k_REVERSE_LOCAL[] = "REVERSE_LOCAL";
static const char __pyx_k_SchurFactType[] = "SchurFactType";
static const char __pyx_k_TSARKIMEXType[] = "TSARKIMEXType";
static const char __pyx_k_TSProblemType[] = "TSProblemType";
static const char __pyx_k_Vec_LocalForm[] = "_Vec_LocalForm";
static const char __pyx_k_adjoint_steps[] = "adjoint_steps";
static const char __pyx_k_assemblyBegin[] = "assemblyBegin";
static const char __pyx_k_back_up_right[] = "back_up_right";
static const char __pyx_k_boundary_type[] = "boundary_type";
static const char __pyx_k_buildResidual[] = "buildResidual";
static const char __pyx_k_buildSolution[] = "buildSolution";
static const char __pyx_k_cancelMonitor[] = "cancelMonitor";
static const char __pyx_k_createVecLeft[] = "createVecLeft";
static const char __pyx_k_create_matrix[] = "create_matrix";
static const char __pyx_k_diagonalScale[] = "diagonalScale";
static const char __pyx_k_diagonal_fill[] = "diagonal_fill";
static const char __pyx_k_front_up_left[] = "front_up_left";
static const char __pyx_k_getBlockSizes[] = "getBlockSizes";
static const char __pyx_k_getDeviceType[] = "getDeviceType";
static const char __pyx_k_getLocalSizes[] = "getLocalSizes";
static const char __pyx_k_getStepNumber[] = "getStepNumber";
static const char __pyx_k_getStreamType[] = "getStreamType";
static const char __pyx_k_getTolerances[] = "getTolerances";
static const char __pyx_k_globalBcNodes[] = "globalBcNodes";
static const char __pyx_k_isInitialized[] = "isInitialized";
static const char __pyx_k_isPermutation[] = "isPermutation";
static const char __pyx_k_messageLength[] = "messageLength";
static const char __pyx_k_monitorCancel[] = "monitorCancel";
static const char __pyx_k_multHermitian[] = "multHermitian";
static const char __pyx_k_multTranspose[] = "multTranspose";
static const char __pyx_k_multirootdata[] = "multirootdata";
static const char __pyx_k_numReductions[] = "numReductions";
static const char __pyx_k_numTensSpaces[] = "numTensSpaces";
static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_remoteOffsets[] = "remoteOffsets";
static const char __pyx_k_restrictSizes[] = "restrictSizes";
static const char __pyx_k_setStepNumber[] = "setStepNumber";
static const char __pyx_k_setStreamType[] = "setStreamType";
static const char __pyx_k_setTolerances[] = "setTolerances";
static const char __pyx_k_stencil_width[] = "stencil_width";
static const char __pyx_k_stepTranspose[] = "stepTranspose";
static const char __pyx_k_type_registry[] = "__type_registry__";
static const char __pyx_k_ADD_ALL_VALUES[] = "ADD_ALL_VALUES";
static const char __pyx_k_ASCII_VTK_CELL[] = "ASCII_VTK_CELL";
static const char __pyx_k_AttributeError[] = "AttributeError";
static const char __pyx_k_BACKWARD_SWEEP[] = "BACKWARD_SWEEP";
static const char __pyx_k_BACK_DOWN_LEFT[] = "BACK_DOWN_LEFT";
static const char __pyx_k_CONVERGED_ATOL[] = "CONVERGED_ATOL";
static const char __pyx_k_CONVERGED_MINF[] = "CONVERGED_MINF";
static const char __pyx_k_CONVERGED_RTOL[] = "CONVERGED_RTOL";
static const char __pyx_k_CONVERGED_TIME[] = "CONVERGED_TIME";
static const char __pyx_k_CONVERGED_USER[] = "CONVERGED_USER";
static const char __pyx_k_CRANK_NICOLSON[] = "CRANK_NICOLSON";
static const char __pyx_k_DIVERGED_INNER[] = "DIVERGED_INNER";
static const char __pyx_k_DMBoundaryType[] = "DMBoundaryType";
static const char __pyx_k_DMDA_Vec_array[] = "_DMDA_Vec_array";
static const char __pyx_k_DMPolytopeType[] = "DMPolytopeType";
static const char __pyx_k_DRAW_LG_XRANGE[] = "DRAW_LG_XRANGE";
static const char __pyx_k_DeviceJoinMode[] = "DeviceJoinMode";
static const char __pyx_k_EventDecorator[] = "EventDecorator";
static const char __pyx_k_ExactFinalTime[] = "ExactFinalTime";
static const char __pyx_k_FINAL_ASSEMBLY[] = "FINAL_ASSEMBLY";
static const char __pyx_k_FLUSH_ASSEMBLY[] = "FLUSH_ASSEMBLY";
static const char __pyx_k_FRONT_UP_RIGHT[] = "FRONT_UP_RIGHT";
static const char __pyx_k_INTERIOR_GHOST[] = "INTERIOR_GHOST";
static const char __pyx_k_LAYOUT_REGULAR[] = "LAYOUT_REGULAR";
static const char __pyx_k_LMVMBADBROYDEN[] = "LMVMBADBROYDEN";
static const char __pyx_k_LMVMSYMBROYDEN[] = "LMVMSYMBROYDEN";
static const char __pyx_k_MEMORYSCALABLE[] = "MEMORYSCALABLE";
static const char __pyx_k_MPIAIJCUSPARSE[] = "MPIAIJCUSPARSE";
static const char __pyx_k_MPIAIJVIENNACL[] = "MPIAIJVIENNACL";
static const char __pyx_k_MULTIPLICATIVE[] = "MULTIPLICATIVE";
static const char __pyx_k_NORM_FROBENIUS[] = "NORM_FROBENIUS";
static const char __pyx_k_NOT_SET_VALUES[] = "NOT_SET_VALUES";
static const char __pyx_k_NotImplemented[] = "NotImplemented";
static const char __pyx_k_PCFailedReason[] = "PCFailedReason";
static const char __pyx_k_PRECONDITIONED[] = "PRECONDITIONED";
static const char __pyx_k_SEQAIJCUSPARSE[] = "SEQAIJCUSPARSE";
static const char __pyx_k_SEQAIJVIENNACL[] = "SEQAIJVIENNACL";
static const char __pyx_k_STRUCTURE_ONLY[] = "STRUCTURE_ONLY";
static const char __pyx_k_SYMMETRY_SWEEP[] = "SYMMETRY_SWEEP";
static const char __pyx_k_TSEquationType[] = "TSEquationType";
static const char __pyx_k_USE_HASH_TABLE[] = "USE_HASH_TABLE";
static const char __pyx_k_applyTranspose[] = "applyTranspose";
static const char __pyx_k_back_down_left[] = "back_down_left";
static const char __pyx_k_boundary_types[] = "boundary_types";
static const char __pyx_k_createLocalVec[] = "createLocalVec";
static const char __pyx_k_createVecRight[] = "createVecRight";
static const char __pyx_k_dualspace_type[] = "dualspace_type";
static const char __pyx_k_empty_citation[] = "empty citation";
static const char __pyx_k_factor_mallocs[] = "factor_mallocs";
static const char __pyx_k_front_up_right[] = "front_up_right";
static const char __pyx_k_getDefaultComm[] = "getDefaultComm";
static const char __pyx_k_getGhostRanges[] = "getGhostRanges";
static const char __pyx_k_getGlobalSizes[] = "getGlobalSizes";
static const char __pyx_k_getKSPFailures[] = "getKSPFailures";
static const char __pyx_k_getProblemType[] = "getProblemType";
static const char __pyx_k_getStencilType[] = "getStencilType";
static const char __pyx_k_getVersionInfo[] = "getVersionInfo";
static const char __pyx_k_jacobian_state[] = "jacobian_state";
static const char __pyx_k_petsc4py_PETSc[] = "petsc4py.PETSc";
static const char __pyx_k_productNumeric[] = "productNumeric";
static const char __pyx_k_setDefaultComm[] = "setDefaultComm";
static const char __pyx_k_setDefaultType[] = "setDefaultType";
static const char __pyx_k_setFromOptions[] = "setFromOptions";
static const char __pyx_k_setProblemType[] = "setProblemType";
static const char __pyx_k_solveTranspose[] = "solveTranspose";
static const char __pyx_k_splitOwnership[] = "splitOwnership";
static const char __pyx_k_staticproperty[] = "staticproperty";
static const char __pyx_k_BACK_DOWN_RIGHT[] = "BACK_DOWN_RIGHT";
static const char __pyx_k_BASICSYMPLECTIC[] = "BASICSYMPLECTIC";
static const char __pyx_k_CHOWILUVIENNACL[] = "CHOWILUVIENNACL";
static const char __pyx_k_COLLECT_GENERAL[] = "COLLECT_GENERAL";
static const char __pyx_k_CONVERGED_EVENT[] = "CONVERGED_EVENT";
static const char __pyx_k_CONVERGED_GATOL[] = "CONVERGED_GATOL";
static const char __pyx_k_CONVERGED_GRTOL[] = "CONVERGED_GRTOL";
static const char __pyx_k_CONVERGED_GTTOL[] = "CONVERGED_GTTOL";
static const char __pyx_k_ConvergedReason[] = "ConvergedReason";
static const char __pyx_k_DIVERGED_MAXFCN[] = "DIVERGED_MAXFCN";
static const char __pyx_k_DIVERGED_MAXITS[] = "DIVERGED_MAXITS";
static const char __pyx_k_DIVERGED_MAX_IT[] = "DIVERGED_MAX_IT";
static const char __pyx_k_DMDAElementType[] = "DMDAElementType";
static const char __pyx_k_DMDAStencilType[] = "DMDAStencilType";
static const char __pyx_k_DMInterpolation[] = "DMInterpolation";
static const char __pyx_k_DMPlexTransform[] = "DMPlexTransform";
static const char __pyx_k_DuplicateOption[] = "DuplicateOption";
static const char __pyx_k_Error___nonzero[] = "Error.__nonzero__";
static const char __pyx_k_FRONT_DOWN_LEFT[] = "FRONT_DOWN_LEFT";
static const char __pyx_k_FactorShiftType[] = "FactorShiftType";
static const char __pyx_k_GLOBAL_BLOCKING[] = "GLOBAL_BLOCKING";
static const char __pyx_k_MATPARTITIONING[] = "MATPARTITIONING";
static const char __pyx_k_MatAssemblyType[] = "MatAssemblyType";
static const char __pyx_k_MatOrderingType[] = "MatOrderingType";
static const char __pyx_k_MatPartitioning[] = "MatPartitioning";
static const char __pyx_k_NORMALHERMITIAN[] = "NORMALHERMITIAN";
static const char __pyx_k_NORM_FINAL_ONLY[] = "NORM_FINAL_ONLY";
static const char __pyx_k_PCCompositeType[] = "PCCompositeType";
static const char __pyx_k_PartitionerType[] = "PartitionerType";
static const char __pyx_k_REFINETOSIMPLEX[] = "REFINETOSIMPLEX";
static const char __pyx_k_SCATTER_FORWARD[] = "SCATTER_FORWARD";
static const char __pyx_k_SCATTER_REVERSE[] = "SCATTER_REVERSE";
static const char __pyx_k_SCHURCOMPLEMENT[] = "SCHURCOMPLEMENT";
static const char __pyx_k_SPARSEELEMENTAL[] = "SPARSEELEMENTAL";
static const char __pyx_k_SUBMAT_SINGLEIS[] = "SUBMAT_SINGLEIS";
static const char __pyx_k_StencilLocation[] = "StencilLocation";
static const char __pyx_k_TRANSFORMFILTER[] = "TRANSFORMFILTER";
static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
static const char __pyx_k_array_interface[] = "__array_interface__";
static const char __pyx_k_back_down_right[] = "back_down_right";
static const char __pyx_k_coneOrientation[] = "coneOrientation";
static const char __pyx_k_correction_type[] = "correction_type";
static const char __pyx_k_createDefaultSF[] = "createDefaultSF";
static const char __pyx_k_createGlobalVec[] = "createGlobalVec";
static const char __pyx_k_createSectionSF[] = "createSectionSF";
static const char __pyx_k_createSubMatrix[] = "createSubMatrix";
static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
static const char __pyx_k_front_down_left[] = "front_down_left";
static const char __pyx_k_garbage_cleanup[] = "garbage_cleanup";
static const char __pyx_k_getBlockIndices[] = "getBlockIndices";
static const char __pyx_k_getBoundaryType[] = "getBoundaryType";
static const char __pyx_k_getEquationType[] = "getEquationType";
static const char __pyx_k_getFunctionNorm[] = "getFunctionNorm";
static const char __pyx_k_getGhostCorners[] = "getGhostCorners";
static const char __pyx_k_getLocalSection[] = "getLocalSection";
static const char __pyx_k_getResidualNorm[] = "getResidualNorm";
static const char __pyx_k_getSolutionNorm[] = "getSolutionNorm";
static const char __pyx_k_getStencilWidth[] = "getStencilWidth";
static const char __pyx_k_getStepFailures[] = "getStepFailures";
static const char __pyx_k_jacobian_design[] = "jacobian_design";
static const char __pyx_k_missingDiagonal[] = "missingDiagonal";
static const char __pyx_k_popErrorHandler[] = "popErrorHandler";
static const char __pyx_k_prefix_s_name_s[] = "(prefix:%s, name:%s)";
static const char __pyx_k_productSymbolic[] = "productSymbolic";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_redundantPoints[] = "redundantPoints";
static const char __pyx_k_refinementLimit[] = "refinementLimit";
static const char __pyx_k_setEquationType[] = "setEquationType";
static const char __pyx_k_setFunctionNorm[] = "setFunctionNorm";
static const char __pyx_k_setLocalSection[] = "setLocalSection";
static const char __pyx_k_setResidualNorm[] = "setResidualNorm";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_subspaceOffsets[] = "subspaceOffsets";
static const char __pyx_k_useInitialGuess[] = "useInitialGuess";
static const char __pyx_k_zeroRowsColumns[] = "zeroRowsColumns";
static const char __pyx_k_ASCII_VTK_COORDS[] = "ASCII_VTK_COORDS";
static const char __pyx_k_CONSTANTDIAGONAL[] = "CONSTANTDIAGONAL";
static const char __pyx_k_DEFAULT_BLOCKING[] = "DEFAULT_BLOCKING";
static const char __pyx_k_FACTOR_OUTMEMORY[] = "FACTOR_OUTMEMORY";
static const char __pyx_k_FRONT_DOWN_RIGHT[] = "FRONT_DOWN_RIGHT";
static const char __pyx_k_INSERT_BC_VALUES[] = "INSERT_BC_VALUES";
static const char __pyx_k_KSPTRANSPOSEONLY[] = "KSPTRANSPOSEONLY";
static const char __pyx_k_LMVMDIAGBBROYDEN[] = "LMVMDIAGBBROYDEN";
static const char __pyx_k_SEG_PRISM_TENSOR[] = "SEG_PRISM_TENSOR";
static const char __pyx_k_SNESNormSchedule[] = "SNESNormSchedule";
static const char __pyx_k_SYMMETRY_ETERNAL[] = "SYMMETRY_ETERNAL";
static const char __pyx_k_TAO_Solver_Types[] = "\n TAO Solver Types\n ";
static const char __pyx_k_TRI_PRISM_TENSOR[] = "TRI_PRISM_TENSOR";
static const char __pyx_k_TSExactFinalTime[] = "TSExactFinalTime";
static const char __pyx_k_UNPRECONDITIONED[] = "UNPRECONDITIONED";
static const char __pyx_k_createNaturalVec[] = "createNaturalVec";
static const char __pyx_k_create_injection[] = "create_injection";
static const char __pyx_k_fill_ratio_given[] = "fill_ratio_given";
static const char __pyx_k_formSNESFunction[] = "formSNESFunction";
static const char __pyx_k_formSNESJacobian[] = "formSNESJacobian";
static const char __pyx_k_front_down_right[] = "front_down_right";
static const char __pyx_k_getBoundaryTypes[] = "getBoundaryTypes";
static const char __pyx_k_getDiagonalBlock[] = "getDiagonalBlock";
static const char __pyx_k_getFunctionValue[] = "getFunctionValue";
static const char __pyx_k_getGlobalSection[] = "getGlobalSection";
static const char __pyx_k_getOptionsPrefix[] = "getOptionsPrefix";
static const char __pyx_k_multHermitianAdd[] = "multHermitianAdd";
static const char __pyx_k_multTransposeAdd[] = "multTransposeAdd";
static const char __pyx_k_ownership_ranges[] = "ownership_ranges";
static const char __pyx_k_popSignalHandler[] = "popSignalHandler";
static const char __pyx_k_pushErrorHandler[] = "pushErrorHandler";
static const char __pyx_k_registerCitation[] = "registerCitation";
static const char __pyx_k_setGlobalSection[] = "setGlobalSection";
static const char __pyx_k_setOptionsPrefix[] = "setOptionsPrefix";
static const char __pyx_k_stdout_is_stderr[] = "_stdout_is_stderr";
static const char __pyx_k_targetComplexity[] = "targetComplexity";
static const char __pyx_k_ASCII_FACTOR_INFO[] = "ASCII_FACTOR_INFO";
static const char __pyx_k_ASCII_INFO_DETAIL[] = "ASCII_INFO_DETAIL";
static const char __pyx_k_ASCII_MATHEMATICA[] = "ASCII_MATHEMATICA";
static const char __pyx_k_CONVERGED_STEPTOL[] = "CONVERGED_STEPTOL";
static const char __pyx_k_DIVERGED_NANORINF[] = "DIVERGED_NANORINF";
static const char __pyx_k_DIVERGED_TR_DELTA[] = "DIVERGED_TR_DELTA";
static const char __pyx_k_DMStagStencilType[] = "DMStagStencilType";
static const char __pyx_k_INSERT_ALL_VALUES[] = "INSERT_ALL_VALUES";
static const char __pyx_k_InterpolationType[] = "InterpolationType";
static const char __pyx_k_LMVMSYMBADBROYDEN[] = "LMVMSYMBADBROYDEN";
static const char __pyx_k_NORM_INITIAL_ONLY[] = "NORM_INITIAL_ONLY";
static const char __pyx_k_PARTITIONINGCHACO[] = "PARTITIONINGCHACO";
static const char __pyx_k_PARTITIONINGPARTY[] = "PARTITIONINGPARTY";
static const char __pyx_k_POSITIVE_DEFINITE[] = "POSITIVE_DEFINITE";
static const char __pyx_k_QUAD_PRISM_TENSOR[] = "QUAD_PRISM_TENSOR";
static const char __pyx_k_REFINEPOWELLSABIN[] = "REFINEPOWELLSABIN";
static const char __pyx_k_TSConvergedReason[] = "TSConvergedReason";
static const char __pyx_k_createLocalVector[] = "createLocalVector";
static const char __pyx_k_fill_ratio_needed[] = "fill_ratio_needed";
static const char __pyx_k_getDefaultSection[] = "getDefaultSection";
static const char __pyx_k_getMaxKSPFailures[] = "getMaxKSPFailures";
static const char __pyx_k_getObjectiveValue[] = "getObjectiveValue";
static const char __pyx_k_getOwnershipRange[] = "getOwnershipRange";
static const char __pyx_k_getSolutionUpdate[] = "getSolutionUpdate";
static const char __pyx_k_jacobian_equality[] = "jacobian_equality";
static const char __pyx_k_multDiagonalBlock[] = "multDiagonalBlock";
static const char __pyx_k_null_communicator[] = "null communicator";
static const char __pyx_k_positive_definite[] = "positive_definite";
static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
static const char __pyx_k_refinementUniform[] = "refinementUniform";
static const char __pyx_k_setDefaultSection[] = "setDefaultSection";
static const char __pyx_k_setMaxKSPFailures[] = "setMaxKSPFailures";
static const char __pyx_k_solveTransposeAdd[] = "solveTransposeAdd";
static const char __pyx_k_unknown_options_s[] = "unknown options: %s";
static const char __pyx_k_viennaclvechandle[] = "viennaclvechandle";
static const char __pyx_k_ASCII_MATRIXMARKET[] = "ASCII_MATRIXMARKET";
static const char __pyx_k_CONTINUE_ITERATING[] = "CONTINUE_ITERATING";
static const char __pyx_k_DIVERGED_BREAKDOWN[] = "DIVERGED_BREAKDOWN";
static const char __pyx_k_DIVERGED_FNORM_NAN[] = "DIVERGED_FNORM_NAN";
static const char __pyx_k_DIVERGED_LOCAL_MIN[] = "DIVERGED_LOCAL_MIN";
static const char __pyx_k_DMComposite_access[] = "_DMComposite_access";
static const char __pyx_k_DMSwarmCollectType[] = "DMSwarmCollectType";
static const char __pyx_k_DMSwarmMigrateType[] = "DMSwarmMigrateType";
static const char __pyx_k_DO_NOT_COPY_VALUES[] = "DO_NOT_COPY_VALUES";
static const char __pyx_k_DeflationSpaceType[] = "DeflationSpaceType";
static const char __pyx_k_GLOBAL_NONBLOCKING[] = "GLOBAL_NONBLOCKING";
static const char __pyx_k_HERMITIANTRANSPOSE[] = "HERMITIANTRANSPOSE";
static const char __pyx_k_INITIAL_FINAL_ONLY[] = "INITIAL_FINAL_ONLY";
static const char __pyx_k_KSPConvergedReason[] = "KSPConvergedReason";
static const char __pyx_k_LAYOUT_SUBDIVISION[] = "LAYOUT_SUBDIVISION";
static const char __pyx_k_MatDuplicateOption[] = "MatDuplicateOption";
static const char __pyx_k_MatFactorShiftType[] = "MatFactorShiftType";
static const char __pyx_k_PARTITIONINGSQUARE[] = "PARTITIONINGSQUARE";
static const char __pyx_k_POINT_PRISM_TENSOR[] = "POINT_PRISM_TENSOR";
static const char __pyx_k_PatchConstructType[] = "PatchConstructType";
static const char __pyx_k_ROWSCALINGVIENNACL[] = "ROWSCALINGVIENNACL";
static const char __pyx_k_ReorderDefaultFlag[] = "ReorderDefaultFlag";
static const char __pyx_k_TAOConvergedReason[] = "TAOConvergedReason";
static const char __pyx_k_ZERO_INITIAL_GUESS[] = "ZERO_INITIAL_GUESS";
static const char __pyx_k_applySymmetricLeft[] = "applySymmetricLeft";
static const char __pyx_k_block_size_not_set[] = "block size not set";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_createGlobalVector[] = "createGlobalVector";
static const char __pyx_k_create_restriction[] = "create_restriction";
static const char __pyx_k_getConvergedReason[] = "getConvergedReason";
static const char __pyx_k_getIterationNumber[] = "getIterationNumber";
static const char __pyx_k_getMaxStepFailures[] = "getMaxStepFailures";
static const char __pyx_k_getOwnershipRanges[] = "getOwnershipRanges";
static const char __pyx_k_hasExternalPackage[] = "hasExternalPackage";
static const char __pyx_k_readonly_attribute[] = "readonly attribute";
static const char __pyx_k_remove_sent_points[] = "remove_sent_points";
static const char __pyx_k_restrictAnisotropy[] = "restrictAnisotropy";
static const char __pyx_k_setConvergedReason[] = "setConvergedReason";
static const char __pyx_k_setIterationNumber[] = "setIterationNumber";
static const char __pyx_k_setMaxStepFailures[] = "setMaxStepFailures";
static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
static const char __pyx_k_CONVERGED_FNORM_ABS[] = "CONVERGED_FNORM_ABS";
static const char __pyx_k_CONVERGED_ITERATING[] = "CONVERGED_ITERATING";
static const char __pyx_k_CONVERGED_NEG_CURVE[] = "CONVERGED_NEG_CURVE";
static const char __pyx_k_DAE_IMPLICIT_INDEX1[] = "DAE_IMPLICIT_INDEX1";
static const char __pyx_k_DAE_IMPLICIT_INDEX2[] = "DAE_IMPLICIT_INDEX2";
static const char __pyx_k_DAE_IMPLICIT_INDEX3[] = "DAE_IMPLICIT_INDEX3";
static const char __pyx_k_DIVERGED_LS_FAILURE[] = "DIVERGED_LS_FAILURE";
static const char __pyx_k_DMPlexTransformType[] = "DMPlexTransformType";
static const char __pyx_k_IGNORE_ZERO_ENTRIES[] = "IGNORE_ZERO_ENTRIES";
static const char __pyx_k_I_0_is_d_expected_d[] = "I[0] is %d, expected %d";
static const char __pyx_k_LOCAL_FORWARD_SWEEP[] = "LOCAL_FORWARD_SWEEP";
static const char __pyx_k_MIGRATE_DMCELLEXACT[] = "MIGRATE_DMCELLEXACT";
static const char __pyx_k_MatPartitioningType[] = "MatPartitioningType";
static const char __pyx_k_NORM_PRECONDITIONED[] = "NORM_PRECONDITIONED";
static const char __pyx_k_NO_OFF_PROC_ENTRIES[] = "NO_OFF_PROC_ENTRIES";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_PARTITIONINGAVERAGE[] = "PARTITIONINGAVERAGE";
static const char __pyx_k_PARTITIONINGCURRENT[] = "PARTITIONINGCURRENT";
static const char __pyx_k_REFINEBOUNDARYLAYER[] = "REFINEBOUNDARYLAYER";
static const char __pyx_k_SNESConvergedReason[] = "SNESConvergedReason";
static const char __pyx_k_applySymmetricRight[] = "applySymmetricRight";
static const char __pyx_k_createNaturalVector[] = "createNaturalVector";
static const char __pyx_k_ignoreOutsideDomain[] = "ignoreOutsideDomain";
static const char __pyx_k_pop_python_vfprintf[] = "_pop_python_vfprintf";
static const char __pyx_k_unknown_join_mode_s[] = "unknown join mode: %s";
static const char __pyx_k_DAE_IMPLICIT_INDEXHI[] = "DAE_IMPLICIT_INDEXHI";
static const char __pyx_k_DIVERGED_LINE_SEARCH[] = "DIVERGED_LINE_SEARCH";
static const char __pyx_k_DMSwarmPICLayoutType[] = "DMSwarmPICLayoutType";
static const char __pyx_k_ExactFinalTimeOption[] = "ExactFinalTimeOption";
static const char __pyx_k_KEEP_NONZERO_PATTERN[] = "KEEP_NONZERO_PATTERN";
static const char __pyx_k_LOCAL_BACKWARD_SWEEP[] = "LOCAL_BACKWARD_SWEEP";
static const char __pyx_k_PARTITIONINGHIERARCH[] = "PARTITIONINGHIERARCH";
static const char __pyx_k_PARTITIONINGPARMETIS[] = "PARTITIONINGPARMETIS";
static const char __pyx_k_PARTITIONINGPTSCOTCH[] = "PARTITIONINGPTSCOTCH";
static const char __pyx_k_PCDeflationSpaceType[] = "PCDeflationSpaceType";
static const char __pyx_k_PCPatchConstructType[] = "PCPatchConstructType";
static const char __pyx_k_SAME_NONZERO_PATTERN[] = "SAME_NONZERO_PATTERN";
static const char __pyx_k_create_interpolation[] = "create_interpolation";
static const char __pyx_k_equality_constraints[] = "equality_constraints";
static const char __pyx_k_getEntriesPerElement[] = "getEntriesPerElement";
static const char __pyx_k_getInitialGuessKnoll[] = "getInitialGuessKnoll";
static const char __pyx_k_matpartitioning_type[] = "matpartitioning_type";
static const char __pyx_k_push_python_vfprintf[] = "_push_python_vfprintf";
static const char __pyx_k_setInitialGuessKnoll[] = "setInitialGuessKnoll";
static const char __pyx_k_staticproperty___get[] = "staticproperty.__get__";
static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
static const char __pyx_k_unknown_shift_type_s[] = "unknown shift type: %s";
static const char __pyx_k_CONVERGED_ATOL_NORMAL[] = "CONVERGED_ATOL_NORMAL";
static const char __pyx_k_CONVERGED_RTOL_NORMAL[] = "CONVERGED_RTOL_NORMAL";
static const char __pyx_k_CONVERGED_STEP_LENGTH[] = "CONVERGED_STEP_LENGTH";
static const char __pyx_k_DIVERGED_LINEAR_SOLVE[] = "DIVERGED_LINEAR_SOLVE";
static const char __pyx_k_DIVERGED_NONSYMMETRIC[] = "DIVERGED_NONSYMMETRIC";
static const char __pyx_k_DIVERGED_TR_REDUCTION[] = "DIVERGED_TR_REDUCTION";
static const char __pyx_k_DMDAInterpolationType[] = "DMDAInterpolationType";
static const char __pyx_k_DMStagStencilLocation[] = "DMStagStencilLocation";
static const char __pyx_k_LOCAL_SYMMETRIC_SWEEP[] = "LOCAL_SYMMETRIC_SWEEP";
static const char __pyx_k_NEW_NONZERO_LOCATIONS[] = "NEW_NONZERO_LOCATIONS";
static const char __pyx_k_NORM_UNPRECONDITIONED[] = "NORM_UNPRECONDITIONED";
static const char __pyx_k_NO_OFF_PROC_ZERO_ROWS[] = "NO_OFF_PROC_ZERO_ROWS";
static const char __pyx_k_SCATTER_FORWARD_LOCAL[] = "SCATTER_FORWARD_LOCAL";
static const char __pyx_k_SCATTER_REVERSE_LOCAL[] = "SCATTER_REVERSE_LOCAL";
static const char __pyx_k_SHARE_NONZERO_PATTERN[] = "SHARE_NONZERO_PATTERN";
static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
static const char __pyx_k_getApplicationContext[] = "getApplicationContext";
static const char __pyx_k_getConvergenceHistory[] = "getConvergenceHistory";
static const char __pyx_k_getFunctionTolerances[] = "getFunctionTolerances";
static const char __pyx_k_getGradientTolerances[] = "getGradientTolerances";
static const char __pyx_k_productSetFromOptions[] = "productSetFromOptions";
static const char __pyx_k_setApplicationContext[] = "setApplicationContext";
static const char __pyx_k_setFunctionTolerances[] = "setFunctionTolerances";
static const char __pyx_k_side_r_not_understood[] = "side '%r' not understood";
static const char __pyx_k_unknown_device_type_s[] = "unknown device type: %s";
static const char __pyx_k_unknown_stream_type_s[] = "unknown stream type: %s";
static const char __pyx_k_DIVERGED_INDEFINITE_PC[] = "DIVERGED_INDEFINITE_PC";
static const char __pyx_k_DIVERGED_STEP_REJECTED[] = "DIVERGED_STEP_REJECTED";
static const char __pyx_k_ERROR_LOWER_TRIANGULAR[] = "ERROR_LOWER_TRIANGULAR";
static const char __pyx_k_FORCE_DIAGONAL_ENTRIES[] = "FORCE_DIAGONAL_ENTRIES";
static const char __pyx_k_GETROW_UPPERTRIANGULAR[] = "GETROW_UPPERTRIANGULAR";
static const char __pyx_k_MIGRATE_DMCELLNSCATTER[] = "MIGRATE_DMCELLNSCATTER";
static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
static const char __pyx_k_Object_is_not_writable[] = "Object is not writable.";
static const char __pyx_k_STRUCTURALLY_SYMMETRIC[] = "STRUCTURALLY_SYMMETRIC";
static const char __pyx_k_SUBSET_NONZERO_PATTERN[] = "SUBSET_NONZERO_PATTERN";
static const char __pyx_k_communicator_not_owned[] = "communicator not owned";
static const char __pyx_k_getDefaultLocalSection[] = "getDefaultLocalSection";
static const char __pyx_k_getInitialGuessNonzero[] = "getInitialGuessNonzero";
static const char __pyx_k_getLinearSolveFailures[] = "getLinearSolveFailures";
static const char __pyx_k_petsc4py_PETSc_Log_pyx[] = "petsc4py/PETSc/Log.pyx";
static const char __pyx_k_setDefaultLocalSection[] = "setDefaultLocalSection";
static const char __pyx_k_setInitialGuessNonzero[] = "setInitialGuessNonzero";
static const char __pyx_k_size_I_is_d_expected_d[] = "size(I) is %d, expected %d";
static const char __pyx_k_size_J_is_d_expected_d[] = "size(J) is %d, expected %d";
static const char __pyx_k_size_V_is_d_expected_d[] = "size(V) is %d, expected %d";
static const char __pyx_k_unknown_element_type_s[] = "unknown element type: %s";
static const char __pyx_k_unknown_scatter_mode_s[] = "unknown scatter mode: %s";
static const char __pyx_k_unknown_stencil_type_s[] = "unknown stencil type: %s";
static const char __pyx_k_COLLECT_DMDABOUNDINGBOX[] = "COLLECT_DMDABOUNDINGBOX";
static const char __pyx_k_DIVERGED_BREAKDOWN_BICG[] = "DIVERGED_BREAKDOWN_BICG";
static const char __pyx_k_DIVERGED_FUNCTION_COUNT[] = "DIVERGED_FUNCTION_COUNT";
static const char __pyx_k_DIVERGED_INDEFINITE_MAT[] = "DIVERGED_INDEFINITE_MAT";
static const char __pyx_k_DIVERGED_PCSETUP_FAILED[] = "DIVERGED_PCSETUP_FAILED";
static const char __pyx_k_FACTOR_STRUCT_ZEROPIVOT[] = "FACTOR_STRUCT_ZEROPIVOT";
static const char __pyx_k_IGNORE_LOWER_TRIANGULAR[] = "IGNORE_LOWER_TRIANGULAR";
static const char __pyx_k_IGNORE_NEGATIVE_INDICES[] = "IGNORE_NEGATIVE_INDICES";
static const char __pyx_k_IGNORE_OFF_PROC_ENTRIES[] = "IGNORE_OFF_PROC_ENTRIES";
static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
static const char __pyx_k_NORM_INITIAL_FINAL_ONLY[] = "NORM_INITIAL_FINAL_ONLY";
static const char __pyx_k_SUBSET_OFF_PROC_ENTRIES[] = "SUBSET_OFF_PROC_ENTRIES";
static const char __pyx_k_UNKNOWN_NONZERO_PATTERN[] = "UNKNOWN_NONZERO_PATTERN";
static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
static const char __pyx_k_getConstraintTolerances[] = "getConstraintTolerances";
static const char __pyx_k_getDefaultGlobalSection[] = "getDefaultGlobalSection";
static const char __pyx_k_isStructurallySymmetric[] = "isStructurallySymmetric";
static const char __pyx_k_restrictAnisotropyFirst[] = "restrictAnisotropyFirst";
static const char __pyx_k_setDefaultGlobalSection[] = "setDefaultGlobalSection";
static const char __pyx_k_unknown_boundary_type_s[] = "unknown boundary type: %s";
static const char __pyx_k_unknown_error_handler_s[] = "unknown error handler: %s";
static const char __pyx_k_CONVERGED_FNORM_RELATIVE[] = "CONVERGED_FNORM_RELATIVE";
static const char __pyx_k_CONVERGED_SNORM_RELATIVE[] = "CONVERGED_SNORM_RELATIVE";
static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
static const char __pyx_k_DAE_SEMI_EXPLICIT_INDEX1[] = "DAE_SEMI_EXPLICIT_INDEX1";
static const char __pyx_k_DAE_SEMI_EXPLICIT_INDEX2[] = "DAE_SEMI_EXPLICIT_INDEX2";
static const char __pyx_k_DAE_SEMI_EXPLICIT_INDEX3[] = "DAE_SEMI_EXPLICIT_INDEX3";
static const char __pyx_k_DIVERGED_FUNCTION_DOMAIN[] = "DIVERGED_FUNCTION_DOMAIN";
static const char __pyx_k_DIVERGED_JACOBIAN_DOMAIN[] = "DIVERGED_JACOBIAN_DOMAIN";
static const char __pyx_k_DIVERGED_NONLINEAR_SOLVE[] = "DIVERGED_NONLINEAR_SOLVE";
static const char __pyx_k_DMPlexReorderDefaultFlag[] = "DMPlexReorderDefaultFlag";
static const char __pyx_k_FACTOR_NUMERIC_ZEROPIVOT[] = "FACTOR_NUMERIC_ZEROPIVOT";
static const char __pyx_k_Missing_input_parameters[] = "Missing input parameters";
static const char __pyx_k_NEW_NONZERO_LOCATION_ERR[] = "NEW_NONZERO_LOCATION_ERR";
static const char __pyx_k_PCFieldSplitSchurPreType[] = "PCFieldSplitSchurPreType";
static const char __pyx_k_SYMMETRIC_MULTIPLICATIVE[] = "SYMMETRIC_MULTIPLICATIVE";
static const char __pyx_k_getNonlinearStepFailures[] = "getNonlinearStepFailures";
static const char __pyx_k_incompatible_array_sizes[] = "incompatible array sizes";
static const char __pyx_k_petsc4py_PETSc_Error_pyx[] = "petsc4py/PETSc/Error.pyx";
static const char __pyx_k_petsc4py_PETSc_PETSc_pyx[] = "petsc4py/PETSc/PETSc.pyx";
static const char __pyx_k_CONVERGED_HAPPY_BREAKDOWN[] = "CONVERGED_HAPPY_BREAKDOWN";
static const char __pyx_k_DAE_SEMI_EXPLICIT_INDEXHI[] = "DAE_SEMI_EXPLICIT_INDEXHI";
static const char __pyx_k_DIFFERENT_NONZERO_PATTERN[] = "DIFFERENT_NONZERO_PATTERN";
static const char __pyx_k_Device_type_not_supported[] = "Device type {} not supported";
static const char __pyx_k_HPDDMCoarseCorrectionType[] = "HPDDMCoarseCorrectionType";
static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
static const char __pyx_k_PCFieldSplitSchurFactType[] = "PCFieldSplitSchurFactType";
static const char __pyx_k_getMaxFunctionEvaluations[] = "getMaxFunctionEvaluations";
static const char __pyx_k_getMaxLinearSolveFailures[] = "getMaxLinearSolveFailures";
static const char __pyx_k_petsc4py_PETSc_Device_pyx[] = "petsc4py/PETSc/Device.pyx";
static const char __pyx_k_setMaxFunctionEvaluations[] = "setMaxFunctionEvaluations";
static const char __pyx_k_setMaxLinearSolveFailures[] = "setMaxLinearSolveFailures";
static const char __pyx_k_NEW_NONZERO_ALLOCATION_ERR[] = "NEW_NONZERO_ALLOCATION_ERR";
static const char __pyx_k_size_d_nnz_is_d_expected_d[] = "size(d_nnz) is %d, expected %d";
static const char __pyx_k_size_o_nnz_is_d_expected_d[] = "size(o_nnz) is %d, expected %d";
static const char __pyx_k_PCHPDDMCoarseCorrectionType[] = "PCHPDDMCoarseCorrectionType";
static const char __pyx_k_UNUSED_NONZERO_LOCATION_ERR[] = "UNUSED_NONZERO_LOCATION_ERR";
static const char __pyx_k_getMaxNonlinearStepFailures[] = "getMaxNonlinearStepFailures";
static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
static const char __pyx_k_petsc4py_PETSc_cyclicgc_pxi[] = "petsc4py/PETSc/cyclicgc.pxi";
static const char __pyx_k_setMaxNonlinearStepFailures[] = "setMaxNonlinearStepFailures";
static const char __pyx_k_unhandled_PetscDeviceType_d[] = "unhandled PetscDeviceType %d";
static const char __pyx_k_unhandled_PetscStreamType_d[] = "unhandled PetscStreamType %d";
static const char __pyx_k_Not_for_rectangular_matrices[] = "Not for rectangular matrices";
static const char __pyx_k_Unsupported_PetscScalar_type[] = "Unsupported PetscScalar type";
static const char __pyx_k_expecting_tuple_list_or_dict[] = "expecting tuple/list or dict";
static const char __pyx_k_option_prefix_must_be_string[] = "option prefix must be string";
static const char __pyx_k_unknown_interpolation_type_s[] = "unknown interpolation type: %s";
static const char __pyx_k_block_size_d_must_be_positive[] = "block size %d must be positive";
static const char __pyx_k_incompatible_array_sizes_nv_d[] = "incompatible array sizes: nv=%d";
static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
static const char __pyx_k_TAO_Solver_Termination_Reasons[] = "\n TAO Solver Termination Reasons\n ";
static const char __pyx_k_expecting_a_C_contiguous_array[] = "expecting a C-contiguous array";
static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
static const char __pyx_k_A_matrix_with_d_rows_requires_a[] = "A matrix with %d rows requires a row pointer of length %d (given: %d)";
static const char __pyx_k_EventDecorator_locals_decorator[] = "EventDecorator.<locals>.decorator.<locals>.wrapped_func";
static const char __pyx_k_Invalid_mode_expected_r_w_or_rw[] = "Invalid mode: expected 'r', 'w' or 'rw'";
static const char __pyx_k_Invalid_mode_expected_rw_r_or_w[] = "Invalid mode: expected 'rw', 'r', or 'w'";
static const char __pyx_k_Portable_Extensible_Toolkit_for[] = "\nPortable, Extensible Toolkit for Scientific Computation\n";
static const char __pyx_k_bcPoints_is_a_required_argument[] = "bcPoints is a required argument";
static const char __pyx_k_cannot_place_input_array_size_d[] = "cannot place input array size %d, vector size %d";
static const char __pyx_k_key_d_cannot_register_s_already[] = "key: %d, cannot register: %s, already registered: %s";
static const char __pyx_k_size_array_is_d_expected_dx_d_d[] = "size(array) is %d, expected %dx%d=%d";
static const char __pyx_k_unknown_stencil_location_type_s[] = "unknown stencil location type: %s";
static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
static const char __pyx_k_Expect_a_dltensor_field_pycapsul[] = "Expect a dltensor field, pycapsule.PyCapsule can only be consumed once";
static const char __pyx_k_Expect_a_dltensor_or_used_dltens[] = "Expect a dltensor or used_dltensor field";
static const char __pyx_k_Given_d_column_indices_but_d_non[] = "Given %d column indices but %d non-zero values";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
static const char __pyx_k_Input_vector_has_no_tensor_infor[] = "Input vector has no tensor information";
static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
static const char __pyx_k_Must_provide_as_many_communicato[] = "Must provide as many communicators as levels";
static const char __pyx_k_Must_provide_both_sizes_and_poin[] = "Must provide both sizes and points arrays";
static const char __pyx_k_Must_provide_operator_for_USER_o[] = "Must provide operator for USER or PYTHON type";
static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
static const char __pyx_k_Out_of_memory_Allocated_d_Used_b[] = "Out of memory. Allocated: %d, Used by process: %d";
static const char __pyx_k_Tensor_dtype_does_not_match_PETS[] = "Tensor dtype = {} does not match PETSc precision";
static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
static const char __pyx_k_Vector_local_size_d_is_not_compa[] = "Vector local size %d is not compatible with DMDA local sizes %s";
static const char __pyx_k_accessing_non_existent_buffer_se[] = "accessing non-existent buffer segment";
static const char __pyx_k_array_size_d_and_vector_local_si[] = "array size %d and vector local size %d block size %d";
static const char __pyx_k_array_size_d_incompatible_with_v[] = "array size %d incompatible with vector local size %d";
static const char __pyx_k_cell_indices_must_have_two_dimen[] = "cell indices must have two dimensions: cells.ndim=%d";
static const char __pyx_k_column_indices_must_have_two_dim[] = "column indices must have two dimensions: cols.ndim=%d";
static const char __pyx_k_coordinates_must_have_two_dimens[] = "coordinates must have two dimensions: coordinates.ndim=%d";
static const char __pyx_k_coordinates_size_must_be_at_leas[] = "coordinates size must be at least %d";
static const char __pyx_k_coords_vertices_must_have_two_di[] = "coords vertices must have two dimensions: coords.ndim=%d";
static const char __pyx_k_get1dCoordinatecArrays_for_DMSta[] = "get1dCoordinatecArrays for DMStag not yet implemented in petsc4py";
static const char __pyx_k_getValuesStagStencil_not_yet_imp[] = "getValuesStagStencil not yet implemented in petsc4py";
static const char __pyx_k_getVecArray_for_DMStag_not_yet_i[] = "getVecArray for DMStag not yet implemented in petsc4py";
static const char __pyx_k_ghosts_size_d_array_size_d_and_v[] = "ghosts size %d, array size %d, and vector local size %d block size %d";
static const char __pyx_k_global_size_d_not_divisible_by_b[] = "global size %d not divisible by block size %d";
static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
static const char __pyx_k_incompatible_array_sizes_ni_d_nj[] = "incompatible array sizes: ni=%d, nj=%d, nv=%d";
static const char __pyx_k_incompatible_array_sizes_ni_d_nv[] = "incompatible array sizes: ni=%d, nv=%d, bs=%d";
static const char __pyx_k_input_arrays_have_incompatible_s[] = "input arrays have incompatible shapes: rows.shape=%s, cols.shape=%s, vals.shape=%s";
static const char __pyx_k_local_and_global_sizes_cannot_be[] = "local and global sizes cannot be both 'DECIDE'";
static const char __pyx_k_local_size_d_not_divisible_by_bl[] = "local size %d not divisible by block size %d";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_number_of_dimensions_d_and_numbe[] = "number of dimensions %d and number ownership ranges %d";
static const char __pyx_k_option_prefix_should_not_have_sp[] = "option prefix should not have spaces";
static const char __pyx_k_option_prefix_should_not_start_w[] = "option prefix should not start with a hyphen";
static const char __pyx_k_ownership_range_size_d_and_numbe[] = "ownership range size %d and number or processors %d";
static const char __pyx_k_row_indices_must_have_two_dimens[] = "row indices must have two dimensions: rows.ndim=%d";
static const char __pyx_k_setValueBlockedStagStencil_not_y[] = "setValueBlockedStagStencil not yet implemented in petsc4py";
static const char __pyx_k_setValueStagStencil_not_yet_impl[] = "setValueStagStencil not yet implemented in petsc4py";
static const char __pyx_k_setValuesStagStencil_not_yet_imp[] = "setValuesStagStencil not yet implemented in petsc4py";
static const char __pyx_k_sizes_array_should_have_d_entrie[] = "sizes array should have %d entries (has %d)";
static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
static const char __pyx_k_unhandled_PetscDeviceContextJoin[] = "unhandled PetscDeviceContextJoinMode %d";
static const char __pyx_k_values_must_have_two_or_more_dim[] = "values must have two or more dimensions: vals.ndim=%d";
static const char __pyx_k_EventDecorator_locals_decorator_2[] = "EventDecorator.<locals>.decorator";
static const char __pyx_k_incompatible_array_sizes_ni_d_nv_2[] = "incompatible array sizes: ni=%d, nv=%d";
static PyObject *__pyx_kp_s_;
static PyObject *__pyx_n_s_A;
static PyObject *__pyx_n_s_A11;
static PyObject *__pyx_n_s_AB;
static PyObject *__pyx_n_s_ABC;
static PyObject *__pyx_n_s_ABt;
static PyObject *__pyx_n_s_ADD;
static PyObject *__pyx_n_s_ADDITIVE;
static PyObject *__pyx_n_s_ADD_ALL;
static PyObject *__pyx_n_s_ADD_ALL_VALUES;
static PyObject *__pyx_n_s_ADD_BC;
static PyObject *__pyx_n_s_ADD_BC_VALUES;
static PyObject *__pyx_n_s_ADD_VALUES;
static PyObject *__pyx_n_s_ADIOS;
static PyObject *__pyx_n_s_ADMM;
static PyObject *__pyx_n_s_ADVANCED;
static PyObject *__pyx_n_s_AGG;
static PyObject *__pyx_n_s_AGGERGATION;
static PyObject *__pyx_n_s_AIJ;
static PyObject *__pyx_n_s_AIJCRL;
static PyObject *__pyx_n_s_AIJCUSPARSE;
static PyObject *__pyx_n_s_AIJMKL;
static PyObject *__pyx_n_s_AIJPERM;
static PyObject *__pyx_n_s_AIJSELL;
static PyObject *__pyx_n_s_AIJVIENNACL;
static PyObject *__pyx_n_s_ALLGATHER;
static PyObject *__pyx_n_s_ALLGATHERV;
static PyObject *__pyx_n_s_ALLTOALL;
static PyObject *__pyx_n_s_ALMM;
static PyObject *__pyx_n_s_ALPHA;
static PyObject *__pyx_n_s_ALPHA2;
static PyObject *__pyx_n_s_ALWAYS;
static PyObject *__pyx_n_s_AMD;
static PyObject *__pyx_n_s_ANDERSON;
static PyObject *__pyx_n_s_AO;
static PyObject *__pyx_n_s_AOType;
static PyObject *__pyx_n_s_APPEND;
static PyObject *__pyx_n_s_APPEND_UPDATE;
static PyObject *__pyx_n_s_APPLY_LOWER;
static PyObject *__pyx_n_s_APPLY_UPPER;
static PyObject *__pyx_n_s_ARKIMEX;
static PyObject *__pyx_n_s_ARKIMEX1BEE;
static PyObject *__pyx_n_s_ARKIMEX2C;
static PyObject *__pyx_n_s_ARKIMEX2D;
static PyObject *__pyx_n_s_ARKIMEX2E;
static PyObject *__pyx_n_s_ARKIMEX3;
static PyObject *__pyx_n_s_ARKIMEX4;
static PyObject *__pyx_n_s_ARKIMEX5;
static PyObject *__pyx_n_s_ARKIMEXA2;
static PyObject *__pyx_n_s_ARKIMEXARS122;
static PyObject *__pyx_n_s_ARKIMEXARS443;
static PyObject *__pyx_n_s_ARKIMEXBPR3;
static PyObject *__pyx_n_s_ARKIMEXL2;
static PyObject *__pyx_n_s_ARKIMEXPRSSP2;
static PyObject *__pyx_n_s_ARKIMEXType;
static PyObject *__pyx_n_s_ASCII;
static PyObject *__pyx_n_s_ASCII_COMMON;
static PyObject *__pyx_n_s_ASCII_CSV;
static PyObject *__pyx_n_s_ASCII_DENSE;
static PyObject *__pyx_n_s_ASCII_FACTOR_INFO;
static PyObject *__pyx_n_s_ASCII_GLVIS;
static PyObject *__pyx_n_s_ASCII_IMPL;
static PyObject *__pyx_n_s_ASCII_INDEX;
static PyObject *__pyx_n_s_ASCII_INFO;
static PyObject *__pyx_n_s_ASCII_INFO_DETAIL;
static PyObject *__pyx_n_s_ASCII_LATEX;
static PyObject *__pyx_n_s_ASCII_MATHEMATICA;
static PyObject *__pyx_n_s_ASCII_MATLAB;
static PyObject *__pyx_n_s_ASCII_MATRIXMARKET;
static PyObject *__pyx_n_s_ASCII_PCICE;
static PyObject *__pyx_n_s_ASCII_PYTHON;
static PyObject *__pyx_n_s_ASCII_SYMMODU;
static PyObject *__pyx_n_s_ASCII_VTK;
static PyObject *__pyx_n_s_ASCII_VTK_CELL;
static PyObject *__pyx_n_s_ASCII_VTK_COORDS;
static PyObject *__pyx_n_s_ASCII_XML;
static PyObject *__pyx_n_s_ASFLS;
static PyObject *__pyx_n_s_ASILS;
static PyObject *__pyx_n_s_ASM;
static PyObject *__pyx_n_s_ASMType;
static PyObject *__pyx_n_s_ASPIN;
static PyObject *__pyx_n_s_AU;
static PyObject *__pyx_kp_s_A_matrix_with_d_rows_requires_a;
static PyObject *__pyx_n_s_AssemblyType;
static PyObject *__pyx_n_s_AtB;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_n_s_B;
static PyObject *__pyx_n_s_BACK;
static PyObject *__pyx_n_s_BACKWARD_SWEEP;
static PyObject *__pyx_n_s_BACK_DOWN;
static PyObject *__pyx_n_s_BACK_DOWN_LEFT;
static PyObject *__pyx_n_s_BACK_DOWN_RIGHT;
static PyObject *__pyx_n_s_BACK_LEFT;
static PyObject *__pyx_n_s_BACK_RIGHT;
static PyObject *__pyx_n_s_BACK_UP;
static PyObject *__pyx_n_s_BACK_UP_LEFT;
static PyObject *__pyx_n_s_BACK_UP_RIGHT;
static PyObject *__pyx_n_s_BAIJ;
static PyObject *__pyx_n_s_BAIJMKL;
static PyObject *__pyx_n_s_BALANCED;
static PyObject *__pyx_n_s_BAS;
static PyObject *__pyx_n_s_BASIC;
static PyObject *__pyx_n_s_BASICSYMPLECTIC;
static PyObject *__pyx_n_s_BCGS;
static PyObject *__pyx_n_s_BCGSL;
static PyObject *__pyx_n_s_BDDC;
static PyObject *__pyx_n_s_BDF;
static PyObject *__pyx_n_s_BDM;
static PyObject *__pyx_n_s_BE;
static PyObject *__pyx_n_s_BEULER;
static PyObject *__pyx_n_s_BFBT;
static PyObject *__pyx_n_s_BICG;
static PyObject *__pyx_n_s_BINARY;
static PyObject *__pyx_n_s_BINARY_MATLAB;
static PyObject *__pyx_n_s_BIORTH22;
static PyObject *__pyx_n_s_BJACOBI;
static PyObject *__pyx_n_s_BLMVM;
static PyObject *__pyx_n_s_BLOCK;
static PyObject *__pyx_n_s_BLOCKMAT;
static PyObject *__pyx_n_s_BMRM;
static PyObject *__pyx_n_s_BNCG;
static PyObject *__pyx_n_s_BNLS;
static PyObject *__pyx_n_s_BNTL;
static PyObject *__pyx_n_s_BNTR;
static PyObject *__pyx_n_s_BOX;
static PyObject *__pyx_n_s_BQNKLS;
static PyObject *__pyx_n_s_BQNKTL;
static PyObject *__pyx_n_s_BQNKTR;
static PyObject *__pyx_n_s_BQNLS;
static PyObject *__pyx_n_s_BQPIP;
static PyObject *__pyx_n_s_BRGN;
static PyObject *__pyx_n_s_Barrier;
static PyObject *__pyx_n_s_BoundaryType;
static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
static PyObject *__pyx_n_s_C;
static PyObject *__pyx_n_s_CG;
static PyObject *__pyx_n_s_CGLS;
static PyObject *__pyx_n_s_CGNE;
static PyObject *__pyx_n_s_CGS;
static PyObject *__pyx_n_s_CHACO;
static PyObject *__pyx_n_s_CHEBYSHEV;
static PyObject *__pyx_n_s_CHOLESKY;
static PyObject *__pyx_n_s_CHOLMOD;
static PyObject *__pyx_n_s_CHOWILUVIENNACL;
static PyObject *__pyx_n_s_CLASSICAL;
static PyObject *__pyx_n_s_CN;
static PyObject *__pyx_n_s_COLLECT_BASIC;
static PyObject *__pyx_n_s_COLLECT_DMDABOUNDINGBOX;
static PyObject *__pyx_n_s_COLLECT_GENERAL;
static PyObject *__pyx_n_s_COLLECT_USER;
static PyObject *__pyx_n_s_COMM_NULL;
static PyObject *__pyx_n_s_COMM_SELF;
static PyObject *__pyx_n_s_COMM_WORLD;
static PyObject *__pyx_n_s_COMPOSITE;
static PyObject *__pyx_n_s_CONSTANTDIAGONAL;
static PyObject *__pyx_n_s_CONTINUE_ITERATING;
static PyObject *__pyx_n_s_CONVERGED_ATOL;
static PyObject *__pyx_n_s_CONVERGED_ATOL_NORMAL;
static PyObject *__pyx_n_s_CONVERGED_EVENT;
static PyObject *__pyx_n_s_CONVERGED_FNORM_ABS;
static PyObject *__pyx_n_s_CONVERGED_FNORM_RELATIVE;
static PyObject *__pyx_n_s_CONVERGED_GATOL;
static PyObject *__pyx_n_s_CONVERGED_GRTOL;
static PyObject *__pyx_n_s_CONVERGED_GTTOL;
static PyObject *__pyx_n_s_CONVERGED_HAPPY_BREAKDOWN;
static PyObject *__pyx_n_s_CONVERGED_ITERATING;
static PyObject *__pyx_n_s_CONVERGED_ITS;
static PyObject *__pyx_n_s_CONVERGED_MINF;
static PyObject *__pyx_n_s_CONVERGED_NEG_CURVE;
static PyObject *__pyx_n_s_CONVERGED_RTOL;
static PyObject *__pyx_n_s_CONVERGED_RTOL_NORMAL;
static PyObject *__pyx_n_s_CONVERGED_SNORM_RELATIVE;
static PyObject *__pyx_n_s_CONVERGED_STEPTOL;
static PyObject *__pyx_n_s_CONVERGED_STEP_LENGTH;
static PyObject *__pyx_n_s_CONVERGED_TIME;
static PyObject *__pyx_n_s_CONVERGED_USER;
static PyObject *__pyx_n_s_COPY_VALUES;
static PyObject *__pyx_n_s_CP;
static PyObject *__pyx_n_s_CR;
static PyObject *__pyx_n_s_CRANK_NICOLSON;
static PyObject *__pyx_n_s_CUDA;
static PyObject *__pyx_n_s_CUSPARSE;
static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
static PyObject *__pyx_n_s_Class;
static PyObject *__pyx_n_s_Clone;
static PyObject *__pyx_n_s_CollectType;
static PyObject *__pyx_n_s_Comm;
static PyObject *__pyx_n_s_ComplexType;
static PyObject *__pyx_n_s_CompositeType;
static PyObject *__pyx_n_s_ConvergedReason;
static PyObject *__pyx_n_s_D;
static PyObject *__pyx_n_s_DA;
static PyObject *__pyx_n_s_DAE_IMPLICIT_INDEX1;
static PyObject *__pyx_n_s_DAE_IMPLICIT_INDEX2;
static PyObject *__pyx_n_s_DAE_IMPLICIT_INDEX3;
static PyObject *__pyx_n_s_DAE_IMPLICIT_INDEXHI;
static PyObject *__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX1;
static PyObject *__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX2;
static PyObject *__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX3;
static PyObject *__pyx_n_s_DAE_SEMI_EXPLICIT_INDEXHI;
static PyObject *__pyx_n_s_DB16;
static PyObject *__pyx_n_s_DB2;
static PyObject *__pyx_n_s_DB4;
static PyObject *__pyx_n_s_DB8;
static PyObject *__pyx_n_s_DECIDE;
static PyObject *__pyx_n_s_DEFAULT;
static PyObject *__pyx_n_s_DEFAULT_BLOCKING;
static PyObject *__pyx_n_s_DEFLATED;
static PyObject *__pyx_n_s_DEFLATION;
static PyObject *__pyx_n_s_DENSE;
static PyObject *__pyx_n_s_DENSECUDA;
static PyObject *__pyx_n_s_DESTROY;
static PyObject *__pyx_n_s_DETERMINE;
static PyObject *__pyx_n_s_DGMRES;
static PyObject *__pyx_n_s_DIAG;
static PyObject *__pyx_n_s_DIFFERENT;
static PyObject *__pyx_n_s_DIFFERENT_NONZERO_PATTERN;
static PyObject *__pyx_n_s_DIFFERENT_NZ;
static PyObject *__pyx_n_s_DISCGRAD;
static PyObject *__pyx_n_s_DIVERGED_BREAKDOWN;
static PyObject *__pyx_n_s_DIVERGED_BREAKDOWN_BICG;
static PyObject *__pyx_n_s_DIVERGED_DTOL;
static PyObject *__pyx_n_s_DIVERGED_FNORM_NAN;
static PyObject *__pyx_n_s_DIVERGED_FUNCTION_COUNT;
static PyObject *__pyx_n_s_DIVERGED_FUNCTION_DOMAIN;
static PyObject *__pyx_n_s_DIVERGED_INDEFINITE_MAT;
static PyObject *__pyx_n_s_DIVERGED_INDEFINITE_PC;
static PyObject *__pyx_n_s_DIVERGED_INNER;
static PyObject *__pyx_n_s_DIVERGED_JACOBIAN_DOMAIN;
static PyObject *__pyx_n_s_DIVERGED_LINEAR_SOLVE;
static PyObject *__pyx_n_s_DIVERGED_LINE_SEARCH;
static PyObject *__pyx_n_s_DIVERGED_LOCAL_MIN;
static PyObject *__pyx_n_s_DIVERGED_LS_FAILURE;
static PyObject *__pyx_n_s_DIVERGED_MAXFCN;
static PyObject *__pyx_n_s_DIVERGED_MAXITS;
static PyObject *__pyx_n_s_DIVERGED_MAX_IT;
static PyObject *__pyx_n_s_DIVERGED_NAN;
static PyObject *__pyx_n_s_DIVERGED_NANORINF;
static PyObject *__pyx_n_s_DIVERGED_NONLINEAR_SOLVE;
static PyObject *__pyx_n_s_DIVERGED_NONSYMMETRIC;
static PyObject *__pyx_n_s_DIVERGED_NULL;
static PyObject *__pyx_n_s_DIVERGED_PCSETUP_FAILED;
static PyObject *__pyx_n_s_DIVERGED_STEP_REJECTED;
static PyObject *__pyx_n_s_DIVERGED_TR_DELTA;
static PyObject *__pyx_n_s_DIVERGED_TR_REDUCTION;
static PyObject *__pyx_n_s_DIVERGED_USER;
static PyObject *__pyx_n_s_DM;
static PyObject *__pyx_n_s_DMBoundaryType;
static PyObject *__pyx_n_s_DMComposite;
static PyObject *__pyx_n_s_DMComposite_access;
static PyObject *__pyx_n_s_DMDA;
static PyObject *__pyx_n_s_DMDAElementType;
static PyObject *__pyx_n_s_DMDAInterpolationType;
static PyObject *__pyx_n_s_DMDAStencilType;
static PyObject *__pyx_n_s_DMDA_Vec_array;
static PyObject *__pyx_n_s_DMInterpolation;
static PyObject *__pyx_n_s_DMLabel;
static PyObject *__pyx_n_s_DMPlex;
static PyObject *__pyx_n_s_DMPlexReorderDefaultFlag;
static PyObject *__pyx_n_s_DMPlexTransform;
static PyObject *__pyx_n_s_DMPlexTransformType;
static PyObject *__pyx_n_s_DMPolytopeType;
static PyObject *__pyx_n_s_DMShell;
static PyObject *__pyx_n_s_DMStag;
static PyObject *__pyx_n_s_DMStagStencilLocation;
static PyObject *__pyx_n_s_DMStagStencilType;
static PyObject *__pyx_n_s_DMSwarm;
static PyObject *__pyx_n_s_DMSwarmCollectType;
static PyObject *__pyx_n_s_DMSwarmMigrateType;
static PyObject *__pyx_n_s_DMSwarmPICLayoutType;
static PyObject *__pyx_n_s_DMSwarmType;
static PyObject *__pyx_n_s_DMType;
static PyObject *__pyx_n_s_DOF;
static PyObject *__pyx_n_s_DOWN;
static PyObject *__pyx_n_s_DOWN_LEFT;
static PyObject *__pyx_n_s_DOWN_RIGHT;
static PyObject *__pyx_n_s_DO_NOT_COPY_VALUES;
static PyObject *__pyx_n_s_DRAW;
static PyObject *__pyx_n_s_DRAW_BASIC;
static PyObject *__pyx_n_s_DRAW_CONTOUR;
static PyObject *__pyx_n_s_DRAW_LG;
static PyObject *__pyx_n_s_DRAW_LG_XRANGE;
static PyObject *__pyx_n_s_DRAW_PORTS;
static PyObject *__pyx_n_s_DROP;
static PyObject *__pyx_n_s_DS;
static PyObject *__pyx_n_s_DSType;
static PyObject *__pyx_n_s_DUMMY;
static PyObject *__pyx_n_s_DeflationSpaceType;
static PyObject *__pyx_n_s_Device;
static PyObject *__pyx_n_s_DeviceContext;
static PyObject *__pyx_n_s_DeviceJoinMode;
static PyObject *__pyx_n_s_DeviceType;
static PyObject *__pyx_kp_s_Device_type_not_supported;
static PyObject *__pyx_n_s_DrawSize;
static PyObject *__pyx_n_s_DualSpace;
static PyObject *__pyx_n_s_DualSpaceType;
static PyObject *__pyx_n_s_Dup;
static PyObject *__pyx_n_s_DuplicateOption;
static PyObject *__pyx_n_s_EIMEX;
static PyObject *__pyx_n_s_EISENSTAT;
static PyObject *__pyx_n_s_ELEMENT;
static PyObject *__pyx_n_s_ELEMENTAL;
static PyObject *__pyx_n_s_ERROR_LOWER_TRIANGULAR;
static PyObject *__pyx_n_s_ESSL;
static PyObject *__pyx_n_s_EULER;
static PyObject *__pyx_n_s_EXODUSII;
static PyObject *__pyx_n_s_EXOTIC;
static PyObject *__pyx_n_s_EXPLICIT;
static PyObject *__pyx_n_s_EXTRUDE;
static PyObject *__pyx_n_s_ElementType;
static PyObject *__pyx_n_s_Ellipsis;
static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
static PyObject *__pyx_n_s_EquationType;
static PyObject *__pyx_n_s_Error;
static PyObject *__pyx_n_s_Error___init;
static PyObject *__pyx_n_s_Error___nonzero;
static PyObject *__pyx_n_s_Error___repr;
static PyObject *__pyx_n_s_Error___str;
static PyObject *__pyx_n_s_Event;
static PyObject *__pyx_n_s_EventDecorator;
static PyObject *__pyx_n_s_EventDecorator_locals_decorator;
static PyObject *__pyx_n_s_EventDecorator_locals_decorator_2;
static PyObject *__pyx_n_s_ExactFinalTime;
static PyObject *__pyx_n_s_ExactFinalTimeOption;
static PyObject *__pyx_kp_s_Expect_a_dltensor_field_pycapsul;
static PyObject *__pyx_kp_s_Expect_a_dltensor_or_used_dltens;
static PyObject *__pyx_n_s_FACTOR_NUMERIC_ZEROPIVOT;
static PyObject *__pyx_n_s_FACTOR_OTHER;
static PyObject *__pyx_n_s_FACTOR_OUTMEMORY;
static PyObject *__pyx_n_s_FACTOR_STRUCT_ZEROPIVOT;
static PyObject *__pyx_n_s_FAILED;
static PyObject *__pyx_n_s_FALSE;
static PyObject *__pyx_n_s_FAS;
static PyObject *__pyx_n_s_FBCGS;
static PyObject *__pyx_n_s_FBCGSR;
static PyObject *__pyx_n_s_FCG;
static PyObject *__pyx_n_s_FE;
static PyObject *__pyx_n_s_FETIDP;
static PyObject *__pyx_n_s_FEType;
static PyObject *__pyx_n_s_FFT;
static PyObject *__pyx_n_s_FFTW;
static PyObject *__pyx_n_s_FGMRES;
static PyObject *__pyx_n_s_FIELDSPLIT;
static PyObject *__pyx_n_s_FINAL;
static PyObject *__pyx_n_s_FINAL_ASSEMBLY;
static PyObject *__pyx_n_s_FINAL_ONLY;
static PyObject *__pyx_n_s_FLUSH;
static PyObject *__pyx_n_s_FLUSH_ASSEMBLY;
static PyObject *__pyx_n_s_FORCE_DIAGONAL_ENTRIES;
static PyObject *__pyx_n_s_FOREST;
static PyObject *__pyx_n_s_FORWARD;
static PyObject *__pyx_n_s_FORWARD_LOCAL;
static PyObject *__pyx_n_s_FORWARD_SWEEP;
static PyObject *__pyx_n_s_FRB;
static PyObject *__pyx_n_s_FROBENIUS;
static PyObject *__pyx_n_s_FRONT;
static PyObject *__pyx_n_s_FRONT_DOWN;
static PyObject *__pyx_n_s_FRONT_DOWN_LEFT;
static PyObject *__pyx_n_s_FRONT_DOWN_RIGHT;
static PyObject *__pyx_n_s_FRONT_LEFT;
static PyObject *__pyx_n_s_FRONT_RIGHT;
static PyObject *__pyx_n_s_FRONT_UP;
static PyObject *__pyx_n_s_FRONT_UP_LEFT;
static PyObject *__pyx_n_s_FRONT_UP_RIGHT;
static PyObject *__pyx_n_s_FULL;
static PyObject *__pyx_n_s_FULL_SIZE;
static PyObject *__pyx_n_s_FV_GHOST;
static PyObject *__pyx_n_s_FactorShiftType;
static PyObject *__pyx_n_s_FailedReason;
static PyObject *__pyx_n_s_FileMode;
static PyObject *__pyx_n_s_Format;
static PyObject *__pyx_n_s_Free;
static PyObject *__pyx_n_s_G;
static PyObject *__pyx_n_s_GALERKIN;
static PyObject *__pyx_n_s_GAMG;
static PyObject *__pyx_n_s_GAMGType;
static PyObject *__pyx_n_s_GASM;
static PyObject *__pyx_n_s_GASMType;
static PyObject *__pyx_n_s_GATHER;
static PyObject *__pyx_n_s_GATHERV;
static PyObject *__pyx_n_s_GCR;
static PyObject *__pyx_n_s_GENERAL;
static PyObject *__pyx_n_s_GEO;
static PyObject *__pyx_n_s_GETROW_UPPERTRIANGULAR;
static PyObject *__pyx_n_s_GHOSTED;
static PyObject *__pyx_kp_s_GIT_Date;
static PyObject *__pyx_n_s_GLEE;
static PyObject *__pyx_n_s_GLLE;
static PyObject *__pyx_n_s_GLMapMode;
static PyObject *__pyx_n_s_GLOBAL_BLOCKING;
static PyObject *__pyx_n_s_GLOBAL_MAX;
static PyObject *__pyx_n_s_GLOBAL_NONBLOCKING;
static PyObject *__pyx_n_s_GLOBAL_SUM;
static PyObject *__pyx_n_s_GLTR;
static PyObject *__pyx_n_s_GLVIS;
static PyObject *__pyx_n_s_GMRES;
static PyObject *__pyx_n_s_GPCG;
static PyObject *__pyx_n_s_GROPPCG;
static PyObject *__pyx_n_s_Get_rank;
static PyObject *__pyx_n_s_Get_size;
static PyObject *__pyx_kp_s_Given_d_column_indices_but_d_non;
static PyObject *__pyx_n_s_H;
static PyObject *__pyx_n_s_H2OPUS;
static PyObject *__pyx_n_s_HAAR;
static PyObject *__pyx_n_s_HALF;
static PyObject *__pyx_n_s_HALF_SIZE;
static PyObject *__pyx_n_s_HASH;
static PyObject *__pyx_n_s_HDF5;
static PyObject *__pyx_n_s_HDF5_MAT;
static PyObject *__pyx_n_s_HDF5_PETSC;
static PyObject *__pyx_n_s_HDF5_VIZ;
static PyObject *__pyx_n_s_HDF5_XDMF;
static PyObject *__pyx_n_s_HERMITIAN;
static PyObject *__pyx_n_s_HERMITIANTRANSPOSE;
static PyObject *__pyx_n_s_HEXAHEDRON;
static PyObject *__pyx_n_s_HIP;
static PyObject *__pyx_n_s_HMG;
static PyObject *__pyx_n_s_HOST;
static PyObject *__pyx_n_s_HPDDM;
static PyObject *__pyx_n_s_HPDDMCoarseCorrectionType;
static PyObject *__pyx_n_s_HYPRE;
static PyObject *__pyx_n_s_HYPRESSTRUCT;
static PyObject *__pyx_n_s_HYPRESTRUCT;
static PyObject *__pyx_n_s_I;
static PyObject *__pyx_n_s_IBCGS;
static PyObject *__pyx_n_s_ICC;
static PyObject *__pyx_n_s_IGNORE_LOWER_TRIANGULAR;
static PyObject *__pyx_n_s_IGNORE_NEGATIVE_INDICES;
static PyObject *__pyx_n_s_IGNORE_OFF_PROC_ENTRIES;
static PyObject *__pyx_n_s_IGNORE_ZERO_ENTRIES;
static PyObject *__pyx_n_s_ILU;
static PyObject *__pyx_n_s_IMPLICIT;
static PyObject *__pyx_n_s_INBLOCKS;
static PyObject *__pyx_n_s_INF;
static PyObject *__pyx_n_s_INFINITY;
static PyObject *__pyx_n_s_INITIAL_FINAL_ONLY;
static PyObject *__pyx_n_s_INITIAL_ONLY;
static PyObject *__pyx_n_s_INSERT;
static PyObject *__pyx_n_s_INSERT_ALL;
static PyObject *__pyx_n_s_INSERT_ALL_VALUES;
static PyObject *__pyx_n_s_INSERT_BC;
static PyObject *__pyx_n_s_INSERT_BC_VALUES;
static PyObject *__pyx_n_s_INSERT_VALUES;
static PyObject *__pyx_n_s_INTERIOR_GHOST;
static PyObject *__pyx_n_s_INTERPOLATE;
static PyObject *__pyx_n_s_IPM;
static PyObject *__pyx_n_s_IS;
static PyObject *__pyx_n_s_ISType;
static PyObject *__pyx_n_s_IS_buffer;
static PyObject *__pyx_n_s_ITERATING;
static PyObject *__pyx_kp_s_I_0_is_d_expected_d;
static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
static PyObject *__pyx_n_s_InfoType;
static PyObject *__pyx_kp_s_Input_vector_has_no_tensor_infor;
static PyObject *__pyx_n_s_InsertMode;
static PyObject *__pyx_n_s_IntType;
static PyObject *__pyx_n_s_InterpolationType;
static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
static PyObject *__pyx_kp_s_Invalid_mode_expected_r_w_or_rw;
static PyObject *__pyx_kp_s_Invalid_mode_expected_rw_r_or_w;
static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
static PyObject *__pyx_n_s_J;
static PyObject *__pyx_n_s_JACOBI;
static PyObject *__pyx_n_s_JoinMode;
static PyObject *__pyx_n_s_KACZMARZ;
static PyObject *__pyx_n_s_KAIJ;
static PyObject *__pyx_n_s_KASKADE;
static PyObject *__pyx_n_s_KEEP_NONZERO_PATTERN;
static PyObject *__pyx_n_s_KLU;
static PyObject *__pyx_n_s_KOKKOS;
static PyObject *__pyx_n_s_KSP;
static PyObject *__pyx_n_s_KSPConvergedReason;
static PyObject *__pyx_n_s_KSPNormType;
static PyObject *__pyx_n_s_KSPONLY;
static PyObject *__pyx_n_s_KSPTRANSPOSEONLY;
static PyObject *__pyx_n_s_KSPType;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_L;
static PyObject *__pyx_n_s_LAGRANGE;
static PyObject *__pyx_n_s_LAYOUT_GAUSS;
static PyObject *__pyx_n_s_LAYOUT_REGULAR;
static PyObject *__pyx_n_s_LAYOUT_SUBDIVISION;
static PyObject *__pyx_n_s_LCD;
static PyObject *__pyx_n_s_LCL;
static PyObject *__pyx_n_s_LEFT;
static PyObject *__pyx_n_s_LGMRES;
static PyObject *__pyx_n_s_LGMap;
static PyObject *__pyx_n_s_LGMapType;
static PyObject *__pyx_n_s_LINEAR;
static PyObject *__pyx_n_s_LMVM;
static PyObject *__pyx_n_s_LMVMBADBROYDEN;
static PyObject *__pyx_n_s_LMVMBFGS;
static PyObject *__pyx_n_s_LMVMBROYDEN;
static PyObject *__pyx_n_s_LMVMDFP;
static PyObject *__pyx_n_s_LMVMDIAGBBROYDEN;
static PyObject *__pyx_n_s_LMVMSR1;
static PyObject *__pyx_n_s_LMVMSYMBADBROYDEN;
static PyObject *__pyx_n_s_LMVMSYMBROYDEN;
static PyObject *__pyx_n_s_LOAD_BALANCE;
static PyObject *__pyx_n_s_LOCAL;
static PyObject *__pyx_n_s_LOCALREF;
static PyObject *__pyx_n_s_LOCAL_BACKWARD_SWEEP;
static PyObject *__pyx_n_s_LOCAL_FORWARD_SWEEP;
static PyObject *__pyx_n_s_LOCAL_SYMMETRIC_SWEEP;
static PyObject *__pyx_n_s_LOWER;
static PyObject *__pyx_n_s_LRC;
static PyObject *__pyx_n_s_LSC;
static PyObject *__pyx_n_s_LSQR;
static PyObject *__pyx_n_s_LU;
static PyObject *__pyx_n_s_LUSOL;
static PyObject *__pyx_n_s_Left;
static PyObject *__pyx_n_s_Log;
static PyObject *__pyx_n_s_LogClass;
static PyObject *__pyx_n_s_LogEvent;
static PyObject *__pyx_n_s_LogStage;
static PyObject *__pyx_n_s_MAIJ;
static PyObject *__pyx_n_s_MAPPING;
static PyObject *__pyx_n_s_MASK;
static PyObject *__pyx_n_s_MAT;
static PyObject *__pyx_n_s_MATCHSTEP;
static PyObject *__pyx_n_s_MATHEMATICA;
static PyObject *__pyx_n_s_MATLAB;
static PyObject *__pyx_n_s_MATPARTITIONING;
static PyObject *__pyx_n_s_MAX;
static PyObject *__pyx_n_s_MAX_VALUES;
static PyObject *__pyx_n_s_MEMORYSCALABLE;
static PyObject *__pyx_n_s_METISND;
static PyObject *__pyx_n_s_MEYER;
static PyObject *__pyx_n_s_MFFD;
static PyObject *__pyx_n_s_MG;
static PyObject *__pyx_n_s_MGCycleType;
static PyObject *__pyx_n_s_MGType;
static PyObject *__pyx_n_s_MIGRATE_BASIC;
static PyObject *__pyx_n_s_MIGRATE_DMCELLEXACT;
static PyObject *__pyx_n_s_MIGRATE_DMCELLNSCATTER;
static PyObject *__pyx_n_s_MIGRATE_USER;
static PyObject *__pyx_n_s_MIMEX;
static PyObject *__pyx_n_s_MINRES;
static PyObject *__pyx_n_s_MIRROR;
static PyObject *__pyx_n_s_MKL_CPARDISO;
static PyObject *__pyx_n_s_MKL_PARDISO;
static PyObject *__pyx_n_s_ML;
static PyObject *__pyx_n_s_MOAB;
static PyObject *__pyx_n_s_MPI;
static PyObject *__pyx_n_s_MPIADJ;
static PyObject *__pyx_n_s_MPIAIJ;
static PyObject *__pyx_n_s_MPIAIJCRL;
static PyObject *__pyx_n_s_MPIAIJCUSPARSE;
static PyObject *__pyx_n_s_MPIAIJMKL;
static PyObject *__pyx_n_s_MPIAIJPERM;
static PyObject *__pyx_n_s_MPIAIJSELL;
static PyObject *__pyx_n_s_MPIAIJVIENNACL;
static PyObject *__pyx_n_s_MPIBAIJ;
static PyObject *__pyx_n_s_MPIBAIJMKL;
static PyObject *__pyx_n_s_MPICUDA;
static PyObject *__pyx_n_s_MPIDENSE;
static PyObject *__pyx_n_s_MPIDENSECUDA;
static PyObject *__pyx_n_s_MPIHIP;
static PyObject *__pyx_n_s_MPIKAIJ;
static PyObject *__pyx_n_s_MPIKOKKOS;
static PyObject *__pyx_n_s_MPIMAIJ;
static PyObject *__pyx_n_s_MPISBAIJ;
static PyObject *__pyx_n_s_MPISELL;
static PyObject *__pyx_n_s_MPIVIENNACL;
static PyObject *__pyx_kp_s_MPI_Error;
static PyObject *__pyx_n_s_MPRK;
static PyObject *__pyx_n_s_MS;
static PyObject *__pyx_n_s_MULTIPLICATIVE;
static PyObject *__pyx_n_s_MUMPS;
static PyObject *__pyx_n_s_MapMode;
static PyObject *__pyx_n_s_Mat;
static PyObject *__pyx_n_s_MatAssemblyType;
static PyObject *__pyx_n_s_MatDuplicateOption;
static PyObject *__pyx_n_s_MatFactorShiftType;
static PyObject *__pyx_n_s_MatInfoType;
static PyObject *__pyx_n_s_MatOption;
static PyObject *__pyx_n_s_MatOrderingType;
static PyObject *__pyx_n_s_MatPartitioning;
static PyObject *__pyx_n_s_MatPartitioningType;
static PyObject *__pyx_n_s_MatSORType;
static PyObject *__pyx_n_s_MatSolverType;
static PyObject *__pyx_n_s_MatStructure;
static PyObject *__pyx_n_s_MatType;
static PyObject *__pyx_n_s_Mat_Stencil;
static PyObject *__pyx_n_s_MemoryError;
static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
static PyObject *__pyx_kp_s_MemoryView_of_r_object;
static PyObject *__pyx_n_s_MigrateType;
static PyObject *__pyx_kp_s_Missing_input_parameters;
static PyObject *__pyx_n_s_Mode;
static PyObject *__pyx_kp_s_Must_provide_as_many_communicato;
static PyObject *__pyx_kp_s_Must_provide_both_sizes_and_poin;
static PyObject *__pyx_kp_s_Must_provide_operator_for_USER_o;
static PyObject *__pyx_n_s_N1;
static PyObject *__pyx_n_s_N12;
static PyObject *__pyx_n_s_N2;
static PyObject *__pyx_n_s_NASH;
static PyObject *__pyx_n_s_NASM;
static PyObject *__pyx_n_s_NATIVE;
static PyObject *__pyx_n_s_NATURAL;
static PyObject *__pyx_n_s_NCG;
static PyObject *__pyx_n_s_ND;
static PyObject *__pyx_n_s_ND_Pi;
static PyObject *__pyx_n_s_ND_Pi_Full;
static PyObject *__pyx_n_s_NEIGHBOR;
static PyObject *__pyx_n_s_NEST;
static PyObject *__pyx_n_s_NETWORK;
static PyObject *__pyx_n_s_NEWTONLS;
static PyObject *__pyx_n_s_NEWTONTR;
static PyObject *__pyx_n_s_NEW_NONZERO_ALLOCATION_ERR;
static PyObject *__pyx_n_s_NEW_NONZERO_LOCATIONS;
static PyObject *__pyx_n_s_NEW_NONZERO_LOCATION_ERR;
static PyObject *__pyx_n_s_NGMRES;
static PyObject *__pyx_n_s_NGS;
static PyObject *__pyx_n_s_NINFINITY;
static PyObject *__pyx_n_s_NLS;
static PyObject *__pyx_n_s_NM;
static PyObject *__pyx_n_s_NN;
static PyObject *__pyx_n_s_NO;
static PyObject *__pyx_n_s_NOERROR;
static PyObject *__pyx_n_s_NOFORMAT;
static PyObject *__pyx_n_s_NONE;
static PyObject *__pyx_n_s_NONLINEAR;
static PyObject *__pyx_n_s_NONZERO;
static PyObject *__pyx_n_s_NORMAL;
static PyObject *__pyx_n_s_NORMALHERMITIAN;
static PyObject *__pyx_n_s_NORM_1;
static PyObject *__pyx_n_s_NORM_1_AND_2;
static PyObject *__pyx_n_s_NORM_2;
static PyObject *__pyx_n_s_NORM_ALWAYS;
static PyObject *__pyx_n_s_NORM_DEFAULT;
static PyObject *__pyx_n_s_NORM_FINAL_ONLY;
static PyObject *__pyx_n_s_NORM_FROBENIUS;
static PyObject *__pyx_n_s_NORM_INFINITY;
static PyObject *__pyx_n_s_NORM_INITIAL_FINAL_ONLY;
static PyObject *__pyx_n_s_NORM_INITIAL_ONLY;
static PyObject *__pyx_n_s_NORM_MAX;
static PyObject *__pyx_n_s_NORM_NATURAL;
static PyObject *__pyx_n_s_NORM_NONE;
static PyObject *__pyx_n_s_NORM_PRECONDITIONED;
static PyObject *__pyx_n_s_NORM_UNPRECONDITIONED;
static PyObject *__pyx_n_s_NOTSET;
static PyObject *__pyx_n_s_NOT_SET_VALUES;
static PyObject *__pyx_n_s_NO_OFF_PROC_ENTRIES;
static PyObject *__pyx_n_s_NO_OFF_PROC_ZERO_ROWS;
static PyObject *__pyx_n_s_NO_SYNC;
static PyObject *__pyx_n_s_NRICHARDSON;
static PyObject *__pyx_n_s_NTL;
static PyObject *__pyx_n_s_NTR;
static PyObject *__pyx_n_s_NULLLOC;
static PyObject *__pyx_n_s_NZ;
static PyObject *__pyx_n_s_NormSchedule;
static PyObject *__pyx_n_s_NormType;
static PyObject *__pyx_n_s_NotImplemented;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_kp_s_Not_for_rectangular_matrices;
static PyObject *__pyx_kp_s_Not_for_type;
static PyObject *__pyx_n_s_NullSpace;
static PyObject *__pyx_n_b_O;
static PyObject *__pyx_n_s_ODE_EXPLICIT;
static PyObject *__pyx_n_s_ODE_IMPLICIT;
static PyObject *__pyx_n_s_OPENCL;
static PyObject *__pyx_n_s_OPTION_MAX;
static PyObject *__pyx_n_s_OPTION_MIN;
static PyObject *__pyx_n_s_OWD;
static PyObject *__pyx_n_s_OWLQN;
static PyObject *__pyx_n_s_Object;
static PyObject *__pyx_kp_s_Object_is_not_writable;
static PyObject *__pyx_n_s_Option;
static PyObject *__pyx_n_s_Options;
static PyObject *__pyx_n_s_OrderingType;
static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
static PyObject *__pyx_kp_s_Out_of_memory_Allocated_d_Used_b;
static PyObject *__pyx_n_s_P;
static PyObject *__pyx_n_s_P1;
static PyObject *__pyx_n_s_P4EST;
static PyObject *__pyx_n_s_P8EST;
static PyObject *__pyx_n_s_PARDECOMP;
static PyObject *__pyx_n_s_PARMETIS;
static PyObject *__pyx_n_s_PARMS;
static PyObject *__pyx_n_s_PARTITIONINGAVERAGE;
static PyObject *__pyx_n_s_PARTITIONINGCHACO;
static PyObject *__pyx_n_s_PARTITIONINGCURRENT;
static PyObject *__pyx_n_s_PARTITIONINGHIERARCH;
static PyObject *__pyx_n_s_PARTITIONINGPARMETIS;
static PyObject *__pyx_n_s_PARTITIONINGPARTY;
static PyObject *__pyx_n_s_PARTITIONINGPTSCOTCH;
static PyObject *__pyx_n_s_PARTITIONINGSQUARE;
static PyObject *__pyx_n_s_PASTIX;
static PyObject *__pyx_n_s_PATCH;
static PyObject *__pyx_n_s_PBJACOBI;
static PyObject *__pyx_n_s_PC;
static PyObject *__pyx_n_s_PCASMType;
static PyObject *__pyx_n_s_PCCompositeType;
static PyObject *__pyx_n_s_PCDeflationSpaceType;
static PyObject *__pyx_n_s_PCFailedReason;
static PyObject *__pyx_n_s_PCFieldSplitSchurFactType;
static PyObject *__pyx_n_s_PCFieldSplitSchurPreType;
static PyObject *__pyx_n_s_PCGAMGType;
static PyObject *__pyx_n_s_PCGASMType;
static PyObject *__pyx_n_s_PCHPDDMCoarseCorrectionType;
static PyObject *__pyx_n_s_PCMGCycleType;
static PyObject *__pyx_n_s_PCMGType;
static PyObject *__pyx_n_s_PCPatchConstructType;
static PyObject *__pyx_n_s_PCSide;
static PyObject *__pyx_n_s_PCType;
static PyObject *__pyx_n_s_PD;
static PyObject *__pyx_n_s_PDIPM;
static PyObject *__pyx_n_s_PERIODIC;
static PyObject *__pyx_n_s_PETSC;
static PyObject *__pyx_kp_s_PETSc_Error_d;
static PyObject *__pyx_n_s_PFMG;
static PyObject *__pyx_n_s_PGMRES;
static PyObject *__pyx_n_s_PIC;
static PyObject *__pyx_n_s_PICLayoutType;
static PyObject *__pyx_n_s_PINFINITY;
static PyObject *__pyx_n_s_PIPEBCGS;
static PyObject *__pyx_n_s_PIPECG;
static PyObject *__pyx_n_s_PIPECG2;
static PyObject *__pyx_n_s_PIPECGRR;
static PyObject *__pyx_n_s_PIPECR;
static PyObject *__pyx_n_s_PIPEFCG;
static PyObject *__pyx_n_s_PIPEFGMRES;
static PyObject *__pyx_n_s_PIPEGCR;
static PyObject *__pyx_n_s_PIPELCG;
static PyObject *__pyx_n_s_PIPEPRCG;
static PyObject *__pyx_n_s_PLEX;
static PyObject *__pyx_n_s_POINT;
static PyObject *__pyx_n_s_POINT_PRISM_TENSOR;
static PyObject *__pyx_n_s_POLYNOMIAL;
static PyObject *__pyx_n_s_POSITIVE_DEFINITE;
static PyObject *__pyx_n_s_POUNDERS;
static PyObject *__pyx_n_s_PREALLOCATOR;
static PyObject *__pyx_n_s_PRECONDITIONED;
static PyObject *__pyx_n_s_PREONLY;
static PyObject *__pyx_n_s_PRODUCT;
static PyObject *__pyx_n_s_PSEUDO;
static PyObject *__pyx_n_s_PTRIMMED;
static PyObject *__pyx_n_s_PTSCOTCH;
static PyObject *__pyx_n_s_PYRAMID;
static PyObject *__pyx_n_s_PYTHON;
static PyObject *__pyx_n_s_Partitioner;
static PyObject *__pyx_n_s_PartitionerType;
static PyObject *__pyx_n_s_PatchConstructType;
static PyObject *__pyx_n_s_PickleError;
static PyObject *__pyx_n_s_PolytopeType;
static PyObject *__pyx_kp_u_Portable_Extensible_Toolkit_for;
static PyObject *__pyx_n_s_Print;
static PyObject *__pyx_n_s_ProblemType;
static PyObject *__pyx_n_s_PtAP;
static PyObject *__pyx_n_s_Q0;
static PyObject *__pyx_n_s_Q1;
static PyObject *__pyx_n_s_QCG;
static PyObject *__pyx_n_s_QMD;
static PyObject *__pyx_n_s_QMRCGS;
static PyObject *__pyx_n_s_QN;
static PyObject *__pyx_n_s_QR;
static PyObject *__pyx_n_s_QUADRILATERAL;
static PyObject *__pyx_n_s_QUAD_PRISM_TENSOR;
static PyObject *__pyx_n_s_QUARTER;
static PyObject *__pyx_n_s_QUARTER_SIZE;
static PyObject *__pyx_n_s_Quad;
static PyObject *__pyx_n_s_R;
static PyObject *__pyx_n_s_RADAU5;
static PyObject *__pyx_n_s_RAND;
static PyObject *__pyx_n_s_RAND48;
static PyObject *__pyx_n_s_RANDER48;
static PyObject *__pyx_n_s_RANDOM123;
static PyObject *__pyx_n_s_RARt;
static PyObject *__pyx_n_s_RCM;
static PyObject *__pyx_n_s_READ;
static PyObject *__pyx_n_s_REDISTRIBUTE;
static PyObject *__pyx_n_s_REDUNDANT;
static PyObject *__pyx_n_s_REFINE1D;
static PyObject *__pyx_n_s_REFINEALFELD;
static PyObject *__pyx_n_s_REFINEBOUNDARYLAYER;
static PyObject *__pyx_n_s_REFINED;
static PyObject *__pyx_n_s_REFINEPOWELLSABIN;
static PyObject *__pyx_n_s_REFINEREGULAR;
static PyObject *__pyx_n_s_REFINESBR;
static PyObject *__pyx_n_s_REFINETOBOX;
static PyObject *__pyx_n_s_REFINETOSIMPLEX;
static PyObject *__pyx_n_s_RESTRICT;
static PyObject *__pyx_n_s_REVERSE;
static PyObject *__pyx_n_s_REVERSE_LOCAL;
static PyObject *__pyx_n_s_RICHARDSON;
static PyObject *__pyx_n_s_RIGHT;
static PyObject *__pyx_n_s_RK;
static PyObject *__pyx_n_s_RK1FE;
static PyObject *__pyx_n_s_RK2A;
static PyObject *__pyx_n_s_RK2B;
static PyObject *__pyx_n_s_RK3;
static PyObject *__pyx_n_s_RK3BS;
static PyObject *__pyx_n_s_RK4;
static PyObject *__pyx_n_s_RK5BS;
static PyObject *__pyx_n_s_RK5DP;
static PyObject *__pyx_n_s_RK5F;
static PyObject *__pyx_n_s_RK6VR;
static PyObject *__pyx_n_s_RK7VR;
static PyObject *__pyx_n_s_RK8VR;
static PyObject *__pyx_n_s_RKType;
static PyObject *__pyx_n_s_ROSW;
static PyObject *__pyx_n_s_ROWLENGTH;
static PyObject *__pyx_n_s_ROWSCALINGVIENNACL;
static PyObject *__pyx_n_s_ROW_ORIENTED;
static PyObject *__pyx_n_s_RT_Pi;
static PyObject *__pyx_n_s_RT_Pi_Full;
static PyObject *__pyx_n_s_RUNGE_KUTTA;
static PyObject *__pyx_n_s_Random;
static PyObject *__pyx_n_s_RandomType;
static PyObject *__pyx_n_s_RealType;
static PyObject *__pyx_n_s_Reason;
static PyObject *__pyx_n_s_ReorderDefaultFlag;
static PyObject *__pyx_n_s_Right;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_S;
static PyObject *__pyx_n_s_SAME;
static PyObject *__pyx_n_s_SAME_NONZERO_PATTERN;
static PyObject *__pyx_n_s_SAME_NZ;
static PyObject *__pyx_n_s_SAVIENNACL;
static PyObject *__pyx_n_s_SAWS;
static PyObject *__pyx_n_s_SBAIJ;
static PyObject *__pyx_n_s_SCALAPACK;
static PyObject *__pyx_n_s_SCATTER;
static PyObject *__pyx_n_s_SCATTER_FORWARD;
static PyObject *__pyx_n_s_SCATTER_FORWARD_LOCAL;
static PyObject *__pyx_n_s_SCATTER_REVERSE;
static PyObject *__pyx_n_s_SCATTER_REVERSE_LOCAL;
static PyObject *__pyx_n_s_SCHUR;
static PyObject *__pyx_n_s_SCHURCOMPLEMENT;
static PyObject *__pyx_n_s_SEGMENT;
static PyObject *__pyx_n_s_SEG_PRISM_TENSOR;
static PyObject *__pyx_n_s_SELF;
static PyObject *__pyx_n_s_SELFP;
static PyObject *__pyx_n_s_SELL;
static PyObject *__pyx_n_s_SEQ;
static PyObject *__pyx_n_s_SEQAIJ;
static PyObject *__pyx_n_s_SEQAIJCRL;
static PyObject *__pyx_n_s_SEQAIJCUSPARSE;
static PyObject *__pyx_n_s_SEQAIJMKL;
static PyObject *__pyx_n_s_SEQAIJPERM;
static PyObject *__pyx_n_s_SEQAIJSELL;
static PyObject *__pyx_n_s_SEQAIJVIENNACL;
static PyObject *__pyx_n_s_SEQBAIJ;
static PyObject *__pyx_n_s_SEQBAIJMKL;
static PyObject *__pyx_n_s_SEQCUDA;
static PyObject *__pyx_n_s_SEQCUFFT;
static PyObject *__pyx_n_s_SEQDENSE;
static PyObject *__pyx_n_s_SEQDENSECUDA;
static PyObject *__pyx_n_s_SEQHIP;
static PyObject *__pyx_n_s_SEQKAIJ;
static PyObject *__pyx_n_s_SEQKOKKOS;
static PyObject *__pyx_n_s_SEQMAIJ;
static PyObject *__pyx_n_s_SEQSBAIJ;
static PyObject *__pyx_n_s_SEQSELL;
static PyObject *__pyx_n_s_SEQVIENNACL;
static PyObject *__pyx_n_s_SETUP_ERROR;
static PyObject *__pyx_n_s_SF;
static PyObject *__pyx_n_s_SFType;
static PyObject *__pyx_n_s_SHARED;
static PyObject *__pyx_n_s_SHARE_NONZERO_PATTERN;
static PyObject *__pyx_n_s_SHELL;
static PyObject *__pyx_n_s_SIMPLE;
static PyObject *__pyx_n_s_SLICED;
static PyObject *__pyx_n_s_SNES;
static PyObject *__pyx_n_s_SNESConvergedReason;
static PyObject *__pyx_n_s_SNESNormSchedule;
static PyObject *__pyx_n_s_SNESType;
static PyObject *__pyx_n_s_SOCKET;
static PyObject *__pyx_n_s_SOR;
static PyObject *__pyx_n_s_SORTED_FULL;
static PyObject *__pyx_n_s_SORType;
static PyObject *__pyx_n_s_SPAI;
static PyObject *__pyx_n_s_SPARSEELEMENTAL;
static PyObject *__pyx_n_s_SPD;
static PyObject *__pyx_n_s_SPECIAL;
static PyObject *__pyx_n_s_SPECTRAL;
static PyObject *__pyx_n_s_SPQR;
static PyObject *__pyx_n_s_SPRNG;
static PyObject *__pyx_n_s_SSFLS;
static PyObject *__pyx_n_s_SSILS;
static PyObject *__pyx_n_s_SSP;
static PyObject *__pyx_n_s_STAG;
static PyObject *__pyx_n_s_STANDARD;
static PyObject *__pyx_n_s_STAR;
static PyObject *__pyx_n_s_STCG;
static PyObject *__pyx_n_s_STDERR;
static PyObject *__pyx_n_s_STDOUT;
static PyObject *__pyx_n_s_STEPOVER;
static PyObject *__pyx_n_s_STRIDE;
static PyObject *__pyx_n_s_STRING;
static PyObject *__pyx_n_s_STRUCTURALLY_SYMMETRIC;
static PyObject *__pyx_n_s_STRUCTURE_ONLY;
static PyObject *__pyx_n_s_STRUMPACK;
static PyObject *__pyx_n_s_SUBMATRIX;
static PyObject *__pyx_n_s_SUBMAT_SINGLEIS;
static PyObject *__pyx_n_s_SUBPC_ERROR;
static PyObject *__pyx_n_s_SUBSET;
static PyObject *__pyx_n_s_SUBSET_NONZERO_PATTERN;
static PyObject *__pyx_n_s_SUBSET_NZ;
static PyObject *__pyx_n_s_SUBSET_OFF_PROC_ENTRIES;
static PyObject *__pyx_n_s_SUBSPACE;
static PyObject *__pyx_n_s_SUM;
static PyObject *__pyx_n_s_SUNDIALS;
static PyObject *__pyx_n_s_SUPERLU;
static PyObject *__pyx_n_s_SUPERLU_DIST;
static PyObject *__pyx_n_s_SVD;
static PyObject *__pyx_n_s_SWARM;
static PyObject *__pyx_n_s_SYCL;
static PyObject *__pyx_n_s_SYMMETRIC;
static PyObject *__pyx_n_s_SYMMETRIC_MULTIPLICATIVE;
static PyObject *__pyx_n_s_SYMMETRY_ETERNAL;
static PyObject *__pyx_n_s_SYMMETRY_SWEEP;
static PyObject *__pyx_n_s_SYMMLQ;
static PyObject *__pyx_n_s_SYNC;
static PyObject *__pyx_n_s_SYSPFMG;
static PyObject *__pyx_n_s_ScalarType;
static PyObject *__pyx_n_s_Scatter;
static PyObject *__pyx_n_s_ScatterMode;
static PyObject *__pyx_n_s_ScatterType;
static PyObject *__pyx_n_s_SchurFactType;
static PyObject *__pyx_n_s_SchurPreType;
static PyObject *__pyx_n_s_Section;
static PyObject *__pyx_n_s_Side;
static PyObject *__pyx_n_s_Size;
static PyObject *__pyx_n_s_SolverType;
static PyObject *__pyx_n_s_Space;
static PyObject *__pyx_n_s_SpaceType;
static PyObject *__pyx_n_s_Stage;
static PyObject *__pyx_n_s_Stencil;
static PyObject *__pyx_n_s_StencilLocation;
static PyObject *__pyx_n_s_StencilType;
static PyObject *__pyx_n_s_StreamType;
static PyObject *__pyx_n_s_Structure;
static PyObject *__pyx_n_s_Sys;
static PyObject *__pyx_n_s_SystemError;
static PyObject *__pyx_n_s_T;
static PyObject *__pyx_n_s_TAO;
static PyObject *__pyx_n_s_TAOConvergedReason;
static PyObject *__pyx_n_s_TAOType;
static PyObject *__pyx_kp_s_TAO_Solver_Termination_Reasons;
static PyObject *__pyx_kp_s_TAO_Solver_Types;
static PyObject *__pyx_n_s_TCQMR;
static PyObject *__pyx_n_s_TELESCOPE;
static PyObject *__pyx_n_s_TENSOR;
static PyObject *__pyx_n_s_TETRAHEDRON;
static PyObject *__pyx_n_s_TFQMR;
static PyObject *__pyx_n_s_TFS;
static PyObject *__pyx_n_s_TH;
static PyObject *__pyx_n_s_THETA;
static PyObject *__pyx_n_s_THIRD;
static PyObject *__pyx_n_s_THIRD_SIZE;
static PyObject *__pyx_n_s_TRANSFORMFILTER;
static PyObject *__pyx_n_s_TRANSPOSE;
static PyObject *__pyx_n_s_TRIANGLE;
static PyObject *__pyx_n_s_TRI_PRISM;
static PyObject *__pyx_n_s_TRI_PRISM_TENSOR;
static PyObject *__pyx_n_s_TRON;
static PyObject *__pyx_n_s_TRUE;
static PyObject *__pyx_n_s_TS;
static PyObject *__pyx_n_s_TSARKIMEXType;
static PyObject *__pyx_n_s_TSConvergedReason;
static PyObject *__pyx_n_s_TSEquationType;
static PyObject *__pyx_n_s_TSExactFinalTime;
static PyObject *__pyx_n_s_TSIRM;
static PyObject *__pyx_n_s_TSProblemType;
static PyObject *__pyx_n_s_TSRKType;
static PyObject *__pyx_n_s_TSType;
static PyObject *__pyx_n_s_TWIST;
static PyObject *__pyx_kp_b_T_2;
static PyObject *__pyx_kp_s_Tensor_dtype_does_not_match_PETS;
static PyObject *__pyx_n_s_Type;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_U;
static PyObject *__pyx_n_s_UA;
static PyObject *__pyx_n_s_UMFPACK;
static PyObject *__pyx_n_s_UNKNOWN;
static PyObject *__pyx_n_s_UNKNOWN_NONZERO_PATTERN;
static PyObject *__pyx_n_s_UNKNOWN_NZ;
static PyObject *__pyx_n_s_UNPRECONDITIONED;
static PyObject *__pyx_n_s_UNSPECIFIED;
static PyObject *__pyx_n_s_UNUSED_NONZERO_LOCATION_ERR;
static PyObject *__pyx_n_s_UP;
static PyObject *__pyx_n_s_UPDATE;
static PyObject *__pyx_n_s_UPPER;
static PyObject *__pyx_n_s_UP_LEFT;
static PyObject *__pyx_n_s_UP_RIGHT;
static PyObject *__pyx_n_s_USER;
static PyObject *__pyx_n_s_USE_HASH_TABLE;
static PyObject *__pyx_n_s_USE_INODES;
static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
static PyObject *__pyx_kp_s_Unsupported_PetscScalar_type;
static PyObject *__pyx_n_s_V;
static PyObject *__pyx_n_s_VANKA;
static PyObject *__pyx_n_s_VIENNACL;
static PyObject *__pyx_n_s_VINEWTONRSLS;
static PyObject *__pyx_n_s_VINEWTONSSLS;
static PyObject *__pyx_n_s_VPBJACOBI;
static PyObject *__pyx_n_s_VTK;
static PyObject *__pyx_n_s_VTK_VTR;
static PyObject *__pyx_n_s_VTK_VTS;
static PyObject *__pyx_n_s_VTK_VTU;
static PyObject *__pyx_n_s_VU;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_Vec;
static PyObject *__pyx_n_s_VecOption;
static PyObject *__pyx_n_s_VecType;
static PyObject *__pyx_n_s_Vec_LocalForm;
static PyObject *__pyx_n_s_Vec_buffer;
static PyObject *__pyx_kp_s_Vector_local_size_d_is_not_compa;
static PyObject *__pyx_n_s_View_MemoryView;
static PyObject *__pyx_n_s_Viewer;
static PyObject *__pyx_n_s_ViewerFormat;
static PyObject *__pyx_n_s_ViewerHDF5;
static PyObject *__pyx_n_s_ViewerType;
static PyObject *__pyx_n_s_W;
static PyObject *__pyx_n_s_WBM;
static PyObject *__pyx_n_s_WINDOW;
static PyObject *__pyx_n_s_WRITE;
static PyObject *__pyx_n_s_WXY;
static PyObject *__pyx_n_s_X;
static PyObject *__pyx_n_s_ZERO_INITIAL_GUESS;
static PyObject *__pyx_kp_s__13;
static PyObject *__pyx_kp_s__14;
static PyObject *__pyx_kp_u__14;
static PyObject *__pyx_kp_s__20;
static PyObject *__pyx_kp_b__4;
static PyObject *__pyx_kp_s__4;
static PyObject *__pyx_kp_b__57;
static PyObject *__pyx_kp_s__57;
static PyObject *__pyx_kp_b__7;
static PyObject *__pyx_kp_s__7;
static PyObject *__pyx_kp_b__78;
static PyObject *__pyx_kp_b__79;
static PyObject *__pyx_n_s_a;
static PyObject *__pyx_kp_s_a_2;
static PyObject *__pyx_n_s_a_max;
static PyObject *__pyx_n_s_abort;
static PyObject *__pyx_kp_s_accessing_non_existent_buffer_se;
static PyObject *__pyx_n_s_adaptStep;
static PyObject *__pyx_n_s_addFlops;
static PyObject *__pyx_n_s_addv;
static PyObject *__pyx_n_s_adj;
static PyObject *__pyx_n_s_adjoint_steps;
static PyObject *__pyx_n_s_all;
static PyObject *__pyx_n_s_allocate_buffer;
static PyObject *__pyx_n_s_alpha;
static PyObject *__pyx_n_s_alpha2;
static PyObject *__pyx_n_s_alpha_f;
static PyObject *__pyx_n_s_alpha_m;
static PyObject *__pyx_n_s_alphas;
static PyObject *__pyx_n_s_amount;
static PyObject *__pyx_n_s_app;
static PyObject *__pyx_n_s_appctx;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_apply;
static PyObject *__pyx_n_s_applySymmetricLeft;
static PyObject *__pyx_n_s_applySymmetricRight;
static PyObject *__pyx_n_s_applyTranspose;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_array_interface;
static PyObject *__pyx_kp_s_array_size_d_and_vector_local_si;
static PyObject *__pyx_kp_s_array_size_d_incompatible_with_v;
static PyObject *__pyx_n_s_array_w;
static PyObject *__pyx_n_s_asmtype;
static PyObject *__pyx_n_s_assemblies;
static PyObject *__pyx_n_s_assembly;
static PyObject *__pyx_n_s_assemblyBegin;
static PyObject *__pyx_n_s_assemblyEnd;
static PyObject *__pyx_n_s_atexit;
static PyObject *__pyx_n_s_atol;
static PyObject *__pyx_n_s_attr;
static PyObject *__pyx_n_s_au;
static PyObject *__pyx_n_s_author;
static PyObject *__pyx_n_s_authorinfo;
static PyObject *__pyx_n_s_aux;
static PyObject *__pyx_n_s_axpy;
static PyObject *__pyx_n_s_b;
static PyObject *__pyx_n_s_back;
static PyObject *__pyx_n_s_back_down;
static PyObject *__pyx_n_s_back_down_left;
static PyObject *__pyx_n_s_back_down_right;
static PyObject *__pyx_n_s_back_left;
static PyObject *__pyx_n_s_back_right;
static PyObject *__pyx_n_s_back_up;
static PyObject *__pyx_n_s_back_up_left;
static PyObject *__pyx_n_s_back_up_right;
static PyObject *__pyx_n_s_barrier;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_s_batchSize;
static PyObject *__pyx_n_s_bcComps;
static PyObject *__pyx_n_s_bcField;
static PyObject *__pyx_n_s_bcPoints;
static PyObject *__pyx_kp_s_bcPoints_is_a_required_argument;
static PyObject *__pyx_n_s_bdLabel;
static PyObject *__pyx_n_s_bdlabel;
static PyObject *__pyx_n_s_bdvalue;
static PyObject *__pyx_n_s_begin;
static PyObject *__pyx_n_s_begin_args;
static PyObject *__pyx_n_s_begin_kargs;
static PyObject *__pyx_n_s_beta;
static PyObject *__pyx_n_s_bits;
static PyObject *__pyx_n_s_blockSize;
static PyObject *__pyx_n_s_block_size;
static PyObject *__pyx_kp_s_block_size_d_must_be_positive;
static PyObject *__pyx_kp_s_block_size_not_set;
static PyObject *__pyx_n_s_blocksize;
static PyObject *__pyx_n_s_bndr;
static PyObject *__pyx_n_s_boundary;
static PyObject *__pyx_n_s_boundary_type;
static PyObject *__pyx_n_s_boundary_types;
static PyObject *__pyx_n_s_box;
static PyObject *__pyx_n_s_bs;
static PyObject *__pyx_n_s_bsize;
static PyObject *__pyx_n_s_buffer;
static PyObject *__pyx_n_s_buffer_w;
static PyObject *__pyx_n_s_buildResidual;
static PyObject *__pyx_n_s_buildSolution;
static PyObject *__pyx_n_s_builtins;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_u_c;
static PyObject *__pyx_kp_s_c_d;
static PyObject *__pyx_n_s_cancelMonitor;
static PyObject *__pyx_kp_s_cannot_place_input_array_size_d;
static PyObject *__pyx_n_s_catol;
static PyObject *__pyx_n_s_ccomm;
static PyObject *__pyx_n_s_cdctx;
static PyObject *__pyx_n_s_cdevice_type;
static PyObject *__pyx_n_s_cell;
static PyObject *__pyx_n_s_cellNodeMaps;
static PyObject *__pyx_kp_s_cell_indices_must_have_two_dimen;
static PyObject *__pyx_n_s_cells;
static PyObject *__pyx_n_s_cgid;
static PyObject *__pyx_n_s_citation;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_cmap;
static PyObject *__pyx_n_s_cnorm;
static PyObject *__pyx_n_s_coarsen;
static PyObject *__pyx_n_s_coarsenhook;
static PyObject *__pyx_n_s_code;
static PyObject *__pyx_n_s_col;
static PyObject *__pyx_n_s_col_bsize;
static PyObject *__pyx_n_s_cols;
static PyObject *__pyx_n_s_column;
static PyObject *__pyx_kp_s_column_indices_must_have_two_dim;
static PyObject *__pyx_n_s_comm;
static PyObject *__pyx_n_s_comms;
static PyObject *__pyx_kp_s_communicator_not_owned;
static PyObject *__pyx_n_s_comp;
static PyObject *__pyx_n_s_compile;
static PyObject *__pyx_n_s_compressed;
static PyObject *__pyx_n_s_concatenate;
static PyObject *__pyx_n_s_cone;
static PyObject *__pyx_n_s_coneOrientation;
static PyObject *__pyx_n_s_conePoint;
static PyObject *__pyx_n_s_conePos;
static PyObject *__pyx_n_s_conforming;
static PyObject *__pyx_n_s_conjugate;
static PyObject *__pyx_n_s_constant;
static PyObject *__pyx_n_s_constraints;
static PyObject *__pyx_n_s_context;
static PyObject *__pyx_kp_s_contiguous_and_direct;
static PyObject *__pyx_kp_s_contiguous_and_indirect;
static PyObject *__pyx_n_s_continuous;
static PyObject *__pyx_n_s_converged;
static PyObject *__pyx_n_s_coordinates;
static PyObject *__pyx_kp_s_coordinates_must_have_two_dimens;
static PyObject *__pyx_kp_s_coordinates_size_must_be_at_leas;
static PyObject *__pyx_n_s_coords;
static PyObject *__pyx_kp_s_coords_vertices_must_have_two_di;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_correction_type;
static PyObject *__pyx_n_s_count;
static PyObject *__pyx_n_s_cpuarray;
static PyObject *__pyx_n_s_crank;
static PyObject *__pyx_n_s_cratio;
static PyObject *__pyx_n_s_create;
static PyObject *__pyx_n_s_createDefaultSF;
static PyObject *__pyx_n_s_createGlobalVec;
static PyObject *__pyx_n_s_createGlobalVector;
static PyObject *__pyx_n_s_createLabel;
static PyObject *__pyx_n_s_createLocalVec;
static PyObject *__pyx_n_s_createLocalVector;
static PyObject *__pyx_n_s_createMat;
static PyObject *__pyx_n_s_createMatrix;
static PyObject *__pyx_n_s_createNaturalVec;
static PyObject *__pyx_n_s_createNaturalVector;
static PyObject *__pyx_n_s_createSectionSF;
static PyObject *__pyx_n_s_createSubMatrix;
static PyObject *__pyx_n_s_createVecLeft;
static PyObject *__pyx_n_s_createVecRight;
static PyObject *__pyx_n_s_createVecs;
static PyObject *__pyx_n_s_create_gvec;
static PyObject *__pyx_n_s_create_injection;
static PyObject *__pyx_n_s_create_interpolation;
static PyObject *__pyx_n_s_create_lvec;
static PyObject *__pyx_n_s_create_matrix;
static PyObject *__pyx_n_s_create_restriction;
static PyObject *__pyx_n_s_create_subdm;
static PyObject *__pyx_n_s_crtol;
static PyObject *__pyx_n_s_csize;
static PyObject *__pyx_n_s_csr;
static PyObject *__pyx_n_s_ctype;
static PyObject *__pyx_n_s_cudahandle;
static PyObject *__pyx_n_s_cycle_type;
static PyObject *__pyx_kp_s_d_s;
static PyObject *__pyx_n_s_da;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_date;
static PyObject *__pyx_n_s_dctx;
static PyObject *__pyx_n_s_debugger;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_decomp;
static PyObject *__pyx_n_s_decorator;
static PyObject *__pyx_n_s_default;
static PyObject *__pyx_n_s_degree;
static PyObject *__pyx_n_s_delValue;
static PyObject *__pyx_n_s_dense;
static PyObject *__pyx_n_s_design;
static PyObject *__pyx_n_s_destroy;
static PyObject *__pyx_n_s_determinant;
static PyObject *__pyx_n_s_devel;
static PyObject *__pyx_n_s_device;
static PyObject *__pyx_n_s_device_id;
static PyObject *__pyx_n_s_device_type;
static PyObject *__pyx_n_s_diag;
static PyObject *__pyx_n_s_diagonalScale;
static PyObject *__pyx_n_s_diagonal_fill;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_dim;
static PyObject *__pyx_n_s_dims;
static PyObject *__pyx_n_s_direction;
static PyObject *__pyx_n_s_disc;
static PyObject *__pyx_n_s_display;
static PyObject *__pyx_n_s_dist;
static PyObject *__pyx_n_s_div;
static PyObject *__pyx_n_s_divtol;
static PyObject *__pyx_n_s_dlpack;
static PyObject *__pyx_n_s_dltensor;
static PyObject *__pyx_n_s_dm;
static PyObject *__pyx_n_s_dmTo;
static PyObject *__pyx_n_s_dm_type;
static PyObject *__pyx_n_s_dmf;
static PyObject *__pyx_n_s_dms;
static PyObject *__pyx_n_s_dmswarm_type;
static PyObject *__pyx_n_s_dmtype;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_dof;
static PyObject *__pyx_n_s_dofs;
static PyObject *__pyx_n_s_dosort;
static PyObject *__pyx_n_s_down;
static PyObject *__pyx_n_s_down_left;
static PyObject *__pyx_n_s_down_right;
static PyObject *__pyx_n_s_drop;
static PyObject *__pyx_n_s_ds_type;
static PyObject *__pyx_n_s_dspace;
static PyObject *__pyx_n_s_dt;
static PyObject *__pyx_n_s_dtcol;
static PyObject *__pyx_n_s_dtcount;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_dtype_is_object;
static PyObject *__pyx_n_s_dualspace_type;
static PyObject *__pyx_n_s_duplicate;
static PyObject *__pyx_n_s_e;
static PyObject *__pyx_n_s_elem_type;
static PyObject *__pyx_n_s_element;
static PyObject *__pyx_n_s_emacs;
static PyObject *__pyx_kp_s_empty_citation;
static PyObject *__pyx_kp_s_empty_name;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_end_args;
static PyObject *__pyx_n_s_end_kargs;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_entityDepth;
static PyObject *__pyx_n_s_entry;
static PyObject *__pyx_n_s_enum2str;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_epsilon;
static PyObject *__pyx_n_s_eqtype;
static PyObject *__pyx_n_s_equality_constraints;
static PyObject *__pyx_n_s_errhandler;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_kp_s_error_code_d;
static PyObject *__pyx_n_s_eta;
static PyObject *__pyx_n_s_evaluatestep;
static PyObject *__pyx_n_s_eventhandler;
static PyObject *__pyx_n_s_exec;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_exoid;
static PyObject *__pyx_kp_s_expecting_a_C_contiguous_array;
static PyObject *__pyx_kp_s_expecting_tuple_list_or_dict;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_s_faces;
static PyObject *__pyx_n_s_fact;
static PyObject *__pyx_n_s_factor_mallocs;
static PyObject *__pyx_n_s_fe_type;
static PyObject *__pyx_n_s_fget;
static PyObject *__pyx_n_s_field;
static PyObject *__pyx_n_s_fieldName;
static PyObject *__pyx_n_s_fieldname;
static PyObject *__pyx_n_s_fieldnames;
static PyObject *__pyx_n_s_fields;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_filename;
static PyObject *__pyx_n_s_fill;
static PyObject *__pyx_n_s_fill_param;
static PyObject *__pyx_n_s_fill_ratio_given;
static PyObject *__pyx_n_s_fill_ratio_needed;
static PyObject *__pyx_n_s_finalize;
static PyObject *__pyx_n_s_first;
static PyObject *__pyx_n_s_fix;
static PyObject *__pyx_n_s_flag;
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_s_flg;
static PyObject *__pyx_n_s_flip;
static PyObject *__pyx_n_s_flops;
static PyObject *__pyx_n_s_flush;
static PyObject *__pyx_n_s_fnorm;
static PyObject *__pyx_n_s_force;
static PyObject *__pyx_n_s_formDegree;
static PyObject *__pyx_n_s_formSNESFunction;
static PyObject *__pyx_n_s_formSNESJacobian;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_fortran;
static PyObject *__pyx_n_u_fortran;
static PyObject *__pyx_n_s_forward;
static PyObject *__pyx_n_s_front;
static PyObject *__pyx_n_s_front_down;
static PyObject *__pyx_n_s_front_down_left;
static PyObject *__pyx_n_s_front_down_right;
static PyObject *__pyx_n_s_front_left;
static PyObject *__pyx_n_s_front_right;
static PyObject *__pyx_n_s_front_up;
static PyObject *__pyx_n_s_front_up_left;
static PyObject *__pyx_n_s_front_up_right;
static PyObject *__pyx_n_s_func;
static PyObject *__pyx_n_s_function;
static PyObject *__pyx_n_s_functional;
static PyObject *__pyx_n_s_functools;
static PyObject *__pyx_n_s_g;
static PyObject *__pyx_n_s_gamgtype;
static PyObject *__pyx_n_s_gamma;
static PyObject *__pyx_n_s_garbage_cleanup;
static PyObject *__pyx_n_s_garbage_view;
static PyObject *__pyx_n_s_gasmtype;
static PyObject *__pyx_n_s_gatol;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_kp_s_get1dCoordinatecArrays_for_DMSta;
static PyObject *__pyx_n_s_getActive;
static PyObject *__pyx_n_s_getActiveAll;
static PyObject *__pyx_n_s_getAppCtx;
static PyObject *__pyx_n_s_getApplicationContext;
static PyObject *__pyx_n_s_getArray;
static PyObject *__pyx_n_s_getBlockIndices;
static PyObject *__pyx_n_s_getBlockInfo;
static PyObject *__pyx_n_s_getBlockSize;
static PyObject *__pyx_n_s_getBlockSizes;
static PyObject *__pyx_n_s_getBoundaryType;
static PyObject *__pyx_n_s_getBoundaryTypes;
static PyObject *__pyx_n_s_getBuffer;
static PyObject *__pyx_n_s_getCPUTime;
static PyObject *__pyx_n_s_getClassId;
static PyObject *__pyx_n_s_getClassName;
static PyObject *__pyx_n_s_getComm;
static PyObject *__pyx_n_s_getConstraintTolerances;
static PyObject *__pyx_n_s_getConvergedReason;
static PyObject *__pyx_n_s_getConvergenceHistory;
static PyObject *__pyx_n_s_getCorners;
static PyObject *__pyx_n_s_getCurrent;
static PyObject *__pyx_n_s_getDM;
static PyObject *__pyx_n_s_getDS;
static PyObject *__pyx_n_s_getDefaultComm;
static PyObject *__pyx_n_s_getDefaultGlobalSection;
static PyObject *__pyx_n_s_getDefaultLocalSection;
static PyObject *__pyx_n_s_getDefaultSF;
static PyObject *__pyx_n_s_getDefaultSection;
static PyObject *__pyx_n_s_getDevice;
static PyObject *__pyx_n_s_getDeviceId;
static PyObject *__pyx_n_s_getDeviceType;
static PyObject *__pyx_n_s_getDiagonal;
static PyObject *__pyx_n_s_getDiagonalBlock;
static PyObject *__pyx_n_s_getDim;
static PyObject *__pyx_n_s_getDimension;
static PyObject *__pyx_n_s_getDof;
static PyObject *__pyx_n_s_getEntriesPerElement;
static PyObject *__pyx_n_s_getEquationType;
static PyObject *__pyx_n_s_getFlops;
static PyObject *__pyx_n_s_getFunctionNorm;
static PyObject *__pyx_n_s_getFunctionTolerances;
static PyObject *__pyx_n_s_getFunctionValue;
static PyObject *__pyx_n_s_getGhostCorners;
static PyObject *__pyx_n_s_getGhostRanges;
static PyObject *__pyx_n_s_getGlobalSection;
static PyObject *__pyx_n_s_getGlobalSizes;
static PyObject *__pyx_n_s_getGradient;
static PyObject *__pyx_n_s_getGradientTolerances;
static PyObject *__pyx_n_s_getIndices;
static PyObject *__pyx_n_s_getInfo;
static PyObject *__pyx_n_s_getInitialGuessKnoll;
static PyObject *__pyx_n_s_getInitialGuessNonzero;
static PyObject *__pyx_n_s_getInterval;
static PyObject *__pyx_n_s_getIterationNumber;
static PyObject *__pyx_n_s_getKSP;
static PyObject *__pyx_n_s_getKSPFailures;
static PyObject *__pyx_n_s_getLinearSolveFailures;
static PyObject *__pyx_n_s_getLocalSection;
static PyObject *__pyx_n_s_getLocalSize;
static PyObject *__pyx_n_s_getLocalSizes;
static PyObject *__pyx_n_s_getMatrix;
static PyObject *__pyx_n_s_getMaxFunctionEvaluations;
static PyObject *__pyx_n_s_getMaxKSPFailures;
static PyObject *__pyx_n_s_getMaxLinearSolveFailures;
static PyObject *__pyx_n_s_getMaxNonlinearStepFailures;
static PyObject *__pyx_n_s_getMaxStepFailures;
static PyObject *__pyx_n_s_getMaxSteps;
static PyObject *__pyx_n_s_getMaxTime;
static PyObject *__pyx_n_s_getNPC;
static PyObject *__pyx_n_s_getName;
static PyObject *__pyx_n_s_getNonlinearStepFailures;
static PyObject *__pyx_n_s_getNormType;
static PyObject *__pyx_n_s_getNumber;
static PyObject *__pyx_n_s_getNumberDM;
static PyObject *__pyx_n_s_getObjectiveValue;
static PyObject *__pyx_n_s_getOperators;
static PyObject *__pyx_n_s_getOptionsPrefix;
static PyObject *__pyx_n_s_getOwnershipRange;
static PyObject *__pyx_n_s_getOwnershipRanges;
static PyObject *__pyx_n_s_getPC;
static PyObject *__pyx_n_s_getPCSide;
static PyObject *__pyx_n_s_getProblemType;
static PyObject *__pyx_n_s_getProcSizes;
static PyObject *__pyx_n_s_getRanges;
static PyObject *__pyx_n_s_getRank;
static PyObject *__pyx_n_s_getRefCount;
static PyObject *__pyx_n_s_getResidualNorm;
static PyObject *__pyx_n_s_getRhs;
static PyObject *__pyx_n_s_getSNES;
static PyObject *__pyx_n_s_getSection;
static PyObject *__pyx_n_s_getSectionSF;
static PyObject *__pyx_n_s_getSeed;
static PyObject *__pyx_n_s_getSize;
static PyObject *__pyx_n_s_getSizes;
static PyObject *__pyx_n_s_getSolution;
static PyObject *__pyx_n_s_getSolutionNorm;
static PyObject *__pyx_n_s_getSolutionUpdate;
static PyObject *__pyx_n_s_getStencil;
static PyObject *__pyx_n_s_getStencilType;
static PyObject *__pyx_n_s_getStencilWidth;
static PyObject *__pyx_n_s_getStepFailures;
static PyObject *__pyx_n_s_getStepNumber;
static PyObject *__pyx_n_s_getStreamType;
static PyObject *__pyx_n_s_getString;
static PyObject *__pyx_n_s_getTime;
static PyObject *__pyx_n_s_getTimeStep;
static PyObject *__pyx_n_s_getTolerances;
static PyObject *__pyx_n_s_getType;
static PyObject *__pyx_n_s_getUseEW;
static PyObject *__pyx_n_s_getUseFD;
static PyObject *__pyx_n_s_getUseMF;
static PyObject *__pyx_n_s_getValue;
static PyObject *__pyx_kp_s_getValuesStagStencil_not_yet_imp;
static PyObject *__pyx_kp_s_getVecArray_for_DMStag_not_yet_i;
static PyObject *__pyx_n_s_getVecLeft;
static PyObject *__pyx_n_s_getVecRight;
static PyObject *__pyx_n_s_getVecs;
static PyObject *__pyx_n_s_getVersion;
static PyObject *__pyx_n_s_getVersionInfo;
static PyObject *__pyx_n_s_getVisible;
static PyObject *__pyx_n_s_get_2;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_ghostBcNodes;
static PyObject *__pyx_n_s_ghosted;
static PyObject *__pyx_n_s_ghosts;
static PyObject *__pyx_kp_s_ghosts_size_d_array_size_d_and_v;
static PyObject *__pyx_n_s_globalBcNodes;
static PyObject *__pyx_kp_s_global_size_d_not_divisible_by_b;
static PyObject *__pyx_n_s_globalsec;
static PyObject *__pyx_n_s_gord;
static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
static PyObject *__pyx_n_s_gradient;
static PyObject *__pyx_n_s_group;
static PyObject *__pyx_n_s_grtol;
static PyObject *__pyx_n_s_gsec;
static PyObject *__pyx_n_s_gtol;
static PyObject *__pyx_n_s_gttol;
static PyObject *__pyx_n_s_gv;
static PyObject *__pyx_n_s_gvec;
static PyObject *__pyx_n_s_h_max;
static PyObject *__pyx_n_s_h_min;
static PyObject *__pyx_n_s_handle;
static PyObject *__pyx_n_s_has;
static PyObject *__pyx_n_s_hasExternalPackage;
static PyObject *__pyx_n_s_hasLabel;
static PyObject *__pyx_n_s_hasLagrange;
static PyObject *__pyx_n_s_hasName;
static PyObject *__pyx_n_s_hausd;
static PyObject *__pyx_n_s_hessian;
static PyObject *__pyx_n_s_hiphandle;
static PyObject *__pyx_n_s_hmax;
static PyObject *__pyx_n_s_hmin;
static PyObject *__pyx_n_s_hypretype;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_icntl;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_idx;
static PyObject *__pyx_n_s_idxm;
static PyObject *__pyx_n_s_ierr;
static PyObject *__pyx_n_s_ignore;
static PyObject *__pyx_n_s_ignoreOutsideDomain;
static PyObject *__pyx_n_s_imag;
static PyObject *__pyx_n_s_imagPart;
static PyObject *__pyx_n_s_imex;
static PyObject *__pyx_n_s_imode;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_inblocks;
static PyObject *__pyx_kp_s_incompatible_array_sizes;
static PyObject *__pyx_kp_s_incompatible_array_sizes_ni_d_nj;
static PyObject *__pyx_kp_s_incompatible_array_sizes_ni_d_nv;
static PyObject *__pyx_kp_s_incompatible_array_sizes_ni_d_nv_2;
static PyObject *__pyx_kp_s_incompatible_array_sizes_nv_d;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_indicator;
static PyObject *__pyx_n_s_indices;
static PyObject *__pyx_n_s_info;
static PyObject *__pyx_n_s_infoAllow;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_initialguess;
static PyObject *__pyx_n_s_initialize;
static PyObject *__pyx_kp_s_input_arrays_have_incompatible_s;
static PyObject *__pyx_n_s_int;
static PyObject *__pyx_n_s_intdim;
static PyObject *__pyx_n_s_interior;
static PyObject *__pyx_n_s_interp_type;
static PyObject *__pyx_n_s_interpolate;
static PyObject *__pyx_n_s_interval;
static PyObject *__pyx_n_s_invert;
static PyObject *__pyx_n_s_is;
static PyObject *__pyx_n_s_isActive;
static PyObject *__pyx_n_s_isAssembled;
static PyObject *__pyx_n_s_isFinalized;
static PyObject *__pyx_n_s_isHermitian;
static PyObject *__pyx_n_s_isIdentity;
static PyObject *__pyx_n_s_isInitialized;
static PyObject *__pyx_n_s_isPermutation;
static PyObject *__pyx_n_s_isSimplex;
static PyObject *__pyx_n_s_isSorted;
static PyObject *__pyx_n_s_isStructurallySymmetric;
static PyObject *__pyx_n_s_isSymmetric;
static PyObject *__pyx_n_s_is_from;
static PyObject *__pyx_n_s_is_local;
static PyObject *__pyx_n_s_is_to;
static PyObject *__pyx_n_s_is_type;
static PyObject *__pyx_n_s_iscol;
static PyObject *__pyx_n_s_iscols;
static PyObject *__pyx_n_s_iset;
static PyObject *__pyx_n_s_isets;
static PyObject *__pyx_n_s_isfields;
static PyObject *__pyx_n_s_isotropic;
static PyObject *__pyx_n_s_isperm;
static PyObject *__pyx_n_s_isrow;
static PyObject *__pyx_n_s_isrows;
static PyObject *__pyx_n_s_itemsize;
static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
static PyObject *__pyx_n_s_its;
static PyObject *__pyx_n_s_ival;
static PyObject *__pyx_n_s_j;
static PyObject *__pyx_n_s_jacobian;
static PyObject *__pyx_n_s_jacobian_design;
static PyObject *__pyx_n_s_jacobian_equality;
static PyObject *__pyx_n_s_jacobian_state;
static PyObject *__pyx_n_s_jacobianp;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_join_mode;
static PyObject *__pyx_n_s_k;
static PyObject *__pyx_n_s_kargs;
static PyObject *__pyx_kp_s_key_d_cannot_register_s_already;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_kind;
static PyObject *__pyx_n_s_klass;
static PyObject *__pyx_n_s_ksp;
static PyObject *__pyx_n_s_ksp_type;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_l;
static PyObject *__pyx_n_s_l2l;
static PyObject *__pyx_n_s_label;
static PyObject *__pyx_n_s_labelName;
static PyObject *__pyx_n_s_lambda;
static PyObject *__pyx_n_s_lanes;
static PyObject *__pyx_n_s_layoutType;
static PyObject *__pyx_n_s_lda;
static PyObject *__pyx_n_s_leafSection;
static PyObject *__pyx_n_s_leafdata;
static PyObject *__pyx_n_s_leafsize;
static PyObject *__pyx_n_s_leafupdate;
static PyObject *__pyx_n_s_left;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_level;
static PyObject *__pyx_n_s_levels;
static PyObject *__pyx_n_s_lgmap;
static PyObject *__pyx_n_s_lgmap_type;
static PyObject *__pyx_n_s_lgmapc;
static PyObject *__pyx_n_s_lgmapr;
static PyObject *__pyx_n_s_linear_its;
static PyObject *__pyx_n_s_lits;
static PyObject *__pyx_n_s_loc;
static PyObject *__pyx_n_s_locC;
static PyObject *__pyx_n_s_locX;
static PyObject *__pyx_n_s_local;
static PyObject *__pyx_kp_s_local_and_global_sizes_cannot_be;
static PyObject *__pyx_kp_s_local_size_d_not_divisible_by_bl;
static PyObject *__pyx_n_s_localsec;
static PyObject *__pyx_n_s_locs;
static PyObject *__pyx_n_s_logFlops;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_s_ltog;
static PyObject *__pyx_n_s_ltol;
static PyObject *__pyx_n_s_lv;
static PyObject *__pyx_n_s_lvec;
static PyObject *__pyx_n_s_lvecs;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_major;
static PyObject *__pyx_n_s_mallocs;
static PyObject *__pyx_n_s_mat;
static PyObject *__pyx_n_s_matApply;
static PyObject *__pyx_n_s_matMult;
static PyObject *__pyx_n_s_mat_type;
static PyObject *__pyx_n_s_matpartitioning_type;
static PyObject *__pyx_n_s_mats;
static PyObject *__pyx_n_s_max;
static PyObject *__pyx_n_s_maxDegree;
static PyObject *__pyx_n_s_max_fails;
static PyObject *__pyx_n_s_max_funcs;
static PyObject *__pyx_n_s_max_it;
static PyObject *__pyx_n_s_max_steps;
static PyObject *__pyx_n_s_max_time;
static PyObject *__pyx_n_s_maxrank;
static PyObject *__pyx_n_s_maxval;
static PyObject *__pyx_n_s_memo;
static PyObject *__pyx_n_s_memory;
static PyObject *__pyx_n_s_memview;
static PyObject *__pyx_n_s_messageLength;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_metric;
static PyObject *__pyx_n_s_metric1;
static PyObject *__pyx_n_s_metric2;
static PyObject *__pyx_n_s_metric3;
static PyObject *__pyx_n_s_metricAvg;
static PyObject *__pyx_n_s_metricInt;
static PyObject *__pyx_n_s_mgtype;
static PyObject *__pyx_n_s_min;
static PyObject *__pyx_n_s_minor;
static PyObject *__pyx_n_s_mirror;
static PyObject *__pyx_n_s_missingDiagonal;
static PyObject *__pyx_n_s_mit;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_model;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_monitor;
static PyObject *__pyx_n_s_monitorCancel;
static PyObject *__pyx_n_s_mpi4py;
static PyObject *__pyx_kp_s_mpi4py_MPI;
static PyObject *__pyx_n_s_mpiabort;
static PyObject *__pyx_n_s_msg;
static PyObject *__pyx_n_s_mult;
static PyObject *__pyx_n_s_multAdd;
static PyObject *__pyx_n_s_multDiagonalBlock;
static PyObject *__pyx_n_s_multHermitian;
static PyObject *__pyx_n_s_multHermitianAdd;
static PyObject *__pyx_n_s_multTranspose;
static PyObject *__pyx_n_s_multTransposeAdd;
static PyObject *__pyx_n_s_multirootdata;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_na;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_name_3;
static PyObject *__pyx_n_s_nbsteps;
static PyObject *__pyx_n_s_nc;
static PyObject *__pyx_n_s_ndim;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_newsec;
static PyObject *__pyx_n_s_newvec;
static PyObject *__pyx_n_s_ngs;
static PyObject *__pyx_n_s_nlevels;
static PyObject *__pyx_n_s_nlocal;
static PyObject *__pyx_n_s_nmax;
static PyObject *__pyx_n_s_nmin;
static PyObject *__pyx_n_s_nnz;
static PyObject *__pyx_n_s_noInsert;
static PyObject *__pyx_n_s_noMove;
static PyObject *__pyx_n_s_noSurf;
static PyObject *__pyx_n_s_noSwap;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
static PyObject *__pyx_n_s_none;
static PyObject *__pyx_n_s_nonzero;
static PyObject *__pyx_n_s_nonzero_2;
static PyObject *__pyx_n_s_norm;
static PyObject *__pyx_n_s_norm_type;
static PyObject *__pyx_n_s_normsched;
static PyObject *__pyx_n_s_normtype;
static PyObject *__pyx_n_s_npoints;
static PyObject *__pyx_n_s_nroots;
static PyObject *__pyx_n_s_nsd;
static PyObject *__pyx_n_s_nsp;
static PyObject *__pyx_n_s_nsubcomm;
static PyObject *__pyx_n_s_null;
static PyObject *__pyx_kp_s_null_communicator;
static PyObject *__pyx_n_s_numBatches;
static PyObject *__pyx_n_s_numBlocks;
static PyObject *__pyx_n_s_numComp;
static PyObject *__pyx_n_s_numDof;
static PyObject *__pyx_n_s_numFields;
static PyObject *__pyx_n_s_numIter;
static PyObject *__pyx_n_s_numMessages;
static PyObject *__pyx_n_s_numProcs;
static PyObject *__pyx_n_s_numReductions;
static PyObject *__pyx_n_s_numSumSpaces;
static PyObject *__pyx_n_s_numTensSpaces;
static PyObject *__pyx_kp_s_number_of_dimensions_d_and_numbe;
static PyObject *__pyx_n_s_nz_allocated;
static PyObject *__pyx_n_s_nz_unneeded;
static PyObject *__pyx_n_s_nz_used;
static PyObject *__pyx_n_s_nzdiag;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_objective;
static PyObject *__pyx_n_s_objgrad;
static PyObject *__pyx_n_s_offset;
static PyObject *__pyx_n_s_omega;
static PyObject *__pyx_n_s_ometric;
static PyObject *__pyx_kp_s_only_and;
static PyObject *__pyx_n_s_onnz;
static PyObject *__pyx_n_s_op;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_operator;
static PyObject *__pyx_n_s_operators;
static PyObject *__pyx_n_s_option;
static PyObject *__pyx_kp_s_option_prefix_must_be_string;
static PyObject *__pyx_kp_s_option_prefix_should_not_have_sp;
static PyObject *__pyx_kp_s_option_prefix_should_not_start_w;
static PyObject *__pyx_n_s_options;
static PyObject *__pyx_n_s_opts;
static PyObject *__pyx_n_s_ord_type;
static PyObject *__pyx_n_s_order;
static PyObject *__pyx_n_s_orientation;
static PyObject *__pyx_n_s_other;
static PyObject *__pyx_n_s_otype;
static PyObject *__pyx_n_s_out;
static PyObject *__pyx_n_s_output;
static PyObject *__pyx_n_s_overlap;
static PyObject *__pyx_kp_s_ownership_range_size_d_and_numbe;
static PyObject *__pyx_n_s_ownership_ranges;
static PyObject *__pyx_n_s_ozz;
static PyObject *__pyx_n_s_p;
static PyObject *__pyx_n_s_p1;
static PyObject *__pyx_n_s_pEnd;
static PyObject *__pyx_n_s_pStart;
static PyObject *__pyx_n_s_pack;
static PyObject *__pyx_n_s_package;
static PyObject *__pyx_n_s_package_2;
static PyObject *__pyx_n_s_parallel;
static PyObject *__pyx_n_s_parent;
static PyObject *__pyx_n_s_part;
static PyObject *__pyx_n_s_part_type;
static PyObject *__pyx_n_s_partitioning;
static PyObject *__pyx_n_s_pc;
static PyObject *__pyx_n_s_pc_type;
static PyObject *__pyx_n_s_pd;
static PyObject *__pyx_n_s_periodic;
static PyObject *__pyx_n_s_perm;
static PyObject *__pyx_n_s_permutation;
static PyObject *__pyx_n_s_petsc;
static PyObject *__pyx_n_s_petsc4py_PETSc;
static PyObject *__pyx_kp_s_petsc4py_PETSc_Device_pyx;
static PyObject *__pyx_kp_s_petsc4py_PETSc_Error_pyx;
static PyObject *__pyx_kp_s_petsc4py_PETSc_Log_pyx;
static PyObject *__pyx_kp_s_petsc4py_PETSc_PETSc_pyx;
static PyObject *__pyx_kp_s_petsc4py_PETSc_cyclicgc_pxi;
static PyObject *__pyx_n_s_pi;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_s_pj;
static PyObject *__pyx_n_s_plexname;
static PyObject *__pyx_n_s_point;
static PyObject *__pyx_n_s_points;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_popErrorHandler;
static PyObject *__pyx_n_s_popSignalHandler;
static PyObject *__pyx_n_s_pop_python_vfprintf;
static PyObject *__pyx_n_s_position;
static PyObject *__pyx_n_s_positive_definite;
static PyObject *__pyx_n_s_postSolve;
static PyObject *__pyx_n_s_postStep;
static PyObject *__pyx_n_s_postevent;
static PyObject *__pyx_n_s_poststep;
static PyObject *__pyx_n_s_pre;
static PyObject *__pyx_n_s_preSolve;
static PyObject *__pyx_n_s_preStep;
static PyObject *__pyx_n_s_pre_finalize;
static PyObject *__pyx_n_s_precheck;
static PyObject *__pyx_n_s_prefix;
static PyObject *__pyx_kp_s_prefix_s_name_s;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_prestep;
static PyObject *__pyx_n_s_primv;
static PyObject *__pyx_n_s_proc_sizes;
static PyObject *__pyx_n_s_productNumeric;
static PyObject *__pyx_n_s_productSetFromOptions;
static PyObject *__pyx_n_s_productSymbolic;
static PyObject *__pyx_n_s_property;
static PyObject *__pyx_n_s_ptap;
static PyObject *__pyx_n_s_ptype;
static PyObject *__pyx_n_s_push;
static PyObject *__pyx_n_s_pushErrorHandler;
static PyObject *__pyx_n_s_push_python_vfprintf;
static PyObject *__pyx_n_s_py_sub_ctxs;
static PyObject *__pyx_n_s_py_type;
static PyObject *__pyx_n_s_python;
static PyObject *__pyx_n_s_pyx_PickleError;
static PyObject *__pyx_n_s_pyx_checksum;
static PyObject *__pyx_n_s_pyx_getbuffer;
static PyObject *__pyx_n_s_pyx_result;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_type;
static PyObject *__pyx_n_s_pyx_unpickle_Enum;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_q0;
static PyObject *__pyx_n_s_q1;
static PyObject *__pyx_n_s_qorder;
static PyObject *__pyx_n_s_quad;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_r;
static PyObject *__pyx_kp_s_r_2;
static PyObject *__pyx_n_s_radius;
static PyObject *__pyx_n_s_random;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_ranges;
static PyObject *__pyx_n_s_rank;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_readonly;
static PyObject *__pyx_kp_s_readonly_attribute;
static PyObject *__pyx_n_s_ready;
static PyObject *__pyx_n_s_real;
static PyObject *__pyx_n_s_realPart;
static PyObject *__pyx_n_s_reason;
static PyObject *__pyx_n_s_reciprocal;
static PyObject *__pyx_n_s_red;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_redundant;
static PyObject *__pyx_n_s_redundantPoints;
static PyObject *__pyx_n_s_refine;
static PyObject *__pyx_n_s_refine_x;
static PyObject *__pyx_n_s_refine_y;
static PyObject *__pyx_n_s_refine_z;
static PyObject *__pyx_n_s_refinementLimit;
static PyObject *__pyx_n_s_refinementUniform;
static PyObject *__pyx_n_s_register;
static PyObject *__pyx_n_s_registerCitation;
static PyObject *__pyx_n_s_release;
static PyObject *__pyx_n_s_remote;
static PyObject *__pyx_n_s_remoteOffsets;
static PyObject *__pyx_n_s_remove;
static PyObject *__pyx_n_s_remove_sent_points;
static PyObject *__pyx_n_s_replace;
static PyObject *__pyx_n_s_repr;
static PyObject *__pyx_n_s_res;
static PyObject *__pyx_n_s_reset;
static PyObject *__pyx_n_s_reshape;
static PyObject *__pyx_n_s_residual;
static PyObject *__pyx_n_s_restart;
static PyObject *__pyx_n_s_restrictAnisotropy;
static PyObject *__pyx_n_s_restrictAnisotropyFirst;
static PyObject *__pyx_n_s_restrictSizes;
static PyObject *__pyx_n_s_restricthook;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_reuse;
static PyObject *__pyx_n_s_reverse;
static PyObject *__pyx_n_s_rgLabel;
static PyObject *__pyx_n_s_rhs;
static PyObject *__pyx_n_s_rhsjacobianp;
static PyObject *__pyx_n_s_right;
static PyObject *__pyx_n_s_rmap;
static PyObject *__pyx_n_s_rnd_type;
static PyObject *__pyx_n_s_rnorm;
static PyObject *__pyx_n_s_rollback;
static PyObject *__pyx_n_s_rootSection;
static PyObject *__pyx_n_s_rootdata;
static PyObject *__pyx_n_s_row;
static PyObject *__pyx_n_s_row_bsize;
static PyObject *__pyx_kp_s_row_indices_must_have_two_dimens;
static PyObject *__pyx_n_s_rowmap;
static PyObject *__pyx_n_s_rows;
static PyObject *__pyx_n_s_rscale;
static PyObject *__pyx_n_s_rsplit;
static PyObject *__pyx_n_s_rtol;
static PyObject *__pyx_n_s_rtol_0;
static PyObject *__pyx_n_s_rtol_max;
static PyObject *__pyx_n_s_rw;
static PyObject *__pyx_kp_s_s;
static PyObject *__pyx_n_s_s_2;
static PyObject *__pyx_kp_u_s_3;
static PyObject *__pyx_kp_s_s_at_s_d;
static PyObject *__pyx_kp_s_s_s;
static PyObject *__pyx_n_s_scale;
static PyObject *__pyx_n_s_scatter;
static PyObject *__pyx_n_s_scatter_type;
static PyObject *__pyx_n_s_sec;
static PyObject *__pyx_n_s_seconds;
static PyObject *__pyx_n_s_sectiondm;
static PyObject *__pyx_n_s_seed;
static PyObject *__pyx_n_s_selected;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_sep;
static PyObject *__pyx_n_s_setActive;
static PyObject *__pyx_n_s_setActiveAll;
static PyObject *__pyx_n_s_setAppCtx;
static PyObject *__pyx_n_s_setApplicationContext;
static PyObject *__pyx_n_s_setConvergedReason;
static PyObject *__pyx_n_s_setCurrent;
static PyObject *__pyx_n_s_setDM;
static PyObject *__pyx_n_s_setDS;
static PyObject *__pyx_n_s_setDefaultComm;
static PyObject *__pyx_n_s_setDefaultGlobalSection;
static PyObject *__pyx_n_s_setDefaultLocalSection;
static PyObject *__pyx_n_s_setDefaultSF;
static PyObject *__pyx_n_s_setDefaultSection;
static PyObject *__pyx_n_s_setDefaultType;
static PyObject *__pyx_n_s_setDevice;
static PyObject *__pyx_n_s_setDiagonal;
static PyObject *__pyx_n_s_setDimension;
static PyObject *__pyx_n_s_setEquationType;
static PyObject *__pyx_n_s_setFromOptions;
static PyObject *__pyx_n_s_setFunctionNorm;
static PyObject *__pyx_n_s_setFunctionTolerances;
static PyObject *__pyx_n_s_setGlobalSection;
static PyObject *__pyx_n_s_setInitial;
static PyObject *__pyx_n_s_setInitialGuessKnoll;
static PyObject *__pyx_n_s_setInitialGuessNonzero;
static PyObject *__pyx_n_s_setInterval;
static PyObject *__pyx_n_s_setIterationNumber;
static PyObject *__pyx_n_s_setKSP;
static PyObject *__pyx_n_s_setLocalSection;
static PyObject *__pyx_n_s_setMaxFunctionEvaluations;
static PyObject *__pyx_n_s_setMaxKSPFailures;
static PyObject *__pyx_n_s_setMaxLinearSolveFailures;
static PyObject *__pyx_n_s_setMaxNonlinearStepFailures;
static PyObject *__pyx_n_s_setMaxStepFailures;
static PyObject *__pyx_n_s_setMaxSteps;
static PyObject *__pyx_n_s_setMaxTime;
static PyObject *__pyx_n_s_setMonitor;
static PyObject *__pyx_n_s_setNPC;
static PyObject *__pyx_n_s_setName;
static PyObject *__pyx_n_s_setNormType;
static PyObject *__pyx_n_s_setOption;
static PyObject *__pyx_n_s_setOptionsPrefix;
static PyObject *__pyx_n_s_setPCSide;
static PyObject *__pyx_n_s_setParamsEW;
static PyObject *__pyx_n_s_setProblemType;
static PyObject *__pyx_n_s_setResidualNorm;
static PyObject *__pyx_n_s_setSection;
static PyObject *__pyx_n_s_setSectionSF;
static PyObject *__pyx_n_s_setSeed;
static PyObject *__pyx_n_s_setSizes;
static PyObject *__pyx_n_s_setSolution;
static PyObject *__pyx_n_s_setStepNumber;
static PyObject *__pyx_n_s_setStreamType;
static PyObject *__pyx_n_s_setTime;
static PyObject *__pyx_n_s_setTimeStep;
static PyObject *__pyx_n_s_setTolerances;
static PyObject *__pyx_n_s_setType;
static PyObject *__pyx_n_s_setUp;
static PyObject *__pyx_n_s_setUseEW;
static PyObject *__pyx_n_s_setUseFD;
static PyObject *__pyx_n_s_setUseMF;
static PyObject *__pyx_n_s_setValue;
static PyObject *__pyx_kp_s_setValueBlockedStagStencil_not_y;
static PyObject *__pyx_kp_s_setValueStagStencil_not_yet_impl;
static PyObject *__pyx_kp_s_setValuesStagStencil_not_yet_imp;
static PyObject *__pyx_n_s_setVisible;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_setup;
static PyObject *__pyx_n_s_sf;
static PyObject *__pyx_n_s_sf_type;
static PyObject *__pyx_n_s_sfxc;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_shift;
static PyObject *__pyx_n_s_shift_type;
static PyObject *__pyx_n_s_shiftamount;
static PyObject *__pyx_n_s_shifttype;
static PyObject *__pyx_n_s_side;
static PyObject *__pyx_kp_s_side_r_not_understood;
static PyObject *__pyx_n_s_simplex;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_kp_s_size_I_is_d_expected_d;
static PyObject *__pyx_kp_s_size_J_is_d_expected_d;
static PyObject *__pyx_kp_s_size_V_is_d_expected_d;
static PyObject *__pyx_kp_s_size_array_is_d_expected_dx_d_d;
static PyObject *__pyx_kp_s_size_d_nnz_is_d_expected_d;
static PyObject *__pyx_kp_s_size_o_nnz_is_d_expected_d;
static PyObject *__pyx_n_s_sizes;
static PyObject *__pyx_kp_s_sizes_array_should_have_d_entrie;
static PyObject *__pyx_n_s_skip;
static PyObject *__pyx_n_s_sleep;
static PyObject *__pyx_n_s_smooths;
static PyObject *__pyx_n_s_snes;
static PyObject *__pyx_n_s_snes_type;
static PyObject *__pyx_n_s_solve;
static PyObject *__pyx_n_s_solveAdd;
static PyObject *__pyx_n_s_solveStep;
static PyObject *__pyx_n_s_solveTranspose;
static PyObject *__pyx_n_s_solveTransposeAdd;
static PyObject *__pyx_n_s_solver;
static PyObject *__pyx_n_s_sortype;
static PyObject *__pyx_n_s_sp;
static PyObject *__pyx_n_s_space_type;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_splitOwnership;
static PyObject *__pyx_n_s_stage;
static PyObject *__pyx_n_s_star;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_starts;
static PyObject *__pyx_n_s_startswith;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_staticmethod;
static PyObject *__pyx_n_s_staticproperty;
static PyObject *__pyx_n_s_staticproperty___get;
static PyObject *__pyx_n_s_stderr;
static PyObject *__pyx_n_s_stderr_2;
static PyObject *__pyx_n_s_stdout;
static PyObject *__pyx_n_s_stdout_2;
static PyObject *__pyx_n_s_stdout_is_stderr;
static PyObject *__pyx_n_s_stencil_type;
static PyObject *__pyx_n_s_stencil_width;
static PyObject *__pyx_n_s_stenciltype;
static PyObject *__pyx_n_s_step;
static PyObject *__pyx_n_s_stepTranspose;
static PyObject *__pyx_n_s_step_number;
static PyObject *__pyx_n_s_stol;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_n_s_str;
static PyObject *__pyx_n_s_strata;
static PyObject *__pyx_n_s_stratum;
static PyObject *__pyx_n_s_stream;
static PyObject *__pyx_n_s_stream_type;
static PyObject *__pyx_kp_s_strided_and_direct;
static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
static PyObject *__pyx_kp_s_strided_and_indirect;
static PyObject *__pyx_n_s_strides;
static PyObject *__pyx_n_s_string;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_strip;
static PyObject *__pyx_n_s_struct;
static PyObject *__pyx_n_s_structure;
static PyObject *__pyx_n_s_sub;
static PyObject *__pyx_n_s_subcomm;
static PyObject *__pyx_n_s_subdm;
static PyObject *__pyx_n_s_submat;
static PyObject *__pyx_n_s_submats;
static PyObject *__pyx_n_s_subminor;
static PyObject *__pyx_n_s_subsp;
static PyObject *__pyx_n_s_subspaceOffsets;
static PyObject *__pyx_n_s_subvec;
static PyObject *__pyx_n_s_supp;
static PyObject *__pyx_n_s_svalue;
static PyObject *__pyx_n_s_swidth;
static PyObject *__pyx_n_s_sx;
static PyObject *__pyx_n_s_sym;
static PyObject *__pyx_n_s_symmetric;
static PyObject *__pyx_n_s_syncFlush;
static PyObject *__pyx_n_s_syncPrint;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_t;
static PyObject *__pyx_n_s_tab;
static PyObject *__pyx_n_s_tabs;
static PyObject *__pyx_n_s_tao_type;
static PyObject *__pyx_n_s_targetComplexity;
static PyObject *__pyx_n_s_tbline;
static PyObject *__pyx_n_s_tblist;
static PyObject *__pyx_n_s_tensor;
static PyObject *__pyx_n_s_terminate;
static PyObject *__pyx_n_s_theta;
static PyObject *__pyx_n_s_threshold;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_time_step;
static PyObject *__pyx_n_s_timestep;
static PyObject *__pyx_n_s_title;
static PyObject *__pyx_n_s_toAll;
static PyObject *__pyx_n_s_toDLPack;
static PyObject *__pyx_n_s_toZero;
static PyObject *__pyx_n_s_toindx;
static PyObject *__pyx_n_s_tol;
static PyObject *__pyx_n_s_tr_type;
static PyObject *__pyx_n_s_traceback;
static PyObject *__pyx_n_s_traceback_2;
static PyObject *__pyx_n_s_trans;
static PyObject *__pyx_n_s_transpose;
static PyObject *__pyx_n_s_trimmed;
static PyObject *__pyx_n_s_ts_type;
static PyObject *__pyx_n_s_tspan;
static PyObject *__pyx_n_s_twist;
static PyObject *__pyx_n_s_typ;
static PyObject *__pyx_n_s_type_registry;
static PyObject *__pyx_n_s_typestr;
static PyObject *__pyx_n_s_u;
static PyObject *__pyx_n_s_ua;
static PyObject *__pyx_n_s_uaux;
static PyObject *__pyx_n_s_uis;
static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
static PyObject *__pyx_kp_s_unhandled_PetscDeviceContextJoin;
static PyObject *__pyx_kp_s_unhandled_PetscDeviceType_d;
static PyObject *__pyx_kp_s_unhandled_PetscStreamType_d;
static PyObject *__pyx_n_s_uniform;
static PyObject *__pyx_n_s_unit;
static PyObject *__pyx_kp_s_unknown_boundary_type_s;
static PyObject *__pyx_kp_s_unknown_device_type_s;
static PyObject *__pyx_kp_s_unknown_element_type_s;
static PyObject *__pyx_kp_s_unknown_error_handler_s;
static PyObject *__pyx_kp_s_unknown_interpolation_type_s;
static PyObject *__pyx_kp_s_unknown_join_mode_s;
static PyObject *__pyx_kp_s_unknown_options_s;
static PyObject *__pyx_kp_s_unknown_scatter_mode_s;
static PyObject *__pyx_kp_s_unknown_shift_type_s;
static PyObject *__pyx_kp_s_unknown_stencil_location_type_s;
static PyObject *__pyx_kp_s_unknown_stencil_type_s;
static PyObject *__pyx_kp_s_unknown_stream_type_s;
static PyObject *__pyx_n_s_unnamed;
static PyObject *__pyx_n_s_unpack;
static PyObject *__pyx_n_s_up;
static PyObject *__pyx_n_s_up_left;
static PyObject *__pyx_n_s_up_right;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_upper;
static PyObject *__pyx_n_s_useAnchors;
static PyObject *__pyx_n_s_useClosure;
static PyObject *__pyx_n_s_useCone;
static PyObject *__pyx_n_s_useInitialGuess;
static PyObject *__pyx_n_s_v;
static PyObject *__pyx_n_s_val;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_kp_s_values_must_have_two_or_more_dim;
static PyObject *__pyx_n_s_varbounds;
static PyObject *__pyx_n_s_vec;
static PyObject *__pyx_n_s_vecTo;
static PyObject *__pyx_n_s_vec_from;
static PyObject *__pyx_n_s_vec_to;
static PyObject *__pyx_n_s_vec_type;
static PyObject *__pyx_n_s_vecs;
static PyObject *__pyx_n_s_vectors;
static PyObject *__pyx_n_s_verbosity;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_s_vg;
static PyObject *__pyx_n_s_viennaclvechandle;
static PyObject *__pyx_n_s_view;
static PyObject *__pyx_n_s_viewer;
static PyObject *__pyx_n_s_vl;
static PyObject *__pyx_n_s_vlg;
static PyObject *__pyx_n_s_vm;
static PyObject *__pyx_n_s_vn;
static PyObject *__pyx_n_s_vtol;
static PyObject *__pyx_n_s_vwr_type;
static PyObject *__pyx_n_s_w;
static PyObject *__pyx_kp_s_w_2;
static PyObject *__pyx_n_s_weight;
static PyObject *__pyx_n_s_width;
static PyObject *__pyx_n_s_wrapped_func;
static PyObject *__pyx_n_s_wraps;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_xdot;
static PyObject *__pyx_n_s_xdotdot;
static PyObject *__pyx_n_s_xl;
static PyObject *__pyx_n_s_xmax;
static PyObject *__pyx_n_s_xmin;
static PyObject *__pyx_n_s_xnorm;
static PyObject *__pyx_n_s_xu;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_ymax;
static PyObject *__pyx_n_s_ymin;
static PyObject *__pyx_n_s_ynorm;
static PyObject *__pyx_n_s_zeroEntries;
static PyObject *__pyx_n_s_zeroRowsColumns;
static PyObject *__pyx_n_s_zeropivot;
static PyObject *__pyx_n_s_zmax;
static PyObject *__pyx_n_s_zmin;
static PyObject *__pyx_n_s_zoz;
static PyObject *__pyx_n_s_zzo;
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_pf_8petsc4py_5PETSc_10_IS_buffer___cinit__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static void __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_4__getbuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto */
static void __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_6__releasebuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_8__enter__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_10__exit__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_12__getsegcount__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_ssize_t *__pyx_v_lenp); /* proto */
#endif
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_14__getreadbuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /* proto */
#endif
static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_19__array_interface_____get__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer___cinit__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, int __pyx_v_readonly); /* proto */
static void __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_4__getbuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto */
static void __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_6__releasebuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_8__enter__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_10__exit__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_12__getsegcount__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t *__pyx_v_lenp); /* proto */
#endif
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_14__getreadbuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /* proto */
#endif
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_16__getwritebuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /* proto */
#endif
static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_19__array_interface_____get__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm___init__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_2__enter__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_4__exit__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1i___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1j___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1k___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1c___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_5index___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_5field___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array___cinit__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_da, struct PyPetscVecObject *__pyx_v_vec, int __pyx_v_DOF); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_2__getitem__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_4__setitem__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6__enter__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_8__exit__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6starts___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5sizes___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5shape___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_7strides___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5array___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access___cinit__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_locs); /* proto */
static void __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_4__enter__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_6__exit__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_ierr); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_2__nonzero__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_6__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_7Options___init__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static void __pyx_pf_8petsc4py_5PETSc_7Options_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_7Options_4__contains__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_6__getitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_7Options_8__setitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_7Options_10__delitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_6prefix___get__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_7Options_6prefix_2__set__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_7Options_6prefix_4__del__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_12create(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_14destroy(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_16clear(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_18view(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_20prefixPush(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_22prefixPop(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_24hasName(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_26setValue(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_28delValue(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_30getBool(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_32getInt(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_34getReal(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_36getScalar(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_38getString(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_40insertString(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_string); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_42getAll(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_getVersion(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_devel, PyObject *__pyx_v_date, PyObject *__pyx_v_author); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_2getVersionInfo(PyTypeObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_4isInitialized(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_6isFinalized(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_8getDefaultComm(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_10setDefaultComm(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_12Print(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_14syncPrint(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* 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, PyObject *__pyx_v_all); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_8view(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_10logFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_flops); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_12addFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_flops); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14getFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_16getTime(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_18getCPUTime(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_wrapped_func(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_decorator(PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_20EventDecorator(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_klass); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_22isActive(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_8LogStage___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_2__int__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_4__enter__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_6__exit__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_8push(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_10pop(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_12getName(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_8LogStage_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_14activate(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_16deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_18getActive(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_20setActive(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_8LogStage_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_22getVisible(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_24setVisible(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_7visible___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_8LogStage_7visible_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_8LogClass___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_2__int__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_4getName(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_8LogClass_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_6activate(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_8deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_10getActive(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_12setActive(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_8LogClass_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_8LogEvent___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_2__int__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_4__enter__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_6__exit__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_8begin(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_objs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_10end(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_objs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_12getName(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_14activate(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_16deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_18getActive(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_20setActive(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_22getActiveAll(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_24setActiveAll(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_26getPerfInfo(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_stage); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4Comm___cinit__(struct PyPetscCommObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static void __pyx_pf_8petsc4py_5PETSc_4Comm_2__dealloc__(struct PyPetscCommObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4__richcmp__(struct PyPetscCommObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4Comm_6__nonzero__(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__nonzero__(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_8__copy__(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_10__deepcopy__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_memo); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_12view(struct PyPetscObjectObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_14destroy(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_16getType(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_18setOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_20getOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_22appendOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_24setFromOptions(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_26viewFromOptions(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_28getComm(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_30getName(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_32setName(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_34getClassId(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_36getClassName(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_38getRefCount(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_40compose(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_42query(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_44incRef(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_46decRef(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_48getAttr(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_50setAttr(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_52getDict(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_54stateIncrease(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_56stateGet(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_58stateSet(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_60incrementTabLevel(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_tab, struct PyPetscObjectObject *__pyx_v_parent); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_62setTabLevel(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_64getTabLevel(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4type___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_6Object_4type_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_6prefix___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_6Object_6prefix_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4comm___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4name___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_6Object_4name_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_7classid___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_5klass___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_8refcount___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_6handle___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_7fortran___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_garbage_cleanup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2garbage_view(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_comm); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_6Viewer___cinit__(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_2__call__(struct PyPetscViewerObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_4view(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_6destroy(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_8create(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_10createASCII(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_12createBinary(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_14createMPIIO(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_16createVTK(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_18createHDF5(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_20createDraw(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_display, PyObject *__pyx_v_title, PyObject *__pyx_v_position, PyObject *__pyx_v_size, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_22setType(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_vwr_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_24getType(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_26getFormat(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_28pushFormat(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_format); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_30popFormat(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_32getSubViewer(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_34restoreSubViewer(struct PyPetscViewerObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_sub); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_36STDOUT(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_38STDERR(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_40ASCII(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_42BINARY(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_44DRAW(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_46setASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_48getASCIITab(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_50addASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_52subtractASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_54pushASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_56popASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_58pushASCIITab(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_60popASCIITab(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_62useASCIITabs(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_64printfASCII(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_msg); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_66printfASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_msg); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_68flush(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_70setFileMode(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_72getFileMode(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_74setFileName(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_76getFileName(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_78setDrawInfo(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_display, PyObject *__pyx_v_title, PyObject *__pyx_v_position, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_80clearDraw(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_create(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_2pushTimestepping(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_4popTimestepping(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_6getTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_8setTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self, PyObject *__pyx_v_timestep); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_10incrementTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_12pushGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self, PyObject *__pyx_v_group); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_14popGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_16getGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_6Random___cinit__(struct PyPetscRandomObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_2__call__(struct PyPetscRandomObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_4view(struct PyPetscRandomObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_6destroy(struct PyPetscRandomObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_8create(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_10setType(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_rnd_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_12getType(struct PyPetscRandomObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_14setFromOptions(struct PyPetscRandomObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_16getValue(struct PyPetscRandomObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_18getValueReal(struct PyPetscRandomObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_20getSeed(struct PyPetscRandomObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_22setSeed(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_seed); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_24getInterval(struct PyPetscRandomObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_26setInterval(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_interval); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_4seed___get__(struct PyPetscRandomObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_6Random_4seed_2__set__(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_8interval___get__(struct PyPetscRandomObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_6Random_8interval_2__set__(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_14staticproperty___get__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_6Device___cinit__(struct PyPetscDeviceObject *__pyx_v_self); /* proto */
static void __pyx_pf_8petsc4py_5PETSc_6Device_2__dealloc__(struct PyPetscDeviceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_4create(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_dtype, PyObject *__pyx_v_device_id); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_6destroy(struct PyPetscDeviceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_8configure(struct PyPetscDeviceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_10view(struct PyPetscDeviceObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_12getDeviceType(struct PyPetscDeviceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_4type___get__(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_9device_id___get__(struct PyPetscDeviceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_16setDefaultType(PyObject *__pyx_v_device_type); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_13DeviceContext___cinit__(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */
static void __pyx_pf_8petsc4py_5PETSc_13DeviceContext_2__dealloc__(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_4create(PyTypeObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_6getStreamType(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_8setStreamType(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_stream_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_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_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_6device___get__(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_13DeviceContext_6device_2__set__(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__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, PetscInt __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_30viewFromOptions(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_32getCurrent(void); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_34setCurrent(PyObject *__pyx_v_dctx); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_7current___get__(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_13DeviceContext_7current_2__set__(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_dctx); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2IS___cinit__(struct PyPetscISObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2IS_2__getbuffer__(struct PyPetscISObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto */
static void __pyx_pf_8petsc4py_5PETSc_2IS_4__releasebuffer__(struct PyPetscISObject *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_6__enter__(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_8__exit__(struct PyPetscISObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10view(struct PyPetscISObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_12destroy(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_14create(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_16setType(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_is_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_18getType(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_20createGeneral(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_22createBlock(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_indices, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_24createStride(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_first, PyObject *__pyx_v_step, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_26duplicate(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_28copy(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_result); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_30load(struct PyPetscISObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_32allGather(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_34toGeneral(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_36buildTwoSided(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_toindx); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_38invertPermutation(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_nlocal); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_40getSize(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_42getLocalSize(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_44getSizes(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_46getBlockSize(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_48setBlockSize(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_50sort(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_52isSorted(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_54setPermutation(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_56isPermutation(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_58setIdentity(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_60isIdentity(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_62equal(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_64sum(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_66expand(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_68union(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_70difference(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_72complement(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_nmin, PyObject *__pyx_v_nmax); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_74embed(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_drop); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_76renumber(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_mult); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_78setIndices(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_80getIndices(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_82setBlockIndices(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_84getBlockIndices(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_86setStride(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_first, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_88getStride(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_90getInfo(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_11permutation___get__(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_8identity___get__(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_6sorted___get__(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_5sizes___get__(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_4size___get__(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10local_size___get__(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10block_size___get__(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_7indices___get__(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_5array___get__(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_19__array_interface_____get__(struct PyPetscISObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_5LGMap___cinit__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_2__call__(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4setType(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_lgmap_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_6setFromOptions(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_8view(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10destroy(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_12create(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_14createIS(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_16createSF(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf, PyObject *__pyx_v_start); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_18getSize(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_20getBlockSize(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_22getIndices(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_24getBlockIndices(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_26getInfo(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_28getBlockInfo(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_30apply(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_32applyBlock(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_34applyIS(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_36applyInverse(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_38applyBlockInverse(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4size___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10block_size___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_7indices___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_13block_indices___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4info___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10block_info___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2SF___cinit__(struct PyPetscSFObject *__pyx_v_self); /* proto */
static void __pyx_pf_8petsc4py_5PETSc_2SF_2__dealloc__(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_4view(struct PyPetscSFObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_6destroy(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_8create(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_10setType(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_sf_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_12getType(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_14setFromOptions(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_16setUp(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_18reset(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_20getGraph(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_22setGraph(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_nroots, PyObject *__pyx_v_local, PyObject *__pyx_v_remote); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_24setRankOrder(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_26getMulti(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_28createInverse(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_30computeDegree(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_32createEmbeddedRootSF(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_selected); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_34createEmbeddedLeafSF(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_selected); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_36createSectionSF(struct PyPetscSFObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_rootSection, PyObject *__pyx_v_remoteOffsets, struct PyPetscSectionObject *__pyx_v_leafSection); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_38distributeSection(struct PyPetscSFObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_rootSection, struct PyPetscSectionObject *__pyx_v_leafSection); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_40compose(struct PyPetscSFObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_42bcastBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_rootdata, PyArrayObject *__pyx_v_leafdata, PyObject *__pyx_v_op); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_44bcastEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_rootdata, PyArrayObject *__pyx_v_leafdata, PyObject *__pyx_v_op); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_46reduceBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_rootdata, PyObject *__pyx_v_op); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_48reduceEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_rootdata, PyObject *__pyx_v_op); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_50scatterBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_multirootdata, PyArrayObject *__pyx_v_leafdata); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_52scatterEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_multirootdata, PyArrayObject *__pyx_v_leafdata); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_54gatherBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_multirootdata); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_56gatherEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_multirootdata); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_58fetchAndOpBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_rootdata, PyObject *__pyx_v_leafdata, PyObject *__pyx_v_leafupdate, PyObject *__pyx_v_op); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_60fetchAndOpEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_rootdata, PyObject *__pyx_v_leafdata, PyObject *__pyx_v_leafupdate, PyObject *__pyx_v_op); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_3Vec___cinit__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_2__pos__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_4__neg__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_6__abs__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8__iadd__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10__isub__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_12__imul__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_14__idiv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
#endif
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_16__itruediv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_18__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_20__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_22__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_24__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
#endif
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_26__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_28__getitem__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_3Vec_30__setitem__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_v); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_3Vec_32__getbuffer__(struct PyPetscVecObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto */
static void __pyx_pf_8petsc4py_5PETSc_3Vec_34__releasebuffer__(struct PyPetscVecObject *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_36__enter__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_38__exit__(struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_40view(struct PyPetscVecObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_42destroy(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_44create(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_46setType(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vec_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_48setSizes(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_50createSeq(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_52createMPI(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_54createWithArray(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_56createCUDAWithArrays(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_58createHIPWithArrays(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_60createViennaCLWithArrays(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_62createWithDLPack(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_64attachDLPackInfo(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_dltensor); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_66clearDLPackInfo(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_68__dlpack__(struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_stream); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_70__dlpack_device__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_72toDLPack(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_74createGhost(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_76createGhostWithArray(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_78createShared(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_80createNest(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_82setOptionsPrefix(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_84getOptionsPrefix(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_86appendOptionsPrefix(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_88setFromOptions(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_90setUp(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_92setOption(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_option, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_94getType(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_96getSize(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_98getLocalSize(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_100getSizes(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_102setBlockSize(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_bsize); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_104getBlockSize(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_106getOwnershipRange(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_108getOwnershipRanges(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_110createLocalVector(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_112getLocalVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_lvec, PyObject *__pyx_v_readonly); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_114restoreLocalVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_lvec, PyObject *__pyx_v_readonly); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_116getBuffer(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_readonly); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_118getArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_readonly); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_120setArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_122placeArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_124resetArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_force); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_126bindToCPU(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_flg); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_128boundToCPU(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_130getCUDAHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_132restoreCUDAHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_handle, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_134getHIPHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_136restoreHIPHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_handle, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_138getOffloadMask(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_140getCLContextHandle(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_142getCLQueueHandle(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_144getCLMemHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_146restoreCLMemHandle(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_148duplicate(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_150copy(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_152chop(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_154load(struct PyPetscVecObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_156equal(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_158dot(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_160dotBegin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_162dotEnd(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_164tDot(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_166tDotBegin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_168tDotEnd(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_170mDot(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_172mDotBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_174mDotEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_176mtDot(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_178mtDotBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_180mtDotEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_182norm(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_norm_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_184normBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_norm_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_186normEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_norm_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_188sum(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_190min(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_192max(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_194normalize(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_196reciprocal(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_198exp(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_200log(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_202sqrtabs(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_204abs(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_206conjugate(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_208setRandom(struct PyPetscVecObject *__pyx_v_self, struct PyPetscRandomObject *__pyx_v_random); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_210permute(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_order, PyObject *__pyx_v_invert); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_212zeroEntries(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_214set(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_216isset(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_idx, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_218scale(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_220shift(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_222chop(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_224swap(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_226axpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_228isaxpy(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_230aypx(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_232axpby(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, PyObject *__pyx_v_beta, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_234waxpy(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_236maxpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alphas, PyObject *__pyx_v_vecs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_238pointwiseMult(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_240pointwiseDivide(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_242pointwiseMin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_244pointwiseMax(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_246pointwiseMaxAbs(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_248maxPointwiseDivide(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_250getValue(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_252getValues(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_254getValuesStagStencil(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_256setValue(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_258setValues(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_260setValuesBlocked(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_262setValuesStagStencil(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_264setLGMap(struct PyPetscVecObject *__pyx_v_self, struct PyPetscLGMapObject *__pyx_v_lgmap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_266getLGMap(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_268setValueLocal(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_270setValuesLocal(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_272setValuesBlockedLocal(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_274assemblyBegin(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_276assemblyEnd(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_278assemble(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_280strideScale(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_282strideSum(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_284strideMin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_286strideMax(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_288strideNorm(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_norm_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_290strideScatter(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_292strideGather(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_294localForm(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_296ghostUpdateBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_298ghostUpdateEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_300ghostUpdate(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_302setMPIGhost(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_ghosts); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_304getSubVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, struct PyPetscVecObject *__pyx_v_subvec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_306restoreSubVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, struct PyPetscVecObject *__pyx_v_subvec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_308getNestSubVecs(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_310setNestSubVecs(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_sx, PyObject *__pyx_v_idxm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_312setDM(struct PyPetscVecObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_314getDM(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_5sizes___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_3Vec_5sizes_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_4size___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10local_size___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10block_size___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_11owner_range___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_12owner_ranges___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_w___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_r___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_7array_w___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_3Vec_7array_w_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_7array_r___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_6buffer___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_5array___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_3Vec_5array_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_19__array_interface_____get__(struct PyPetscVecObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4Quad___cinit__(struct PyPetscQuadObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_2view(struct PyPetscQuadObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_4create(struct PyPetscQuadObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_6duplicate(struct PyPetscQuadObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_8destroy(struct PyPetscQuadObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_10getData(struct PyPetscQuadObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_12getNumComponents(struct PyPetscQuadObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_14setNumComponents(struct PyPetscQuadObject *__pyx_v_self, PyObject *__pyx_v_nc); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_16getOrder(struct PyPetscQuadObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_18setOrder(struct PyPetscQuadObject *__pyx_v_self, PyObject *__pyx_v_order); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2FE___cinit__(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_2view(struct PyPetscFEObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_4destroy(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_6create(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_8createDefault(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_nc, PyObject *__pyx_v_isSimplex, PyObject *__pyx_v_qorder, PyObject *__pyx_v_prefix, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_10createLagrange(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_nc, PyObject *__pyx_v_isSimplex, PyObject *__pyx_v_k, PyObject *__pyx_v_qorder, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_12getQuadrature(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_14getDimension(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_16getSpatialDimension(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_18getNumComponents(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_20setNumComponents(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_comp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_22getNumDof(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_24getTileSizes(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_26setTileSizes(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_blockSize, PyObject *__pyx_v_numBlocks, PyObject *__pyx_v_batchSize, PyObject *__pyx_v_numBatches); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_28getFaceQuadrature(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_30setQuadrature(struct PyPetscFEObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_32setFaceQuadrature(struct PyPetscFEObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_34setType(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_fe_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_36getBasisSpace(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_38setBasisSpace(struct PyPetscFEObject *__pyx_v_self, struct PyPetscSpaceObject *__pyx_v_sp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_40setFromOptions(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_42setUp(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_44getDualSpace(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_46setDualSpace(struct PyPetscFEObject *__pyx_v_self, struct PyPetscDualSpaceObject *__pyx_v_dspace); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_48viewFromOptions(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_7Scatter___cinit__(struct PyPetscScatterObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_2__call__(struct PyPetscScatterObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_4view(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_6destroy(struct PyPetscScatterObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_8create(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscISObject *__pyx_v_is_from, struct PyPetscVecObject *__pyx_v_vec_to, struct PyPetscISObject *__pyx_v_is_to); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_10setType(struct PyPetscScatterObject *__pyx_v_self, PyObject *__pyx_v_scatter_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_12getType(struct PyPetscScatterObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_14setFromOptions(struct PyPetscScatterObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_16setUp(struct PyPetscScatterObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_18copy(struct PyPetscScatterObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_20toAll(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_22toZero(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_24begin(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_26end(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_28scatterBegin(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_30scatterEnd(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_32scatter(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_7Section___cinit__(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static void __pyx_pf_8petsc4py_5PETSc_7Section_2__dealloc__(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_4view(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_6destroy(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_8create(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_10clone(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_12setUp(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_14reset(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_16getNumFields(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_18setNumFields(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_numFields); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_20getFieldName(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_22setFieldName(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_fieldName); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_24getFieldComponents(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_26setFieldComponents(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_numComp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_28getChart(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_30setChart(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_pStart, PyObject *__pyx_v_pEnd); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_32getPermutation(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_34setPermutation(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_perm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_36getDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_38setDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_40addDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_42getFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_44setFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_46addFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_48getConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_50setConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_52addConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_54getFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_56setFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_58addFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_60getConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_62setConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_64getFieldConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_66setFieldConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_68getMaxDof(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_70getStorageSize(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_72getConstrainedStorageSize(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_74getOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_76setOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_offset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_78getFieldOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_80setFieldOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_offset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_82getOffsetRange(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_84createGlobalSection(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_3Mat___cinit__(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_2__pos__(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_4__neg__(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_6__iadd__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_8__isub__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10__imul__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_12__idiv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
#endif
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_14__itruediv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_16__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_18__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_20__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_22__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
#endif
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_24__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_26__getitem__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ij); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_3Mat_28__setitem__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_30__call__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_32view(struct PyPetscMatObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_34destroy(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_36create(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_38setType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mat_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_40setSizes(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_42setBlockSize(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_bsize); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_44setBlockSizes(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row_bsize, PyObject *__pyx_v_col_bsize); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_46setVecType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_vec_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_48getVecType(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_50createAIJ(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_52createBAIJ(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_54createSBAIJ(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_56createAIJCRL(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_58setPreallocationNNZ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nnz); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_60setPreallocationCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_csr); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_62createAIJWithArrays(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_64createDense(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_66createDenseCUDA(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_68setPreallocationDense(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_array); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_70createScatter(struct PyPetscMatObject *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_scatter, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_72createNormal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_74createTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_76createNormalHermitian(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_78createHermitianTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_80createLRC(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_82createSubMatrixVirtual(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_84createNest(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_86createH2OpusFromMat(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_88createIS(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, struct PyPetscLGMapObject *__pyx_v_lgmapr, struct PyPetscLGMapObject *__pyx_v_lgmapc, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_90createPython(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_92setPythonContext(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_94getPythonContext(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_96setPythonType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_98getPythonType(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_100setOptionsPrefix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_102getOptionsPrefix(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_104appendOptionsPrefix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_106setFromOptions(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_108setUp(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_110setOption(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_option, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_112getOption(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_option); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_114getType(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_116getSize(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_118getLocalSize(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_120getSizes(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_122getBlockSize(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_124getBlockSizes(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_126getOwnershipRange(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_128getOwnershipRanges(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_130getOwnershipRangeColumn(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_132getOwnershipRangesColumn(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_134getOwnershipIS(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_136getInfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_info); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_138duplicate(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_copy); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_140copy(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_structure); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_142load(struct PyPetscMatObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_144convert(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mat_type, struct PyPetscMatObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_146transpose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_148setTransposePrecursor(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_150hermitianTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_152realPart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_154imagPart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_156conjugate(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_158permute(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_row, struct PyPetscISObject *__pyx_v_col); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_160equal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_162isTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_tol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_164isSymmetric(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_166isSymmetricKnown(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_168isHermitian(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_170isHermitianKnown(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_172isStructurallySymmetric(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_174zeroEntries(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_176getValue(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_178getValues(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_180getValuesCSR(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_182getRow(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_184getRowIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_symmetric, PyObject *__pyx_v_compressed); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_186getColumnIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_symmetric, PyObject *__pyx_v_compressed); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_188setValue(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_190setValues(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_192setValuesRCV(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_194setValuesIJV(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_196setValuesCSR(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_198setValuesBlocked(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_200setValuesBlockedRCV(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_202setValuesBlockedIJV(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_204setValuesBlockedCSR(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_206setLGMap(struct PyPetscMatObject *__pyx_v_self, struct PyPetscLGMapObject *__pyx_v_rmap, struct PyPetscLGMapObject *__pyx_v_cmap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_208getLGMap(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_210setValueLocal(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_212setValuesLocal(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_214setValuesLocalRCV(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_216setValuesLocalIJV(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_218setValuesLocalCSR(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_220setValuesBlockedLocal(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_222setValuesBlockedLocalRCV(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_224setValuesBlockedLocalIJV(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_226setValuesBlockedLocalCSR(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_228setStencil(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_230setValueStencil(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_232setValueStagStencil(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_234setValueBlockedStencil(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_236setValueBlockedStagStencil(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_238zeroRows(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_240zeroRowsLocal(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_242zeroRowsColumns(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_244zeroRowsColumnsLocal(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_246zeroRowsColumnsStencil(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_248storeValues(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_250retrieveValues(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_252assemblyBegin(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_254assemblyEnd(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_256assemble(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_258isAssembled(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_260findZeroRows(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_262createVecs(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_side); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_264createVecRight(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_266createVecLeft(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_268getColumnVector(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_column, struct PyPetscVecObject *__pyx_v_result); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_270getRedundantMatrix(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_272getDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_274getRowSum(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_276setDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_diag, PyObject *__pyx_v_addv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_278diagonalScale(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_L, struct PyPetscVecObject *__pyx_v_R); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_280invertBlockDiagonal(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_282setNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_284getNullSpace(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_286setTransposeNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_288getTransposeNullSpace(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_290setNearNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_292getNearNullSpace(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_294mult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_296multAdd(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_298multTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_300multTransposeAdd(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_302multHermitian(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_304multHermitianAdd(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_306SOR(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_308getDiagonalBlock(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_310increaseOverlap(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_overlap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_312createSubMatrix(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_314createSubMatrices(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_316getLocalSubMatrix(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_318restoreLocalSubMatrix(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_320norm(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_norm_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_322scale(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_324shift(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_326chop(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_328setRandom(struct PyPetscMatObject *__pyx_v_self, struct PyPetscRandomObject *__pyx_v_random); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_330axpy(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_332aypx(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_334matMult(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_336matTransposeMult(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_338transposeMatMult(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_340ptap(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_342rart(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_344matMatMult(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_346kron(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_348bindToCPU(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_flg); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_350boundToCPU(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_352getOrdering(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ord_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_354reorderForNonzeroDiagonal(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_356factorLU(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_358factorSymbolicLU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_360factorNumericLU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_362factorILU(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_364factorSymbolicILU(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_366factorCholesky(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_368factorSymbolicCholesky(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_370factorNumericCholesky(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_372factorICC(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_374factorSymbolicICC(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_376getInertia(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_378setUnfactored(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_380fixISLocalEmpty(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_fix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_382getISLocalMat(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_384restoreISLocalMat(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_local); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_386setISLocalMat(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_local); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_388setISPreallocation(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nnz, PyObject *__pyx_v_onnz); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_390getLRCMats(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_392H2OpusOrthogonalize(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_394H2OpusCompress(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_396H2OpusLowRankUpdate(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_398setMumpsIcntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl, PyObject *__pyx_v_ival); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_400getMumpsIcntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_402setMumpsCntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_404getMumpsCntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_406getMumpsInfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_408getMumpsInfog(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_410getMumpsRinfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_412getMumpsRinfog(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_414solveForward(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_416solveBackward(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_418solve(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_420solveTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_422solveAdd(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_424solveTransposeAdd(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_426matSolve(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_428setDenseLDA(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_lda); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_430getDenseLDA(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_432getDenseArray(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_readonly); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_434getDenseLocalMatrix(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_436getDenseColumnVec(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_438restoreDenseColumnVec(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_440getNestSize(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_442getNestISs(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_444getNestLocalISs(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_446getNestSubMatrix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_448getISLocalMat(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_450getDM(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_452setDM(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_454__dlpack__(struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_stream); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_456__dlpack_device__(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_458toDLPack(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_9NullSpace___cinit__(struct PyPetscNullSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_2__call__(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_4view(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_6destroy(struct PyPetscNullSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_8create(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_constant, PyObject *__pyx_v_vectors, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_10createRigidBody(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_coords); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_12setFunction(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_14hasConstant(struct PyPetscNullSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_16getVecs(struct PyPetscNullSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_18getFunction(struct PyPetscNullSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_20remove(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_22test(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_15MatPartitioning___cinit__(struct PyPetscMatPartitioningObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_2__call__(struct PyPetscMatPartitioningObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_4view(struct PyPetscMatPartitioningObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_6destroy(struct PyPetscMatPartitioningObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_8create(struct PyPetscMatPartitioningObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_10setType(struct PyPetscMatPartitioningObject *__pyx_v_self, PyObject *__pyx_v_matpartitioning_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_12getType(struct PyPetscMatPartitioningObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_14setFromOptions(struct PyPetscMatPartitioningObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_16setAdjacency(struct PyPetscMatPartitioningObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_adj); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_18apply(struct PyPetscMatPartitioningObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_partitioning); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2PC___cinit__(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_2__call__(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_4view(struct PyPetscPCObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_6destroy(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_8create(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_10setType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_pc_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_12getType(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_14setOptionsPrefix(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_16getOptionsPrefix(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_18appendOptionsPrefix(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_20setFromOptions(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_22setOperators(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_P); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_24getOperators(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_26setUseAmat(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_28getUseAmat(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_30setReusePreconditioner(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_32setFailedReason(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_34getFailedReason(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_36getFailedReasonRank(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_38setUp(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_40reset(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_42setUpOnBlocks(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_44apply(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_46matApply(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_48applyTranspose(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_50applySymmetricLeft(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_52applySymmetricRight(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_54getDM(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_56setDM(struct PyPetscPCObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_58setCoordinates(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_coordinates); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_60createPython(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_62setPythonContext(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_64getPythonContext(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_66setPythonType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_68getPythonType(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_70setASMType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_asmtype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_72setASMOverlap(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_74setASMLocalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_, PyObject *__pyx_v_is_local); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_76setASMTotalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_, PyObject *__pyx_v_is_local); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_78getASMSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_80setASMSortIndices(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_dosort); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_82setGASMType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_gasmtype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_84setGASMOverlap(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_86setGAMGType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_gamgtype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_88setGAMGLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_90setGAMGSmooths(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_smooths); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_92getHYPREType(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_94setHYPREType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_hypretype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_96setHYPREDiscreteCurl(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_98setHYPREDiscreteGradient(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_100setHYPRESetAlphaPoissonMatrix(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_102setHYPRESetBetaPoissonMatrix(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_104setHYPRESetInterpolations(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_dim, struct PyPetscMatObject *__pyx_v_RT_Pi_Full, PyObject *__pyx_v_RT_Pi, struct PyPetscMatObject *__pyx_v_ND_Pi_Full, PyObject *__pyx_v_ND_Pi); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_106setHYPRESetEdgeConstantVectors(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_ozz, struct PyPetscVecObject *__pyx_v_zoz, struct PyPetscVecObject *__pyx_v_zzo); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_108setHYPREAMSSetInteriorNodes(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_interior); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_110setFactorSolverType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_solver); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_112getFactorSolverType(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_114setFactorSetUpSolverType(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_116setFactorOrdering(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ord_type, PyObject *__pyx_v_nzdiag, PyObject *__pyx_v_reuse); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_118setFactorPivot(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_zeropivot, PyObject *__pyx_v_inblocks); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_120setFactorShift(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_shift_type, PyObject *__pyx_v_amount); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_122setFactorLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_124getFactorMatrix(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_126setFieldSplitType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_128setFieldSplitIS(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_130setFieldSplitFields(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_132getFieldSplitSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_134getFieldSplitSchurGetSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_136setFieldSplitSchurFactType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_138setFieldSplitSchurPreType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ptype, struct PyPetscMatObject *__pyx_v_pre); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_140setCompositeType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_142getCompositePC(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_144addCompositePCType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_pc_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_146getKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_148getMGType(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_150setMGType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_mgtype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_152getMGLevels(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_154setMGLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_156getMGCoarseSolve(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_158setMGInterpolation(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_160getMGInterpolation(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_162setMGRestriction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_164getMGRestriction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_166setMGRScale(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_rscale); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_168getMGRScale(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_170getMGSmoother(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_172getMGSmootherDown(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_174getMGSmootherUp(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_176setMGCycleType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_cycle_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_178setMGCycleTypeOnLevel(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_cycle_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_180setMGRhs(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_182setMGX(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_184setMGR(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_r); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_186setBDDCDivergenceMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_div, PyObject *__pyx_v_trans, struct PyPetscISObject *__pyx_v_l2l); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_188setBDDCDiscreteGradient(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_G, PyObject *__pyx_v_order, PyObject *__pyx_v_field, PyObject *__pyx_v_gord, PyObject *__pyx_v_conforming); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_190setBDDCChangeOfBasisMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_T, PyObject *__pyx_v_interior); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_192setBDDCPrimalVerticesIS(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_primv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_194setBDDCPrimalVerticesLocalIS(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_primv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_196setBDDCCoarseningRatio(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_cratio); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_198setBDDCLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_200setBDDCDirichletBoundaries(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_202setBDDCDirichletBoundariesLocal(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_204setBDDCNeumannBoundaries(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_206setBDDCNeumannBoundariesLocal(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_208setBDDCDofsSplitting(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_isfields); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_210setBDDCDofsSplittingLocal(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_isfields); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_212setPatchCellNumbering(struct PyPetscPCObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_214setPatchDiscretisationInfo(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_dms, PyObject *__pyx_v_bs, PyObject *__pyx_v_cellNodeMaps, PyObject *__pyx_v_subspaceOffsets, PyObject *__pyx_v_ghostBcNodes, PyObject *__pyx_v_globalBcNodes); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_216setPatchComputeOperator(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_218setPatchComputeOperatorInteriorFacets(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_220setPatchComputeFunction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_222setPatchComputeFunctionInteriorFacets(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_224setPatchConstructType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_226setHPDDMAuxiliaryMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_uis, struct PyPetscMatObject *__pyx_v_uaux); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_228setHPDDMRHSMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_230setHPDDMHasNeumannMat(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_has); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_232setHPDDMCoarseCorrectionType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_correction_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_234getHPDDMCoarseCorrectionType(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_236getHPDDMSTShareSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_238setHPDDMDeflationMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_uis, struct PyPetscMatObject *__pyx_v_U); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_240setSPAIEpsilon(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_242setSPAINBSteps(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nbsteps); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_244setSPAIMax(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_maxval); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_246setSPAIMaxNew(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_maxval); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_248setSPAIBlockSize(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_250setSPAICacheSize(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_252setSPAIVerbose(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_254setSPAISp(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_sym); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_256setDeflationInitOnly(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_flg); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_258setDeflationLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_260setDeflationReductionFactor(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_red); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_262setDeflationCorrectionFactor(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_fact); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_264setDeflationSpaceToCompute(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_space_type, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_266setDeflationSpace(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_W, PyObject *__pyx_v_transpose); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_268setDeflationProjectionNullSpaceMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_270setDeflationCoarseMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_272getDeflationCoarseKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_274getDeflationPC(struct PyPetscPCObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_3KSP___cinit__(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2__call__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_b, PyObject *__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, int __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_32setComputeRHS(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rhs, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_34setComputeOperators(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_operators, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_36setOperators(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_P); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_38getOperators(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_40setPC(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscPCObject *__pyx_v_pc); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_42getPC(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_44setTolerances(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol, PyObject *__pyx_v_divtol, PyObject *__pyx_v_max_it); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_46getTolerances(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_48setConvergenceTest(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_50getConvergenceTest(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_52callConvergenceTest(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_54setConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_reset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_56getConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_58logConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rnorm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_60setMonitor(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_62getMonitor(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_64monitorCancel(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_66monitor(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_68setPCSide(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_side); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_70getPCSide(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_72setNormType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_normtype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_74getNormType(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_76setComputeEigenvalues(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_78getComputeEigenvalues(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_80setComputeSingularValues(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_82getComputeSingularValues(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_84setInitialGuessNonzero(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_86getInitialGuessNonzero(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_88setInitialGuessKnoll(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_90getInitialGuessKnoll(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_92setUseFischerGuess(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_model, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_94setUp(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_96reset(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_98setUpOnBlocks(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_100solve(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_102solveTranspose(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_104matSolve(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_106matSolveTranspose(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_108setIterationNumber(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_110getIterationNumber(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_112setResidualNorm(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rnorm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_114getResidualNorm(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_116setConvergedReason(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_118getConvergedReason(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_120setErrorIfNotConverged(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_122getErrorIfNotConverged(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_124getRhs(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_126getSolution(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_128getWorkVecs(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_right, PyObject *__pyx_v_left); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_130buildSolution(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_132buildResidual(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_r); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_134computeEigenvalues(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_136computeExtremeSingularValues(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_138setGMRESRestart(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_restart); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_140createPython(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_142setPythonContext(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_144getPythonContext(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_146setPythonType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_148getPythonType(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_9iterating___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_9converged___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_8diverged___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES___cinit__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_2view(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4destroy(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6create(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_8setType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_snes_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_10getType(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_12setOptionsPrefix(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_14getOptionsPrefix(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_16appendOptionsPrefix(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_18setFromOptions(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_20setApplicationContext(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_22getApplicationContext(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_24getDM(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_26setDM(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_28setFASInterpolation(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_30getFASInterpolation(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_32setFASRestriction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_34getFASRestriction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_36setFASInjection(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_38getFASInjection(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_40setFASRScale(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_42setFASLevels(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_levels, PyObject *__pyx_v_comms); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_44getFASLevels(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_46getFASCycleSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_48getFASCoarseSolve(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_50getFASSmoother(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_52getFASSmootherDown(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_54getFASSmootherUp(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_56getNPC(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_58hasNPC(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_60setNPC(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscSNESObject *__pyx_v_snes); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_62setNPCSide(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_side); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_64getNPCSide(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_66setLineSearchPreCheck(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_precheck, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_68setInitialGuess(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_initialguess, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_70getInitialGuess(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_72setFunction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_74getFunction(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_76setUpdate(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_update, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_78getUpdate(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_80setJacobian(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_82getJacobian(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_84setObjective(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_objective, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_86getObjective(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_88computeFunction(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_90computeJacobian(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_92computeObjective(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_94setNGS(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_ngs, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_96getNGS(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_98computeNGS(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_100setTolerances(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol, PyObject *__pyx_v_stol, PyObject *__pyx_v_max_it); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_102getTolerances(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_104setNormSchedule(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_normsched); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_106getNormSchedule(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_108setConvergenceTest(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_110getConvergenceTest(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_112callConvergenceTest(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_xnorm, PyObject *__pyx_v_ynorm, PyObject *__pyx_v_fnorm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_114setConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_reset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_116getConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_118logConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_norm, PyObject *__pyx_v_linear_its); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_120setResetCounters(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_reset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_122setMonitor(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_124getMonitor(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_126monitorCancel(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_128monitor(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_130setMaxFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_funcs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_132getMaxFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_134getFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_136setMaxStepFailures(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_fails); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_138getMaxStepFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_140getStepFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_142setMaxKSPFailures(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_fails); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_144getMaxKSPFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_146getKSPFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_148setUp(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_150reset(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_152solve(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_154setConvergedReason(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_156getConvergedReason(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_158setErrorIfNotConverged(struct PyPetscSNESObject *__pyx_v_self, int __pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_160getErrorIfNotConverged(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_162setIterationNumber(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_164getIterationNumber(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_166setForceIteration(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_force); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_168setFunctionNorm(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_norm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_170getFunctionNorm(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_172getLinearSolveIterations(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_174getRhs(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_176getSolution(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_178setSolution(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_180getSolutionUpdate(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_182setKSP(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscKSPObject *__pyx_v_ksp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_184getKSP(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_186setUseEW(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_188getUseEW(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_190setParamsEW(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_192getParamsEW(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_194setUseMF(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_196getUseMF(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_198setUseFD(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_200getUseFD(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_202setVariableBounds(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_204getVIInactiveSet(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_206createPython(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_208setPythonContext(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_210getPythonContext(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_212setPythonType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_214getPythonType(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_216getCompositeSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_218getCompositeNumber(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_220getNASMSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_222getNASMNumber(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_224setPatchCellNumbering(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_226setPatchDiscretisationInfo(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_228setPatchComputeOperator(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_230setPatchComputeFunction(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_232setPatchConstructType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6appctx___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_6appctx_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_2dm___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_2dm_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3npc___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_3npc_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_sol___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_upd___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_rhs___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3ksp___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_3ksp_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4rtol___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_4rtol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4atol___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_4atol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4stol___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_4stol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6max_it___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_6max_it_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3its___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_3its_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4norm___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_4norm_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7history___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6reason___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_6reason_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_9iterating___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_9converged___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_8diverged___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2TS___cinit__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_2view(struct PyPetscTSObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4load(struct PyPetscTSObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6destroy(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_8create(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_10clone(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_12setType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_14setRKType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_16setARKIMEXType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_18setARKIMEXFullyImplicit(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_20getType(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_22getRKType(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_24getARKIMEXType(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_26setProblemType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ptype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_28getProblemType(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_30setEquationType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_eqtype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_32getEquationType(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_34setOptionsPrefix(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_36getOptionsPrefix(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_38appendOptionsPrefix(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_40setFromOptions(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_42setAppCtx(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_44getAppCtx(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_46setRHSFunction(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_48setRHSJacobian(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_50computeRHSFunction(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_52computeRHSFunctionLinear(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_54computeRHSJacobian(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_56computeRHSJacobianConstant(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_58getRHSFunction(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_60getRHSJacobian(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_62setIFunction(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_64setIJacobian(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_66setIJacobianP(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_68computeIFunction(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_70computeIJacobian(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_72computeIJacobianP(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_74getIFunction(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_76getIJacobian(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_78setI2Function(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_80setI2Jacobian(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_82computeI2Function(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_84computeI2Jacobian(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_86getI2Function(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_88getI2Jacobian(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_90setSolution(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_92getSolution(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_94setSolution2(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u, struct PyPetscVecObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_96getSolution2(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_98setTimeSpan(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_tspan); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_100getTimeSpan(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_102getTimeSpanSolutions(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_104getSNES(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_106getKSP(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_108getDM(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_110setDM(struct PyPetscTSObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_112setTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_114getTime(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_116getPrevTime(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_118getSolveTime(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_120setTimeStep(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_time_step); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_122getTimeStep(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_124setStepNumber(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_step_number); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_126getStepNumber(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_128setMaxTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_max_time); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_130getMaxTime(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_132setMaxSteps(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_max_steps); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_134getMaxSteps(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_136getSNESIterations(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_138getKSPIterations(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_140setMaxStepRejections(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_142getStepRejections(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_144setMaxSNESFailures(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_146getSNESFailures(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_148setErrorIfStepFails(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_150setTolerances(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_152getTolerances(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_154setExactFinalTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_option); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_156setConvergedReason(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_158getConvergedReason(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_160setMonitor(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_162getMonitor(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_164monitorCancel(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_166monitor(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_168setEventHandler(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_direction, PyObject *__pyx_v_terminate, PyObject *__pyx_v_eventhandler, PyObject *__pyx_v_postevent, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_170setEventTolerances(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_tol, PyObject *__pyx_v_vtol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_172getNumEvents(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_174setPreStep(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_176getPreStep(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_178setPostStep(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_180getPostStep(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_182setUp(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_184reset(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_186step(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_188restartStep(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_190rollBack(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_192solve(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_194interpolate(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_196setStepLimits(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_hmin, PyObject *__pyx_v_hmax); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_198getStepLimits(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_200setSaveTrajectory(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_202removeTrajectory(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_204getCostIntegral(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_206setCostGradients(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_vl, PyObject *__pyx_v_vm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_208getCostGradients(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_210setRHSJacobianP(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_212createQuadratureTS(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_forward); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_214getQuadratureTS(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_216setRHSJacobianP(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_218computeRHSJacobianP(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_220adjointSetSteps(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_adjoint_steps); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_222adjointSetUp(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_224adjointSolve(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_226adjointStep(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_228adjointReset(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_230createPython(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_232setPythonContext(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_234getPythonContext(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_236setPythonType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_238getPythonType(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_240setTheta(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_theta); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_242getTheta(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_244setThetaEndpoint(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_246getThetaEndpoint(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_248setAlphaRadius(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_radius); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_250setAlphaParams(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_252getAlphaParams(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6appctx___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2TS_6appctx_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_2dm___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2TS_2dm_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_12problem_type___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2TS_12problem_type_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_13equation_type___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2TS_13equation_type_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4snes___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_3ksp___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_7vec_sol___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4time___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2TS_4time_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9time_step___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2TS_9time_step_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_11step_number___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2TS_11step_number_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_8max_time___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2TS_8max_time_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9max_steps___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2TS_9max_steps_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4rtol___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2TS_4rtol_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4atol___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2TS_4atol_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6reason___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2TS_6reason_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9iterating___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9converged___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_8diverged___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_3TAO___cinit__(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_2view(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4destroy(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_6create(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8setType(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_tao_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_10getType(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_12setOptionsPrefix(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_14appendOptionsPrefix(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_16getOptionsPrefix(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_18setFromOptions(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_20setUp(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_22setInitialTrustRegionRadius(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_radius); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_24setAppCtx(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_26getAppCtx(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_28setSolution(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_30setObjective(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_objective, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_32setResidual(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_residual, struct PyPetscVecObject *__pyx_v_R, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_34setJacobianResidual(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_36setGradient(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_gradient, struct PyPetscVecObject *__pyx_v_g, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_38getGradient(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_40setObjectiveGradient(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_objgrad, struct PyPetscVecObject *__pyx_v_g, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_42getObjectiveAndGradient(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_44setVariableBounds(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_varbounds, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_46setConstraints(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_constraints, struct PyPetscVecObject *__pyx_v_C, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_48setHessian(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_hessian, struct PyPetscMatObject *__pyx_v_H, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_50getHessian(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_52setJacobian(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_54setStateDesignIS(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_state, struct PyPetscISObject *__pyx_v_design); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_56setJacobianState(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian_state, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, struct PyPetscMatObject *__pyx_v_I, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_58setJacobianDesign(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian_design, struct PyPetscMatObject *__pyx_v_J, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_60setEqualityConstraints(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_equality_constraints, struct PyPetscVecObject *__pyx_v_c, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_62setJacobianEquality(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian_equality, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_64setUpdate(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_update, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_66getUpdate(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_68computeObjective(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_70computeResidual(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_72computeGradient(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_g); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_74computeObjectiveGradient(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_g); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_76computeDualVariables(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_78computeVariableBounds(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_80computeConstraints(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_82computeHessian(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_H, struct PyPetscMatObject *__pyx_v_P); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_84computeJacobian(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_86setTolerances(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_gatol, PyObject *__pyx_v_grtol, PyObject *__pyx_v_gttol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_88getTolerances(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_90setMaximumIterations(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_mit); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_92getMaximumIterations(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_94setMaximumFunctionEvaluations(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_mit); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_96getMaximumFunctionEvaluations(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_98setConstraintTolerances(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_catol, PyObject *__pyx_v_crtol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_100getConstraintTolerances(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_102setConvergenceTest(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_104getConvergenceTest(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_106setConvergedReason(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_108getConvergedReason(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_110setMonitor(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_112getMonitor(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_114cancelMonitor(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_116monitor(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_f, PyObject *__pyx_v_res, PyObject *__pyx_v_cnorm, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_118solve(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_120getSolution(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_122setGradientNorm(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_124getGradientNorm(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_126setLMVMH0(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_128getLMVMH0(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_130getLMVMH0KSP(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_132getVariableBounds(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_134setIterationNumber(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_its); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_136getIterationNumber(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_138getObjectiveValue(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_140getConvergedReason(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_142getSolutionNorm(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_144getSolutionStatus(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_146getKSP(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_148getBRGNSubsolver(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_150setBRGNRegularizerObjectiveGradient(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_152setBRGNRegularizerHessian(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_154setBRGNRegularizerWeight(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_156setBRGNSmoothL1Epsilon(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_epsilon); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_158setBRGNDictionaryMatrix(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_D); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_160getBRGNDampingVector(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_162createPython(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_164setPythonContext(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_166getPythonContext(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_168setPythonType(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_170getPythonType(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_2AO___cinit__(struct PyPetscAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_2view(struct PyPetscAOObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_4destroy(struct PyPetscAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_6createBasic(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_app, PyObject *__pyx_v_petsc, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_8createMemoryScalable(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_app, PyObject *__pyx_v_petsc, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_10createMapping(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_app, PyObject *__pyx_v_petsc, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_12getType(struct PyPetscAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_14app2petsc(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_16petsc2app(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2DM___cinit__(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_2view(struct PyPetscDMObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_4load(struct PyPetscDMObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_6destroy(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_8create(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_10clone(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_12setType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dm_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_14getType(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_16getDimension(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_18setDimension(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_20getCoordinateDim(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_22setCoordinateDim(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_24setOptionsPrefix(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_26getOptionsPrefix(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_28appendOptionsPrefix(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_30setFromOptions(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_32viewFromOptions(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_34setUp(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_36setAppCtx(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_38getAppCtx(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_40setBasicAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_useCone, PyObject *__pyx_v_useClosure); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_42getBasicAdjacency(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_44setFieldAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_useCone, PyObject *__pyx_v_useClosure); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_46getFieldAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_48createSubDM(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_50setAuxiliaryVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_aux, PyObject *__pyx_v_label, PyObject *__pyx_v_value, PyObject *__pyx_v_part); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_52getAuxiliaryVec(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_label, PyObject *__pyx_v_value, PyObject *__pyx_v_part); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_54setNumFields(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_numFields); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_56getNumFields(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_58setField(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index, struct PyPetscObjectObject *__pyx_v_field, PyObject *__pyx_v_label); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_60getField(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_62addField(struct PyPetscDMObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_field, PyObject *__pyx_v_label); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_64clearFields(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_66copyFields(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_68createDS(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_70clearDS(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_72getDS(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_74copyDS(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_76copyDisc(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_78getBlockSize(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_80setVecType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_vec_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_82createGlobalVec(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_84createLocalVec(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_86getGlobalVec(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_88restoreGlobalVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_90getLocalVec(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_92restoreLocalVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_94globalToLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg, struct PyPetscVecObject *__pyx_v_vl, PyObject *__pyx_v_addv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_96localToGlobal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl, struct PyPetscVecObject *__pyx_v_vg, PyObject *__pyx_v_addv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_98localToLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl, struct PyPetscVecObject *__pyx_v_vlg, PyObject *__pyx_v_addv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_100getLGMap(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_102getCoordinateDM(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_104getCoordinateSection(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_106setCoordinates(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_108getCoordinates(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_110setCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_112getCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_114projectCoordinates(struct PyPetscDMObject *__pyx_v_self, struct PyPetscFEObject *__pyx_v_disc); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_116getBoundingBox(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_118getLocalBoundingBox(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_120localizeCoordinates(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_122setMatType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_mat_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_124createMat(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_126createMassMatrix(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dmf); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_128createInterpolation(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_130createInjection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_132createRestriction(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_134convert(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dm_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_136refine(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_138coarsen(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_140refineHierarchy(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_nlevels); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_142coarsenHierarchy(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_nlevels); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_144getRefineLevel(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_146setRefineLevel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_148getCoarsenLevel(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_150adaptLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_label); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_152adaptMetric(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_154getLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_156setSection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_158getSection(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_160setLocalSection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_162getLocalSection(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_164setGlobalSection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_166getGlobalSection(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_168createSectionSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_localsec, struct PyPetscSectionObject *__pyx_v_globalsec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_170getSectionSF(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_172setSectionSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_174getPointSF(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_176setPointSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_178getNumLabels(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_180getLabelName(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_182hasLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_184createLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_186removeLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_188getLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_190setLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_192clearLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_194getLabelSize(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_196getLabelIdIS(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_198getStratumSize(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_200getStratumIS(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_202clearLabelStratum(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_204setLabelOutput(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_output); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_206getLabelOutput(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_208setKSPComputeOperators(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_operators, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_210createFieldDecomposition(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_212setSNESFunction(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_214setSNESJacobian(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_jacobian, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_216addCoarsenHook(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_coarsenhook, PyObject *__pyx_v_restricthook, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_6appctx___get__(struct PyPetscDMObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2DM_6appctx_2__set__(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_2ds___get__(struct PyPetscDMObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2DM_2ds_2__set__(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_2DS___cinit__(struct PyPetscDSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_2view(struct PyPetscDSObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_4destroy(struct PyPetscDSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_6create(struct PyPetscDSObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_8setType(struct PyPetscDSObject *__pyx_v_self, PyObject *__pyx_v_ds_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_10getType(struct PyPetscDSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_12setFromOptions(struct PyPetscDSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_14setUp(struct PyPetscDSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_16getSpatialDimension(struct PyPetscDSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_18getCoordinateDimension(struct PyPetscDSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_20getNumFields(struct PyPetscDSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_22getFieldIndex(struct PyPetscDSObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_disc); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_24getTotalDimensions(struct PyPetscDSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_26getTotalComponents(struct PyPetscDSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_28getDimensions(struct PyPetscDSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_30getComponents(struct PyPetscDSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_32setDiscretisation(struct PyPetscDSObject *__pyx_v_self, PyObject *__pyx_v_f, PyObject *__pyx_v_disc); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_create(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_dof, PyObject *__pyx_v_sizes, PyObject *__pyx_v_proc_sizes, PyObject *__pyx_v_boundary_type, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width, int __pyx_v_setup, PyObject *__pyx_v_ownership_ranges, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_2duplicate(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dof, PyObject *__pyx_v_boundary_type, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_4setDim(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_6getDim(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_8setDof(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dof); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_10getDof(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_12setSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_sizes); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_14getSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_16setProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_proc_sizes); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_18getProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_20setBoundaryType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_boundary_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_22getBoundaryType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_24setStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_stencil_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_26getStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_28setStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_stencil_width); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_30getStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_32setStencil(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_34getStencil(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_36getRanges(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_38getGhostRanges(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_40getOwnershipRanges(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_42getCorners(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_44getGhostCorners(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_46setFieldName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_48getFieldName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_50getVecArray(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_52setUniformCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_54setCoordinateName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_56getCoordinateName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_58createNaturalVec(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_60globalToNatural(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg, struct PyPetscVecObject *__pyx_v_vn, PyObject *__pyx_v_addv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_62naturalToGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vn, struct PyPetscVecObject *__pyx_v_vg, PyObject *__pyx_v_addv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_64getAO(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_66getScatter(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_68setRefinementFactor(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_refine_x, PyObject *__pyx_v_refine_y, PyObject *__pyx_v_refine_z); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_70getRefinementFactor(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_72setInterpolationType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_interp_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_74getInterpolationType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_76setElementType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_elem_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_78getElementType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_80getElements(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_elem_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_3dim___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_3dof___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_5sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_10proc_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_13boundary_type___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_7stencil___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_12stencil_type___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_13stencil_width___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_6ranges___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_12ghost_ranges___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_7corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_13ghost_corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_create(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_2createFromCellList(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_cells, PyObject *__pyx_v_coords, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_4createBoxMesh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_faces, PyObject *__pyx_v_lower, PyObject *__pyx_v_upper, PyObject *__pyx_v_simplex, PyObject *__pyx_v_periodic, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_6createBoxSurfaceMesh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_faces, PyObject *__pyx_v_lower, PyObject *__pyx_v_upper, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_8createFromFile(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_plexname, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_10createCGNS(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_cgid, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_12createCGNSFromFile(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_14createExodusFromFile(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_16createExodus(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_exoid, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_18createGmsh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_20createCohesiveSubmesh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_hasLagrange, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_22getChart(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_24setChart(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_pStart, PyObject *__pyx_v_pEnd); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_26getConeSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_28setConeSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_30getCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_32setCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_cone, PyObject *__pyx_v_orientation); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_34insertCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_conePos, PyObject *__pyx_v_conePoint); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_36insertConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_conePos, PyObject *__pyx_v_coneOrientation); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_38getConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_40setConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_orientation); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_42setCellType(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_ctype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_44getCellType(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_46getCellTypeLabel(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_48getSupportSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_50setSupportSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_52getSupport(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_54setSupport(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_supp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_56getMaxSizes(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_58symmetrize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_60stratify(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_62orient(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_64getCellNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_66getVertexNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_68createPointNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_70getDepth(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_72getDepthStratum(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_svalue); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_74getHeightStratum(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_svalue); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_76getPointDepth(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_78getPointHeight(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_80getMeet(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_82getJoin(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_84getFullJoin(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_86getTransitiveClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_useCone); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_88vecGetClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_90getVecClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_92setVecClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_point, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_94setMatClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscSectionObject *__pyx_v_gsec, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_point, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_96generate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_boundary, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_98setTriangleOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_opts); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_100setTetGenOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_opts); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_102markBoundaryFaces(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_label, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_104labelComplete(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscDMLabelObject *__pyx_v_label); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_106labelCohesiveComplete(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscDMLabelObject *__pyx_v_label, struct PyPetscDMLabelObject *__pyx_v_bdlabel, PyObject *__pyx_v_bdvalue, PyObject *__pyx_v_flip, struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_subdm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_108setAdjacencyUseAnchors(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_useAnchors); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_110getAdjacencyUseAnchors(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_112getAdjacency(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_114setPartitioner(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscPartitionerObject *__pyx_v_part); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_116getPartitioner(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_118rebalanceSharedPoints(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_entityDepth, PyObject *__pyx_v_useInitialGuess, PyObject *__pyx_v_parallel); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_120distribute(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_122distributeOverlap(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_124isDistributed(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_126isSimplex(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_128distributeGetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_130distributeSetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_132distributionSetName(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_134distributionGetName(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_136isSimplex(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_138interpolate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_140uninterpolate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_142distributeField(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_144getMinRadius(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_146createCoarsePointIS(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_148createSection(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_150getPointLocal(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_152getPointLocalField(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_154getPointGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_156getPointGlobalField(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_158createClosureIndex(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_160setRefinementUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_refinementUniform); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_162getRefinementUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_164setRefinementLimit(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_refinementLimit); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_166getRefinementLimit(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_168getOrdering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_otype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_170permute(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscISObject *__pyx_v_perm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_172reorderGetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_174reorderSetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_176computeCellGeometryFVM(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_cell); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_178constructGhostCells(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_labelName); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_180metricSetFromOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_182metricSetUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscBool __pyx_v_uniform); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_184metricIsUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_186metricSetIsotropic(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscBool __pyx_v_isotropic); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_188metricIsIsotropic(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_190metricSetRestrictAnisotropyFirst(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscBool __pyx_v_restrictAnisotropyFirst); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_192metricRestrictAnisotropyFirst(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_194metricSetNoInsertion(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscBool __pyx_v_noInsert); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_196metricNoInsertion(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_198metricSetNoSwapping(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscBool __pyx_v_noSwap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_200metricNoSwapping(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_202metricSetNoMovement(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscBool __pyx_v_noMove); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_204metricNoMovement(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_206metricSetNoSurf(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscBool __pyx_v_noSurf); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_208metricNoSurf(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_210metricSetVerbosity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscInt __pyx_v_verbosity); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_212metricGetVerbosity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_214metricSetNumIterations(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscInt __pyx_v_numIter); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_216metricGetNumIterations(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_218metricSetMinimumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscReal __pyx_v_h_min); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_220metricGetMinimumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_222metricSetMaximumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscReal __pyx_v_h_max); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_224metricGetMaximumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_226metricSetMaximumAnisotropy(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscReal __pyx_v_a_max); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_228metricGetMaximumAnisotropy(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_230metricSetTargetComplexity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscReal __pyx_v_targetComplexity); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_232metricGetTargetComplexity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_234metricSetNormalizationOrder(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscReal __pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_236metricGetNormalizationOrder(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_238metricSetGradationFactor(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscReal __pyx_v_beta); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_240metricGetGradationFactor(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_242metricSetHausdorffNumber(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscReal __pyx_v_hausd); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_244metricGetHausdorffNumber(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_246metricCreate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_248metricCreateUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PetscReal __pyx_v_alpha, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_250metricCreateIsotropic(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_252metricDeterminantCreate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_254metricEnforceSPD(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_256metricNormalize(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_258metricAverage2(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_260metricAverage3(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_262metricIntersection2(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_264metricIntersection3(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_266computeGradientClementInterpolant(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_268topologyView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_270coordinatesView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_272labelsView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_274sectionView(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_276globalVectorView(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_278localVectorView(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_280topologyLoad(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_282coordinatesLoad(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_284labelsLoad(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_286sectionLoad(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_288globalVectorLoad(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_290localVectorLoad(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, struct PyPetscDMObject *__pyx_v_sectiondm, struct PyPetscSFObject *__pyx_v_sf, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_15DMPlexTransform___cinit__(struct PyPetscDMPlexTransformObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_2apply(struct PyPetscDMPlexTransformObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_4create(struct PyPetscDMPlexTransformObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_6destroy(struct PyPetscDMPlexTransformObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_8getType(struct PyPetscDMPlexTransformObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_10setUp(struct PyPetscDMPlexTransformObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_12setType(struct PyPetscDMPlexTransformObject *__pyx_v_self, PyObject *__pyx_v_tr_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_14setDM(struct PyPetscDMPlexTransformObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_16setFromOptions(struct PyPetscDMPlexTransformObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMPlexTransform_18view(struct PyPetscDMPlexTransformObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_create(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_dofs, PyObject *__pyx_v_sizes, PyObject *__pyx_v_boundary_types, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width, PyObject *__pyx_v_proc_sizes, PyObject *__pyx_v_ownership_ranges, PyObject *__pyx_v_comm, PyObject *__pyx_v_setUp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_2setStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_swidth); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_4setStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_stenciltype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_6setBoundaryTypes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_boundary_types); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_8setDof(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dofs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_10setGlobalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_sizes); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_12setProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_sizes); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_14setOwnershipRanges(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_ranges); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_16getDim(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_18getEntriesPerElement(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_20getStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_22getDof(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_24getCorners(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_26getGhostCorners(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_28getLocalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_30getGlobalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_32getProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_34getStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_36getOwnershipRanges(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_38getBoundaryTypes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_40getIsFirstRank(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_42getIsLastRank(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_44setUniformCoordinatesExplicit(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_46setUniformCoordinatesProduct(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_48setUniformCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_50setCoordinateDMType(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dmtype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_52getLocationSlot(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_54getProductCoordinateLocationSlot(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_56getLocationDof(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_58migrateVec(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, struct PyPetscDMObject *__pyx_v_dmTo, struct PyPetscVecObject *__pyx_v_vecTo); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_60createCompatibleDMStag(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dofs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_62VecSplitToDMDA(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_loc, PyObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_64getVecArray(CYTHON_UNUSED struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_66get1dCoordinatecArrays(CYTHON_UNUSED struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_3dim___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_4dofs___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_19entries_per_element___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_12global_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_11local_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_10proc_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_14boundary_types___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_12stencil_type___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_13stencil_width___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_7corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_13ghost_corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_create(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_2addDM(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_4getNumber(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_6getEntries(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_8scatter(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_lvecs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_10gather(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_imode, PyObject *__pyx_v_lvecs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_12getGlobalISs(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_14getLocalISs(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_16getLGMaps(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_18getAccess(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_locs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_create(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_2setMatrix(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_4setGlobalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_6setLocalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscVecObject *__pyx_v_lv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_8setCreateGlobalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_gvec, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_10setCreateLocalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_lvec, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_12setGlobalToLocal(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_begin, PyObject *__pyx_v_end, PyObject *__pyx_v_begin_args, PyObject *__pyx_v_begin_kargs, PyObject *__pyx_v_end_args, PyObject *__pyx_v_end_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_14setGlobalToLocalVecScatter(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_gtol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_16setLocalToGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_begin, PyObject *__pyx_v_end, PyObject *__pyx_v_begin_args, PyObject *__pyx_v_begin_kargs, PyObject *__pyx_v_end_args, PyObject *__pyx_v_end_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_18setLocalToGlobalVecScatter(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_ltog); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_20setLocalToLocal(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_begin, PyObject *__pyx_v_end, PyObject *__pyx_v_begin_args, PyObject *__pyx_v_begin_kargs, PyObject *__pyx_v_end_args, PyObject *__pyx_v_end_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_22setLocalToLocalVecScatter(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_ltol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_24setCreateMatrix(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_matrix, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_26setCoarsen(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_coarsen, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_28setRefine(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_refine, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_30setCreateInterpolation(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_interpolation, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_32setCreateInjection(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_injection, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_34setCreateRestriction(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_restriction, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_36setCreateFieldDecomposition(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_decomp, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_38setCreateDomainDecomposition(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_decomp, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_40setCreateDomainDecompositionScatters(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_scatter, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_42setCreateSubDM(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_subdm, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_7DMLabel___cinit__(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_2destroy(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_4view(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_6create(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_8duplicate(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_10reset(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_12insertIS(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_14setValue(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_16getValue(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_18getDefaultValue(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_20setDefaultValue(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_22clearValue(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_24addStratum(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_26addStrata(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_strata); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_28addStrataIS(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_30getNumValues(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_32getValueIS(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_34stratumHasPoint(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_36hasStratum(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_38getStratumSize(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_stratum); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_40getStratumIS(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_stratum); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_42setStratumIS(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_stratum, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_44clearStratum(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_stratum); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_46computeIndex(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_48createIndex(struct PyPetscDMLabelObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_pStart, CYTHON_UNUSED 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, CYTHON_UNUSED PyObject *__pyx_v_start, CYTHON_UNUSED PyObject *__pyx_v_end); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_60permute(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_permutation); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_62distribute(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_64gather(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_66convertToSection(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_68getNonEmptyStratumValuesIS(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_create(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_2createGlobalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_4destroyGlobalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_6createLocalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_8destroyLocalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_10initializeFieldRegister(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_12finalizeFieldRegister(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_14setLocalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_nlocal, PyObject *__pyx_v_buffer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_16registerField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname, PyObject *__pyx_v_blocksize, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_18getField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_20restoreField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_22vectorDefineField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_24addPoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_26addNPoints(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_npoints); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_28removePoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_30removePointAtIndex(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_32copyPoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_pi, PyObject *__pyx_v_pj); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_34getLocalSize(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_36getSize(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_38migrate(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_remove_sent_points); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_40collectViewCreate(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_42collectViewDestroy(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_44setCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_46getCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_48setType(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_dmswarm_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_50setPointsUniformCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_min, PyObject *__pyx_v_max, PyObject *__pyx_v_npoints, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_52setPointCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_coordinates, PyObject *__pyx_v_redundant, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_54insertPointUsingCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_layoutType, PyObject *__pyx_v_fill_param); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_56setPointCoordinatesCellwise(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_coordinates); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_58viewFieldsXDMF(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_fieldnames); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_60viewXDMF(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_62sortGetAccess(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_64sortRestoreAccess(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_66sortGetPointsPerCell(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_e); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_68sortGetNumberOfPointsPerCell(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_e); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_70sortGetIsValid(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_72sortGetSizes(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_74projectFields(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldnames, PyObject *__pyx_v_reuse); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_11Partitioner___cinit__(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_2view(struct PyPetscPartitionerObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_4destroy(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_6create(struct PyPetscPartitionerObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_8setType(struct PyPetscPartitionerObject *__pyx_v_self, PyObject *__pyx_v_part_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_10getType(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_12setFromOptions(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_14setUp(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_16reset(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_18setShellPartition(struct PyPetscPartitionerObject *__pyx_v_self, PyObject *__pyx_v_numProcs, PyObject *__pyx_v_sizes, PyObject *__pyx_v_points); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_5Space___cinit__(struct PyPetscSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_2setUp(struct PyPetscSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_4create(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_6destroy(struct PyPetscSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_8view(struct PyPetscSpaceObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_10setFromOptions(struct PyPetscSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_12getDimension(struct PyPetscSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_14getDegree(struct PyPetscSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_16setDegree(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_maxDegree); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_18getNumVariables(struct PyPetscSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_20setNumVariables(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_22getNumComponents(struct PyPetscSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_24setNumComponents(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_nc); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_26getType(struct PyPetscSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_28setType(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_space_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_30getSumConcatenate(struct PyPetscSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_32setSumConcatenate(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_concatenate); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_34getSumNumSubspaces(struct PyPetscSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_36getSumSubspace(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_38setSumSubspace(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_s, struct PyPetscSpaceObject *__pyx_v_subsp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_40setSumNumSubspaces(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_numSumSpaces); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_42getTensorNumSubspaces(struct PyPetscSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_44setTensorSubspace(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_s, struct PyPetscSpaceObject *__pyx_v_subsp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_46getTensorSubspace(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_s); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_48setTensorNumSubspaces(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_numTensSpaces); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_50getPolynomialTensor(struct PyPetscSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_52setPolynomialTensor(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_tensor); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_54setPointPoints(struct PyPetscSpaceObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_56getPointPoints(struct PyPetscSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_58setPTrimmedFormDegree(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_formDegree); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_60getPTrimmedFormDegree(struct PyPetscSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Space_62viewFromOptions(struct PyPetscSpaceObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_9DualSpace___cinit__(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_2setUp(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_4create(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_6view(struct PyPetscDualSpaceObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_8destroy(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_10duplicate(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_12getDM(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_14setDM(struct PyPetscDualSpaceObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_16getDimension(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_18getNumComponents(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_20setNumComponents(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_nc); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_22getType(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_24setType(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_dualspace_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_26getOrder(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_28setOrder(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_order); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_30getNumDof(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_32getFunctional(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_34getInteriorDimension(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_intdim); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_36getLagrangeContinuity(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_38setLagrangeContinuity(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_continuous); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_40getLagrangeTensor(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_42setLagrangeTensor(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_tensor); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_44getLagrangeTrimmed(struct PyPetscDualSpaceObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_46setLagrangeTrimmed(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_trimmed); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_48viewFromOptions(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_50setSimpleDimension(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_52setSimpleFunctional(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_func, struct PyPetscQuadObject *__pyx_v_functional); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_15DMInterpolation___cinit__(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self); /* proto */
static void __pyx_pf_8petsc4py_5PETSc_15DMInterpolation_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_4create(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_6destroy(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_8evaluate(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_10getCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_12getDim(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_14getDof(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_16setDim(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_18setDof(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, PyObject *__pyx_v_dof); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_20setUp(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, PyObject *__pyx_v_redundantPoints, PyObject *__pyx_v_ignoreOutsideDomain); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_22getVector(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_15DMInterpolation_24restoreVector(struct __pyx_obj_8petsc4py_5PETSc_DMInterpolation *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6_PyObj___getattr__(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4_initialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6_pre_finalize(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_8_finalize(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_10_push_python_vfprintf(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_12_pop_python_vfprintf(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_14_stdout_is_stderr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static 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_15View_dot_MemoryView_16_memoryviewslice_4base___get__(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 PyObject *__pyx_tp_new_8petsc4py_5PETSc_Comm(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Object(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Viewer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Random(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Device(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DeviceContext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_IS(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LGMap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_SF(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Vec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Space(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DualSpace(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_FE(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Quad(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Scatter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Section(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Mat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_MatPartitioning(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_NullSpace(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_PC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_KSP(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_SNES(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_TS(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_TAO(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_AO(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DM(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMPlexTransform(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DS(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Partitioner(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMLabel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc__IS_buffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc__Vec_buffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc__Vec_LocalForm(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc__Mat_Stencil(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_DMDA(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMPlex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMStag(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMComposite(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMShell(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMSwarm(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMInterpolation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyObj(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyMat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyPC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyKSP(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PySNES(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyTS(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyTao(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct_1_decorator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get_2, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys = {0, &__pyx_n_s_keys, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0};
static PyObject *__pyx_float_0_;
static PyObject *__pyx_float_0_0;
static PyObject *__pyx_float_1_0;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_6;
static PyObject *__pyx_int_7;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_9;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_13;
static PyObject *__pyx_int_17;
static PyObject *__pyx_int_18;
static PyObject *__pyx_int_19;
static PyObject *__pyx_int_23;
static PyObject *__pyx_int_32;
static PyObject *__pyx_int_34;
static PyObject *__pyx_int_43;
static PyObject *__pyx_int_45;
static PyObject *__pyx_int_46;
static PyObject *__pyx_int_47;
static PyObject *__pyx_int_48;
static PyObject *__pyx_int_59;
static PyObject *__pyx_int_88;
static PyObject *__pyx_int_102;
static PyObject *__pyx_int_105;
static PyObject *__pyx_int_106;
static PyObject *__pyx_int_113;
static PyObject *__pyx_int_119;
static PyObject *__pyx_int_121;
static PyObject *__pyx_int_122;
static PyObject *__pyx_int_112105877;
static PyObject *__pyx_int_136983863;
static PyObject *__pyx_int_184977713;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_k__30;
static PyObject *__pyx_k__55;
static PyObject *__pyx_slice__6;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_slice__40;
static PyObject *__pyx_slice__50;
static PyObject *__pyx_slice__51;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__131;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__133;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__136;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__138;
static PyObject *__pyx_tuple__139;
static PyObject *__pyx_tuple__140;
static PyObject *__pyx_tuple__141;
static PyObject *__pyx_tuple__142;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__144;
static PyObject *__pyx_tuple__145;
static PyObject *__pyx_tuple__146;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__148;
static PyObject *__pyx_tuple__149;
static PyObject *__pyx_tuple__150;
static PyObject *__pyx_tuple__151;
static PyObject *__pyx_tuple__152;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__154;
static PyObject *__pyx_tuple__155;
static PyObject *__pyx_tuple__156;
static PyObject *__pyx_tuple__157;
static PyObject *__pyx_tuple__158;
static PyObject *__pyx_tuple__159;
static PyObject *__pyx_tuple__160;
static PyObject *__pyx_tuple__161;
static PyObject *__pyx_tuple__162;
static PyObject *__pyx_tuple__163;
static PyObject *__pyx_tuple__164;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__166;
static PyObject *__pyx_tuple__167;
static PyObject *__pyx_tuple__168;
static PyObject *__pyx_tuple__169;
static PyObject *__pyx_tuple__170;
static PyObject *__pyx_tuple__171;
static PyObject *__pyx_tuple__172;
static PyObject *__pyx_tuple__173;
static PyObject *__pyx_tuple__174;
static PyObject *__pyx_tuple__175;
static PyObject *__pyx_tuple__182;
static PyObject *__pyx_tuple__183;
static PyObject *__pyx_tuple__184;
static PyObject *__pyx_tuple__185;
static PyObject *__pyx_tuple__186;
static PyObject *__pyx_tuple__187;
static PyObject *__pyx_codeobj__23;
static PyObject *__pyx_codeobj__25;
static PyObject *__pyx_codeobj__85;
static PyObject *__pyx_codeobj__87;
static PyObject *__pyx_codeobj__89;
static PyObject *__pyx_codeobj__91;
static PyObject *__pyx_codeobj__93;
static PyObject *__pyx_codeobj__95;
static PyObject *__pyx_codeobj__103;
static PyObject *__pyx_codeobj__105;
static PyObject *__pyx_codeobj__107;
static PyObject *__pyx_codeobj__109;
static PyObject *__pyx_codeobj__176;
static PyObject *__pyx_codeobj__177;
static PyObject *__pyx_codeobj__178;
static PyObject *__pyx_codeobj__179;
static PyObject *__pyx_codeobj__180;
static PyObject *__pyx_codeobj__181;
static PyObject *__pyx_codeobj__188;
/* Late includes */
/* "petsc4py/PETSc/Device.pyx":25
* ("HIP" , PETSC_DEVICE_HIP),
* ("SYCL" , PETSC_DEVICE_SYCL),
* ("DEFAULT" , staticproperty(lambda *_,**__: PETSC_DEVICE_DEFAULT())) # <<<<<<<<<<<<<<
* )
* )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_16lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_16lambda = {"lambda", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_16lambda, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8petsc4py_5PETSc_16lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED PyObject *__pyx_v__ = 0;
CYTHON_UNUSED PyObject *__pyx_v___ = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("lambda (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "lambda", 1))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v__ = __pyx_args;
__pyx_r = __pyx_lambda_funcdef_8petsc4py_5PETSc_lambda(__pyx_self, __pyx_v__, __pyx_v___);
/* function exit code */
__Pyx_XDECREF(__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_PyInt_From_PetscDeviceType(PETSC_DEVICE_DEFAULT()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 25, __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;
}
/* "petsc4py/PETSc/PETSc.pyx":17
* # --------------------------------------------------------------------
*
* 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_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("bytes2str", 0);
/* "petsc4py/PETSc/PETSc.pyx":18
*
* cdef inline object bytes2str(const char p[]):
* if p == NULL: # <<<<<<<<<<<<<<
* return None
* cdef bytes s = <char*>p
*/
__pyx_t_1 = ((__pyx_v_p == NULL) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/PETSc.pyx":19
* 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":18
*
* cdef inline object bytes2str(const char p[]):
* if p == NULL: # <<<<<<<<<<<<<<
* return None
* cdef bytes s = <char*>p
*/
}
/* "petsc4py/PETSc/PETSc.pyx":20
* 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(12, 20, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_s = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/PETSc.pyx":21
* return None
* cdef bytes s = <char*>p
* if isinstance(s, str): # <<<<<<<<<<<<<<
* return s
* else:
*/
__pyx_t_1 = PyString_Check(__pyx_v_s);
__pyx_t_3 = (__pyx_t_1 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/PETSc.pyx":22
* 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":21
* return None
* cdef bytes s = <char*>p
* if isinstance(s, str): # <<<<<<<<<<<<<<
* return s
* else:
*/
}
/* "petsc4py/PETSc/PETSc.pyx":24
* return s
* else:
* return s.decode() # <<<<<<<<<<<<<<
*
* cdef inline object str2bytes(object s, const char *p[]):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_decode_bytes(__pyx_v_s, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/PETSc.pyx":17
* # --------------------------------------------------------------------
*
* 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":26
* return s.decode()
*
* cdef inline object str2bytes(object s, const char *p[]): # <<<<<<<<<<<<<<
* if s is None:
* p[0] = NULL
*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_str2bytes(PyObject *__pyx_v_s, char const **__pyx_v_p) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
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":27
*
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/PETSc.pyx":28
* 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":29
* 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":27
*
* cdef inline object str2bytes(object s, const char *p[]):
* if s is None: # <<<<<<<<<<<<<<
* p[0] = NULL
* return None
*/
}
/* "petsc4py/PETSc/PETSc.pyx":30
* p[0] = NULL
* return None
* if not isinstance(s, bytes): # <<<<<<<<<<<<<<
* s = s.encode()
* p[0] = <const char*>(<char*>s)
*/
__pyx_t_2 = PyBytes_Check(__pyx_v_s);
__pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/PETSc.pyx":31
* return None
* if not isinstance(s, bytes):
* s = s.encode() # <<<<<<<<<<<<<<
* p[0] = <const char*>(<char*>s)
* return s
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 31, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 31, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_s, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/PETSc.pyx":30
* p[0] = NULL
* return None
* if not isinstance(s, bytes): # <<<<<<<<<<<<<<
* s = s.encode()
* p[0] = <const char*>(<char*>s)
*/
}
/* "petsc4py/PETSc/PETSc.pyx":32
* 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(12, 32, __pyx_L1_error)
(__pyx_v_p[0]) = ((char const *)((char *)__pyx_t_6));
/* "petsc4py/PETSc/PETSc.pyx":33
* 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":26
* return s.decode()
*
* cdef inline object str2bytes(object s, const char *p[]): # <<<<<<<<<<<<<<
* if s is None:
* p[0] = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.str2bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_s);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PETSc.pyx":35
* 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;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("S_", 0);
/* "petsc4py/PETSc/PETSc.pyx":36
*
* 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) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/PETSc.pyx":37
* 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(12, 37, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_s = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/PETSc.pyx":38
* 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 = PyString_Check(__pyx_v_s);
if ((__pyx_t_1 != 0)) {
__Pyx_INCREF(__pyx_v_s);
__pyx_t_2 = __pyx_v_s;
} else {
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 38, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 38, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_2 = __pyx_t_3;
__pyx_t_3 = 0;
}
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PETSc.pyx":35
* 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_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.S_", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_s);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PETSc.pyx":54
* cdef object PetscError = <object>PyExc_RuntimeError
*
* cdef PetscErrorCode SETERR(PetscErrorCode ierr) with gil: # <<<<<<<<<<<<<<
* if (<void*>PetscError) != NULL:
* PyErr_SetObject(PetscError, <long>ierr)
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SETERR(PetscErrorCode __pyx_v_ierr) {
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("SETERR", 0);
/* "petsc4py/PETSc/PETSc.pyx":55
*
* cdef PetscErrorCode SETERR(PetscErrorCode ierr) with gil:
* if (<void*>PetscError) != NULL: # <<<<<<<<<<<<<<
* PyErr_SetObject(PetscError, <long>ierr)
* else:
*/
__pyx_t_1 = ((((void *)__pyx_v_8petsc4py_5PETSc_PetscError) != NULL) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/PETSc.pyx":56
* cdef PetscErrorCode SETERR(PetscErrorCode ierr) with gil:
* 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_PyInt_From_long(((long)__pyx_v_ierr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 56, __pyx_L1_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":55
*
* cdef PetscErrorCode SETERR(PetscErrorCode ierr) with gil:
* if (<void*>PetscError) != NULL: # <<<<<<<<<<<<<<
* PyErr_SetObject(PetscError, <long>ierr)
* else:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/PETSc.pyx":58
* PyErr_SetObject(PetscError, <long>ierr)
* else:
* PyErr_SetObject(<object>PyExc_RuntimeError, <long>ierr) # <<<<<<<<<<<<<<
* return ierr
*
*/
/*else*/ {
__pyx_t_3 = ((PyObject *)PyExc_RuntimeError);
__Pyx_INCREF(__pyx_t_3);
__pyx_t_2 = __Pyx_PyInt_From_long(((long)__pyx_v_ierr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 58, __pyx_L1_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_L3:;
/* "petsc4py/PETSc/PETSc.pyx":59
* else:
* PyErr_SetObject(<object>PyExc_RuntimeError, <long>ierr)
* return ierr # <<<<<<<<<<<<<<
*
* cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) nogil except PETSC_ERR_PYTHON:
*/
__pyx_r = __pyx_v_ierr;
goto __pyx_L0;
/* "petsc4py/PETSc/PETSc.pyx":54
* cdef object PetscError = <object>PyExc_RuntimeError
*
* cdef PetscErrorCode SETERR(PetscErrorCode ierr) with gil: # <<<<<<<<<<<<<<
* if (<void*>PetscError) != NULL:
* PyErr_SetObject(PetscError, <long>ierr)
*/
/* function exit code */
__pyx_L1_error:;
__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 = (PetscErrorCode) 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/PETSc.pyx":61
* return ierr
*
* cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) nogil except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<<
* if ierr == PETSC_SUCCESS:
* return ierr # no error
*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_CHKERR(PetscErrorCode __pyx_v_ierr) {
PetscErrorCode __pyx_r;
int __pyx_t_1;
/* "petsc4py/PETSc/PETSc.pyx":62
*
* cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) nogil except PETSC_ERR_PYTHON:
* if ierr == PETSC_SUCCESS: # <<<<<<<<<<<<<<
* return ierr # no error
* if ierr == PETSC_ERR_PYTHON:
*/
__pyx_t_1 = ((__pyx_v_ierr == PETSC_SUCCESS) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/PETSc.pyx":63
* cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) nogil except PETSC_ERR_PYTHON:
* if ierr == PETSC_SUCCESS:
* return ierr # no error # <<<<<<<<<<<<<<
* if ierr == PETSC_ERR_PYTHON:
* return ierr # error in python code
*/
__pyx_r = __pyx_v_ierr;
goto __pyx_L0;
/* "petsc4py/PETSc/PETSc.pyx":62
*
* cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) nogil except PETSC_ERR_PYTHON:
* if ierr == PETSC_SUCCESS: # <<<<<<<<<<<<<<
* return ierr # no error
* if ierr == PETSC_ERR_PYTHON:
*/
}
/* "petsc4py/PETSc/PETSc.pyx":64
* if ierr == PETSC_SUCCESS:
* return ierr # no error
* if ierr == PETSC_ERR_PYTHON: # <<<<<<<<<<<<<<
* return ierr # error in python code
* <void>SETERR(ierr)
*/
__pyx_t_1 = ((__pyx_v_ierr == PETSC_ERR_PYTHON) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/PETSc.pyx":65
* return ierr # no error
* if ierr == PETSC_ERR_PYTHON:
* return ierr # error in python code # <<<<<<<<<<<<<<
* <void>SETERR(ierr)
* return PETSC_ERR_PYTHON
*/
__pyx_r = __pyx_v_ierr;
goto __pyx_L0;
/* "petsc4py/PETSc/PETSc.pyx":64
* if ierr == PETSC_SUCCESS:
* return ierr # no error
* if ierr == PETSC_ERR_PYTHON: # <<<<<<<<<<<<<<
* return ierr # error in python code
* <void>SETERR(ierr)
*/
}
/* "petsc4py/PETSc/PETSc.pyx":66
* if ierr == PETSC_ERR_PYTHON:
* return ierr # error in python code
* <void>SETERR(ierr) # <<<<<<<<<<<<<<
* return PETSC_ERR_PYTHON
*
*/
((void)__pyx_f_8petsc4py_5PETSc_SETERR(__pyx_v_ierr));
/* "petsc4py/PETSc/PETSc.pyx":67
* return ierr # error in python code
* <void>SETERR(ierr)
* return PETSC_ERR_PYTHON # <<<<<<<<<<<<<<
*
* # SETERRMPI Support
*/
__pyx_r = PETSC_ERR_PYTHON;
goto __pyx_L0;
/* "petsc4py/PETSc/PETSc.pyx":61
* return ierr
*
* cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) nogil except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<<
* if ierr == PETSC_SUCCESS:
* return ierr # no error
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "petsc4py/PETSc/PETSc.pyx":79
* PetscErrorCode PetscERROR(MPI_Comm, char[], PetscErrorCode, int, char[], char[])
*
* cdef inline int SETERRMPI(int ierr) with gil: # <<<<<<<<<<<<<<
* cdef char[MPI_MAX_ERROR_STRING] mpi_err_str
* 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;
PyObject *__pyx_v_error_str = 0;
char const *__pyx_v_c_error_str;
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("SETERRMPI", 0);
/* "petsc4py/PETSc/PETSc.pyx":81
* cdef inline int SETERRMPI(int ierr) with gil:
* cdef char[MPI_MAX_ERROR_STRING] mpi_err_str
* cdef int result_len = <int>sizeof(mpi_err_str) # <<<<<<<<<<<<<<
*
* <void>memset(mpi_err_str, 0, result_len)
*/
__pyx_v_result_len = ((int)(sizeof(__pyx_v_mpi_err_str)));
/* "petsc4py/PETSc/PETSc.pyx":83
* cdef int result_len = <int>sizeof(mpi_err_str)
*
* <void>memset(mpi_err_str, 0, result_len) # <<<<<<<<<<<<<<
* <void>MPI_Error_string(ierr, mpi_err_str, &result_len);
* <void>result_len
*/
((void)memset(__pyx_v_mpi_err_str, 0, __pyx_v_result_len));
/* "petsc4py/PETSc/PETSc.pyx":84
*
* <void>memset(mpi_err_str, 0, result_len)
* <void>MPI_Error_string(ierr, mpi_err_str, &result_len); # <<<<<<<<<<<<<<
* <void>result_len
*
*/
((void)MPI_Error_string(__pyx_v_ierr, __pyx_v_mpi_err_str, (&__pyx_v_result_len)));
/* "petsc4py/PETSc/PETSc.pyx":85
* <void>memset(mpi_err_str, 0, result_len)
* <void>MPI_Error_string(ierr, mpi_err_str, &result_len);
* <void>result_len # <<<<<<<<<<<<<<
*
* cdef str error_str = "MPI Error " + bytes2str(mpi_err_str) + " " + str(ierr)
*/
((void)__pyx_v_result_len);
/* "petsc4py/PETSc/PETSc.pyx":87
* <void>result_len
*
* cdef str error_str = "MPI Error " + bytes2str(mpi_err_str) + " " + str(ierr) # <<<<<<<<<<<<<<
* cdef const char *c_error_str = NULL
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_mpi_err_str); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 87, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyNumber_Add(__pyx_kp_s_MPI_Error, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 87, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 87, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ierr); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 87, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 87, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 87, __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(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(12, 87, __pyx_L1_error)
__pyx_v_error_str = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/PETSc.pyx":88
*
* cdef str error_str = "MPI Error " + bytes2str(mpi_err_str) + " " + str(ierr)
* cdef const char *c_error_str = NULL # <<<<<<<<<<<<<<
*
* str2bytes(error_str, &c_error_str)
*/
__pyx_v_c_error_str = NULL;
/* "petsc4py/PETSc/PETSc.pyx":90
* cdef const char *c_error_str = NULL
*
* str2bytes(error_str, &c_error_str) # <<<<<<<<<<<<<<
* <void>PetscERROR(PETSC_COMM_SELF, "Unknown Python Function", PETSC_ERR_MPI, PETSC_ERROR_INITIAL, "%s", c_error_str)
* <void>SETERR(PETSC_ERR_MPI)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_error_str, (&__pyx_v_c_error_str)); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/PETSc.pyx":91
*
* str2bytes(error_str, &c_error_str)
* <void>PetscERROR(PETSC_COMM_SELF, "Unknown Python Function", PETSC_ERR_MPI, PETSC_ERROR_INITIAL, "%s", c_error_str) # <<<<<<<<<<<<<<
* <void>SETERR(PETSC_ERR_MPI)
* return ierr
*/
((void)PetscERROR(PETSC_COMM_SELF, ((char *)"Unknown Python Function"), PETSC_ERR_MPI, PETSC_ERROR_INITIAL, ((char *)"%s"), __pyx_v_c_error_str));
/* "petsc4py/PETSc/PETSc.pyx":92
* str2bytes(error_str, &c_error_str)
* <void>PetscERROR(PETSC_COMM_SELF, "Unknown Python Function", PETSC_ERR_MPI, PETSC_ERROR_INITIAL, "%s", c_error_str)
* <void>SETERR(PETSC_ERR_MPI) # <<<<<<<<<<<<<<
* return ierr
*
*/
((void)__pyx_f_8petsc4py_5PETSc_SETERR(PETSC_ERR_MPI));
/* "petsc4py/PETSc/PETSc.pyx":93
* <void>PetscERROR(PETSC_COMM_SELF, "Unknown Python Function", PETSC_ERR_MPI, PETSC_ERROR_INITIAL, "%s", c_error_str)
* <void>SETERR(PETSC_ERR_MPI)
* return ierr # <<<<<<<<<<<<<<
*
* cdef inline PetscErrorCode CHKERRMPI(int ierr) nogil except PETSC_ERR_PYTHON:
*/
__pyx_r = __pyx_v_ierr;
goto __pyx_L0;
/* "petsc4py/PETSc/PETSc.pyx":79
* PetscErrorCode PetscERROR(MPI_Comm, char[], PetscErrorCode, int, char[], char[])
*
* cdef inline int SETERRMPI(int ierr) with gil: # <<<<<<<<<<<<<<
* cdef char[MPI_MAX_ERROR_STRING] mpi_err_str
* cdef int result_len = <int>sizeof(mpi_err_str)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_WriteUnraisable("petsc4py.PETSc.SETERRMPI", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_error_str);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/PETSc.pyx":95
* return ierr
*
* cdef inline PetscErrorCode CHKERRMPI(int ierr) nogil except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<<
* 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":96
*
* cdef inline PetscErrorCode CHKERRMPI(int ierr) nogil except PETSC_ERR_PYTHON:
* if ierr == MPI_SUCCESS: # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
* <void>SETERRMPI(ierr)
*/
__pyx_t_1 = ((__pyx_v_ierr == MPI_SUCCESS) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/PETSc.pyx":97
* cdef inline PetscErrorCode CHKERRMPI(int ierr) nogil except PETSC_ERR_PYTHON:
* 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":96
*
* cdef inline PetscErrorCode CHKERRMPI(int ierr) nogil except PETSC_ERR_PYTHON:
* if ierr == MPI_SUCCESS: # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
* <void>SETERRMPI(ierr)
*/
}
/* "petsc4py/PETSc/PETSc.pyx":98
* 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":99
* return PETSC_SUCCESS
* <void>SETERRMPI(ierr)
* return PETSC_ERR_PYTHON # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__pyx_r = PETSC_ERR_PYTHON;
goto __pyx_L0;
/* "petsc4py/PETSc/PETSc.pyx":95
* return ierr
*
* cdef inline PetscErrorCode CHKERRMPI(int ierr) nogil except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<<
* if ierr == MPI_SUCCESS:
* return PETSC_SUCCESS
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "petsc4py/PETSc/PETSc.pyx":119
* void PyPetscBuffer_Release(Py_buffer*)
*
* cdef inline object toBool(PetscBool value): # <<<<<<<<<<<<<<
* return True if value 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;
__Pyx_RefNannySetupContext("toBool", 0);
/* "petsc4py/PETSc/PETSc.pyx":120
*
* cdef inline object toBool(PetscBool value):
* return True if value else False # <<<<<<<<<<<<<<
* cdef inline PetscBool asBool(object value) except? <PetscBool>0:
* return PETSC_TRUE if value else PETSC_FALSE
*/
__Pyx_XDECREF(__pyx_r);
if (__pyx_v_value) {
__Pyx_INCREF(Py_True);
__pyx_t_1 = Py_True;
} else {
__Pyx_INCREF(Py_False);
__pyx_t_1 = Py_False;
}
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PETSc.pyx":119
* void PyPetscBuffer_Release(Py_buffer*)
*
* cdef inline object toBool(PetscBool value): # <<<<<<<<<<<<<<
* return True if value 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":121
* cdef inline object toBool(PetscBool value):
* return True if value 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;
__Pyx_RefNannyDeclarations
PetscBool __pyx_t_1;
int __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("asBool", 0);
/* "petsc4py/PETSc/PETSc.pyx":122
* return True if value 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(12, 122, __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":121
* cdef inline object toBool(PetscBool value):
* return True if value 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PETSc.pyx":124
* 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":125
*
* cdef inline object toInt(PetscInt value):
* return value # <<<<<<<<<<<<<<
* cdef inline PetscInt asInt(object value) except? -1:
* return value
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_PetscInt(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 125, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PETSc.pyx":124
* 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":126
* 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;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("asInt", 0);
/* "petsc4py/PETSc/PETSc.pyx":127
* return value
* cdef inline PetscInt asInt(object value) except? -1:
* return value # <<<<<<<<<<<<<<
*
* cdef inline object toReal(PetscReal value):
*/
__pyx_t_1 = __Pyx_PyInt_As_PetscInt(__pyx_v_value); if (unlikely((__pyx_t_1 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(12, 127, __pyx_L1_error)
__pyx_r = __pyx_t_1;
goto __pyx_L0;
/* "petsc4py/PETSc/PETSc.pyx":126
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PETSc.pyx":129
* 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":130
*
* cdef inline object toReal(PetscReal value):
* return value # <<<<<<<<<<<<<<
* cdef inline PetscReal asReal(object value) except? -1:
* return value
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PETSc.pyx":129
* 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":131
* 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;
__Pyx_RefNannyDeclarations
PetscReal __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("asReal", 0);
/* "petsc4py/PETSc/PETSc.pyx":132
* return value
* cdef inline PetscReal asReal(object value) except? -1:
* return value # <<<<<<<<<<<<<<
*
* cdef inline object toScalar(PetscScalar value):
*/
__pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(12, 132, __pyx_L1_error)
__pyx_r = __pyx_t_1;
goto __pyx_L0;
/* "petsc4py/PETSc/PETSc.pyx":131
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PETSc.pyx":134
* 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":135
*
* 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(12, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PETSc.pyx":134
* 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":136
* 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;
__Pyx_RefNannyDeclarations
PetscScalar __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("asScalar", 0);
/* "petsc4py/PETSc/PETSc.pyx":137
* 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_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(12, 137, __pyx_L1_error)
__pyx_r = __pyx_t_1;
goto __pyx_L0;
/* "petsc4py/PETSc/PETSc.pyx":136
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/arraynpy.pxi":68
* # --------------------------------------------------------------------
*
* 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":69
*
* 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(13, 69, __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":68
* # --------------------------------------------------------------------
*
* 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":71
* 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":72
*
* 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(13, 72, __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":73
* 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(13, 73, __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":71
* 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":77
* # --------------------------------------------------------------------
*
* 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":78
*
* 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":79
* 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(13, 79, __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":77
* # --------------------------------------------------------------------
*
* 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":81
* 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":82
*
* 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":83
* 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(13, 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
* 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":85
* 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":86
*
* 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":87
* 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(13, 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_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":89
* 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":90
*
* 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":91
* 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(13, 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_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":93
* 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":94
*
* 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":95
* 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(13, 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_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":99
* # --------------------------------------------------------------------
*
* 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":100
*
* 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":101
* 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(13, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":102
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/arraynpy.pxi":103
* 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":102
* 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":104
* 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":99
* # --------------------------------------------------------------------
*
* 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":106
* 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":107
*
* 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":108
* 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(13, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":109
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/arraynpy.pxi":110
* 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":109
* 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":111
* 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":106
* 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":113
* 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":114
*
* 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":115
* 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(13, 115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":116
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/arraynpy.pxi":117
* 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":116
* 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":118
* 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":113
* 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":120
* 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":121
*
* 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":122
* 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(13, 122, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":123
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/arraynpy.pxi":124
* 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":123
* 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":125
* 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":120
* 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":129
* # --------------------------------------------------------------------
*
* 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":130
*
* 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(13, 130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":132
* 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) != 0);
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":133
* 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) != 0);
if (__pyx_t_2) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_v_ary));
__pyx_r = __pyx_v_ary;
goto __pyx_L0;
}
/* "petsc4py/PETSc/arraynpy.pxi":134
* 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(13, 134, __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":129
* # --------------------------------------------------------------------
*
* 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":136
* 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":137
*
* 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(13, 137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":138
* cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data):
* cdef ndarray ary = iarray(ob, NPY_PETSC_INT)
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary) # <<<<<<<<<<<<<<
* if data != NULL: data[0] = <PetscInt*> PyArray_DATA(ary)
* return ary
*/
__pyx_t_2 = ((__pyx_v_size != NULL) != 0);
if (__pyx_t_2) {
(__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":139
* 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) != 0);
if (__pyx_t_2) {
(__pyx_v_data[0]) = ((PetscInt *)PyArray_DATA(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":140
* 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":136
* 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":142
* 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":143
*
* 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(13, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":144
* cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data):
* cdef ndarray ary = iarray(ob, NPY_PETSC_REAL)
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary) # <<<<<<<<<<<<<<
* if data != NULL: data[0] = <PetscReal*> PyArray_DATA(ary)
* return ary
*/
__pyx_t_2 = ((__pyx_v_size != NULL) != 0);
if (__pyx_t_2) {
(__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":145
* 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) != 0);
if (__pyx_t_2) {
(__pyx_v_data[0]) = ((PetscReal *)PyArray_DATA(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":146
* 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":142
* 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":148
* 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":149
*
* 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(13, 149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":150
* cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data):
* cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL)
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary) # <<<<<<<<<<<<<<
* if data != NULL: data[0] = <PetscBool*> PyArray_DATA(ary)
* return ary
*/
__pyx_t_2 = ((__pyx_v_size != NULL) != 0);
if (__pyx_t_2) {
(__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":151
* 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) != 0);
if (__pyx_t_2) {
(__pyx_v_data[0]) = ((PetscBool *)PyArray_DATA(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":152
* 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":148
* 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":154
* 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":155
*
* 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(13, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":156
* cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data):
* cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR)
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary) # <<<<<<<<<<<<<<
* if data != NULL: data[0] = <PetscScalar*> PyArray_DATA(ary)
* return ary
*/
__pyx_t_2 = ((__pyx_v_size != NULL) != 0);
if (__pyx_t_2) {
(__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":157
* 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) != 0);
if (__pyx_t_2) {
(__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":158
* 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":154
* 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":162
* # --------------------------------------------------------------------
*
* 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":163
*
* cdef inline ndarray oarray(object ob, int typenum):
* cdef ndarray ary = PyArray_FROM_OTF( # <<<<<<<<<<<<<<
* ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED)
* 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(13, 163, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":165
* 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) != 0);
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":166
* 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) != 0);
if (__pyx_t_2) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_v_ary));
__pyx_r = __pyx_v_ary;
goto __pyx_L0;
}
/* "petsc4py/PETSc/arraynpy.pxi":167
* if PyArray_ISCONTIGUOUS(ary): return ary
* if PyArray_ISFORTRAN(ary): return ary
* return PyArray_Copy(ary) # <<<<<<<<<<<<<<
*
* cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_1 = ((PyObject *)PyArray_Copy(__pyx_v_ary)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 167, __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":162
* # --------------------------------------------------------------------
*
* 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":169
* return PyArray_Copy(ary)
*
* cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): # <<<<<<<<<<<<<<
* cdef ndarray ary = oarray(ob, NPY_PETSC_INT)
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_i(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscInt **__pyx_v_data) {
PyArrayObject *__pyx_v_ary = 0;
PyArrayObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("oarray_i", 0);
/* "petsc4py/PETSc/arraynpy.pxi":170
*
* cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data):
* cdef ndarray ary = oarray(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_oarray(__pyx_v_ob, NPY_PETSC_INT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":171
* cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data):
* cdef ndarray ary = oarray(ob, NPY_PETSC_INT)
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary) # <<<<<<<<<<<<<<
* if data != NULL: data[0] = <PetscInt*> PyArray_DATA(ary)
* return ary
*/
__pyx_t_2 = ((__pyx_v_size != NULL) != 0);
if (__pyx_t_2) {
(__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":172
* cdef ndarray ary = oarray(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) != 0);
if (__pyx_t_2) {
(__pyx_v_data[0]) = ((PetscInt *)PyArray_DATA(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":173
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
* if data != NULL: data[0] = <PetscInt*> PyArray_DATA(ary)
* return ary # <<<<<<<<<<<<<<
*
* cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_v_ary));
__pyx_r = __pyx_v_ary;
goto __pyx_L0;
/* "petsc4py/PETSc/arraynpy.pxi":169
* return PyArray_Copy(ary)
*
* cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): # <<<<<<<<<<<<<<
* cdef ndarray ary = oarray(ob, NPY_PETSC_INT)
* if size != NULL: size[0] = <PetscInt> 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":175
* return ary
*
* cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): # <<<<<<<<<<<<<<
* cdef ndarray ary = oarray(ob, NPY_PETSC_REAL)
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_r(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscReal **__pyx_v_data) {
PyArrayObject *__pyx_v_ary = 0;
PyArrayObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("oarray_r", 0);
/* "petsc4py/PETSc/arraynpy.pxi":176
*
* cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data):
* cdef ndarray ary = oarray(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_oarray(__pyx_v_ob, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":177
* cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data):
* cdef ndarray ary = oarray(ob, NPY_PETSC_REAL)
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary) # <<<<<<<<<<<<<<
* if data != NULL: data[0] = <PetscReal*> PyArray_DATA(ary)
* return ary
*/
__pyx_t_2 = ((__pyx_v_size != NULL) != 0);
if (__pyx_t_2) {
(__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":178
* cdef ndarray ary = oarray(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) != 0);
if (__pyx_t_2) {
(__pyx_v_data[0]) = ((PetscReal *)PyArray_DATA(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":179
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
* if data != NULL: data[0] = <PetscReal*> PyArray_DATA(ary)
* return ary # <<<<<<<<<<<<<<
*
* cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_v_ary));
__pyx_r = __pyx_v_ary;
goto __pyx_L0;
/* "petsc4py/PETSc/arraynpy.pxi":175
* return ary
*
* cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): # <<<<<<<<<<<<<<
* cdef ndarray ary = oarray(ob, NPY_PETSC_REAL)
* if size != NULL: size[0] = <PetscInt> 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":181
* return ary
*
* cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<<
* cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR)
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_s(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscScalar **__pyx_v_data) {
PyArrayObject *__pyx_v_ary = 0;
PyArrayObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("oarray_s", 0);
/* "petsc4py/PETSc/arraynpy.pxi":182
*
* cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data):
* cdef ndarray ary = oarray(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_oarray(__pyx_v_ob, NPY_PETSC_SCALAR)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 182, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":183
* cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data):
* cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR)
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary) # <<<<<<<<<<<<<<
* if data != NULL: data[0] = <PetscScalar*> PyArray_DATA(ary)
* return ary
*/
__pyx_t_2 = ((__pyx_v_size != NULL) != 0);
if (__pyx_t_2) {
(__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":184
* cdef ndarray ary = oarray(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) != 0);
if (__pyx_t_2) {
(__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":185
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
* if data != NULL: data[0] = <PetscScalar*> PyArray_DATA(ary)
* return ary # <<<<<<<<<<<<<<
*
* cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_v_ary));
__pyx_r = __pyx_v_ary;
goto __pyx_L0;
/* "petsc4py/PETSc/arraynpy.pxi":181
* return ary
*
* cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<<
* cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR)
* if size != NULL: size[0] = <PetscInt> 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":187
* return ary
*
* cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): # <<<<<<<<<<<<<<
* cdef ndarray ary = oarray(ob, NPY_INTP)
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_p(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, void **__pyx_v_data) {
PyArrayObject *__pyx_v_ary = 0;
PyArrayObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("oarray_p", 0);
/* "petsc4py/PETSc/arraynpy.pxi":188
*
* cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data):
* cdef ndarray ary = oarray(ob, NPY_INTP) # <<<<<<<<<<<<<<
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
* if data != NULL: data[0] = <void*> PyArray_DATA(ary)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray(__pyx_v_ob, NPY_INTP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":189
* cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data):
* cdef ndarray ary = oarray(ob, NPY_INTP)
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary) # <<<<<<<<<<<<<<
* if data != NULL: data[0] = <void*> PyArray_DATA(ary)
* return ary
*/
__pyx_t_2 = ((__pyx_v_size != NULL) != 0);
if (__pyx_t_2) {
(__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":190
* cdef ndarray ary = oarray(ob, NPY_INTP)
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
* if data != NULL: data[0] = <void*> PyArray_DATA(ary) # <<<<<<<<<<<<<<
* return ary
*
*/
__pyx_t_2 = ((__pyx_v_data != NULL) != 0);
if (__pyx_t_2) {
(__pyx_v_data[0]) = ((void *)PyArray_DATA(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":191
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
* if data != NULL: data[0] = <void*> 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":187
* return ary
*
* cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): # <<<<<<<<<<<<<<
* cdef ndarray ary = oarray(ob, NPY_INTP)
* if size != NULL: size[0] = <PetscInt> 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":195
* # --------------------------------------------------------------------
*
* cdef inline ndarray ocarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<<
* cdef ndarray ary = PyArray_FROM_OTF(
* ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED)
*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_ocarray_s(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscScalar **__pyx_v_data) {
PyArrayObject *__pyx_v_ary = 0;
PyArrayObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ocarray_s", 0);
/* "petsc4py/PETSc/arraynpy.pxi":196
*
* cdef inline ndarray ocarray_s(object ob, PetscInt* size, PetscScalar** data):
* cdef ndarray ary = PyArray_FROM_OTF( # <<<<<<<<<<<<<<
* ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED)
* if size != NULL: size[0] = <PetscInt> 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(13, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":198
* cdef ndarray ary = PyArray_FROM_OTF(
* ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED)
* 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) != 0);
if (__pyx_t_2) {
(__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":199
* ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED)
* 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) != 0);
if (__pyx_t_2) {
(__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":200
* if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
* 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":195
* # --------------------------------------------------------------------
*
* 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":202
* return ary
*
* cdef inline ndarray ofarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<<
* cdef ndarray ary = PyArray_FROM_OTF(
* ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED)
*/
static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_ofarray_s(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscScalar **__pyx_v_data) {
PyArrayObject *__pyx_v_ary = 0;
PyArrayObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ofarray_s", 0);
/* "petsc4py/PETSc/arraynpy.pxi":203
*
* cdef inline ndarray ofarray_s(object ob, PetscInt* size, PetscScalar** data):
* cdef ndarray ary = PyArray_FROM_OTF( # <<<<<<<<<<<<<<
* ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED)
* if size != NULL: size[0] = <PetscInt> 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(13, 203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/arraynpy.pxi":205
* cdef ndarray ary = PyArray_FROM_OTF(
* ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED)
* 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) != 0);
if (__pyx_t_2) {
(__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":206
* ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED)
* 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) != 0);
if (__pyx_t_2) {
(__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary));
}
/* "petsc4py/PETSc/arraynpy.pxi":207
* 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":202
* 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): # <<<<<<<<<<<<<<
* cdef DLManagedTensor* dlm_tensor = NULL
* try:
*/
static void __pyx_f_8petsc4py_5PETSc_pycapsule_deleter(PyObject *__pyx_v_dltensor) {
struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *__pyx_v_dlm_tensor;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
void *__pyx_t_4;
int __pyx_t_5;
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("pycapsule_deleter", 0);
/* "petsc4py/PETSc/dlpack.pxi":65
*
* cdef void pycapsule_deleter(object dltensor):
* cdef DLManagedTensor* dlm_tensor = NULL # <<<<<<<<<<<<<<
* try:
* dlm_tensor = <DLManagedTensor *>PyCapsule_GetPointer(dltensor, 'used_dltensor')
*/
__pyx_v_dlm_tensor = NULL;
/* "petsc4py/PETSc/dlpack.pxi":66
* cdef void pycapsule_deleter(object dltensor):
* cdef DLManagedTensor* dlm_tensor = NULL
* try: # <<<<<<<<<<<<<<
* dlm_tensor = <DLManagedTensor *>PyCapsule_GetPointer(dltensor, 'used_dltensor')
* return # we do not call a used capsule's deleter
*/
{
__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/dlpack.pxi":67
* cdef DLManagedTensor* dlm_tensor = NULL
* try:
* dlm_tensor = <DLManagedTensor *>PyCapsule_GetPointer(dltensor, 'used_dltensor') # <<<<<<<<<<<<<<
* return # we do not call a used capsule's deleter
* except Exception:
*/
__pyx_t_4 = PyCapsule_GetPointer(__pyx_v_dltensor, ((char const *)"used_dltensor")); if (unlikely(__pyx_t_4 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(14, 67, __pyx_L3_error)
__pyx_v_dlm_tensor = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_4);
/* "petsc4py/PETSc/dlpack.pxi":68
* try:
* dlm_tensor = <DLManagedTensor *>PyCapsule_GetPointer(dltensor, 'used_dltensor')
* return # we do not call a used capsule's deleter # <<<<<<<<<<<<<<
* except Exception:
* dlm_tensor = <DLManagedTensor *>PyCapsule_GetPointer(dltensor, 'dltensor')
*/
goto __pyx_L7_try_return;
/* "petsc4py/PETSc/dlpack.pxi":66
* cdef void pycapsule_deleter(object dltensor):
* cdef DLManagedTensor* dlm_tensor = NULL
* try: # <<<<<<<<<<<<<<
* dlm_tensor = <DLManagedTensor *>PyCapsule_GetPointer(dltensor, 'used_dltensor')
* return # we do not call a used capsule's deleter
*/
}
__pyx_L3_error:;
/* "petsc4py/PETSc/dlpack.pxi":69
* dlm_tensor = <DLManagedTensor *>PyCapsule_GetPointer(dltensor, 'used_dltensor')
* return # we do not call a used capsule's deleter
* except Exception: # <<<<<<<<<<<<<<
* dlm_tensor = <DLManagedTensor *>PyCapsule_GetPointer(dltensor, 'dltensor')
* manager_deleter(dlm_tensor)
*/
__pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
if (__pyx_t_5) {
__Pyx_AddTraceback("petsc4py.PETSc.pycapsule_deleter", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(14, 69, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
/* "petsc4py/PETSc/dlpack.pxi":70
* return # we do not call a used capsule's deleter
* except Exception:
* dlm_tensor = <DLManagedTensor *>PyCapsule_GetPointer(dltensor, 'dltensor') # <<<<<<<<<<<<<<
* manager_deleter(dlm_tensor)
*
*/
__pyx_t_4 = PyCapsule_GetPointer(__pyx_v_dltensor, ((char const *)"dltensor")); if (unlikely(__pyx_t_4 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(14, 70, __pyx_L5_except_error)
__pyx_v_dlm_tensor = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_4);
__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_L4_exception_handled;
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
/* "petsc4py/PETSc/dlpack.pxi":66
* cdef void pycapsule_deleter(object dltensor):
* cdef DLManagedTensor* dlm_tensor = NULL
* try: # <<<<<<<<<<<<<<
* dlm_tensor = <DLManagedTensor *>PyCapsule_GetPointer(dltensor, 'used_dltensor')
* return # we do not call a used capsule's deleter
*/
__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;
__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);
}
/* "petsc4py/PETSc/dlpack.pxi":71
* except Exception:
* dlm_tensor = <DLManagedTensor *>PyCapsule_GetPointer(dltensor, 'dltensor')
* manager_deleter(dlm_tensor) # <<<<<<<<<<<<<<
*
* cdef void manager_deleter(DLManagedTensor* tensor) nogil:
*/
__pyx_f_8petsc4py_5PETSc_manager_deleter(__pyx_v_dlm_tensor);
/* "petsc4py/PETSc/dlpack.pxi":64
* dlpack_manager_del_obj del_obj
*
* cdef void pycapsule_deleter(object dltensor): # <<<<<<<<<<<<<<
* cdef DLManagedTensor* dlm_tensor = NULL
* try:
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_WriteUnraisable("petsc4py.PETSc.pycapsule_deleter", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "petsc4py/PETSc/dlpack.pxi":73
* manager_deleter(dlm_tensor)
*
* cdef void manager_deleter(DLManagedTensor* tensor) 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":74
*
* cdef void manager_deleter(DLManagedTensor* tensor) nogil:
* if tensor.manager_ctx is NULL: # <<<<<<<<<<<<<<
* return
* free(tensor.dl_tensor.shape)
*/
__pyx_t_1 = ((__pyx_v_tensor->manager_ctx == NULL) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/dlpack.pxi":75
* cdef void manager_deleter(DLManagedTensor* tensor) 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":74
*
* cdef void manager_deleter(DLManagedTensor* tensor) nogil:
* if tensor.manager_ctx is NULL: # <<<<<<<<<<<<<<
* return
* free(tensor.dl_tensor.shape)
*/
}
/* "petsc4py/PETSc/dlpack.pxi":76
* 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":77
* 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) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/dlpack.pxi":78
* 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":77
* 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":79
* if tensor.del_obj is not NULL:
* tensor.del_obj(&tensor.manager_ctx)
* free(tensor) # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
free(__pyx_v_tensor);
/* "petsc4py/PETSc/dlpack.pxi":73
* manager_deleter(dlm_tensor)
*
* cdef void manager_deleter(DLManagedTensor* tensor) nogil: # <<<<<<<<<<<<<<
* if tensor.manager_ctx is NULL:
* return
*/
/* function exit code */
__pyx_L0:;
}
/* "petsc4py/PETSc/petscdef.pxi":43
* PETSC_USE_POINTER
*
* cdef inline PetscInsertMode insertmode(object mode) \ # <<<<<<<<<<<<<<
* except <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;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
InsertMode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("insertmode", 0);
/* "petsc4py/PETSc/petscdef.pxi":45
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_r = INSERT_VALUES;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdef.pxi":46
* 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_2 = (__pyx_v_mode == Py_True);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_r = ADD_VALUES;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdef.pxi":47
* if mode is None: return PETSC_INSERT_VALUES
* elif mode is True: return PETSC_ADD_VALUES
* elif mode is False: return PETSC_INSERT_VALUES # <<<<<<<<<<<<<<
* else: return mode
*
*/
__pyx_t_1 = (__pyx_v_mode == Py_False);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_r = INSERT_VALUES;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdef.pxi":48
* elif mode is True: return PETSC_ADD_VALUES
* elif mode is False: return PETSC_INSERT_VALUES
* else: return mode # <<<<<<<<<<<<<<
*
* cdef inline PetscScatterMode scattermode(object mode) \
*/
/*else*/ {
__pyx_t_3 = ((InsertMode)__Pyx_PyInt_As_InsertMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 48, __pyx_L1_error)
__pyx_r = __pyx_t_3;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdef.pxi":43
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdef.pxi":50
* 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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
ScatterMode __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("scattermode", 0);
/* "petsc4py/PETSc/petscdef.pxi":52
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_r = SCATTER_FORWARD;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdef.pxi":53
* 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_2 = (__pyx_v_mode == Py_False);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_r = SCATTER_FORWARD;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdef.pxi":54
* if mode is None: return PETSC_SCATTER_FORWARD
* if mode is False: return PETSC_SCATTER_FORWARD
* if mode is True: return PETSC_SCATTER_REVERSE # <<<<<<<<<<<<<<
* if isinstance(mode, str):
* if mode == 'forward': return PETSC_SCATTER_FORWARD
*/
__pyx_t_1 = (__pyx_v_mode == Py_True);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_r = SCATTER_REVERSE;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdef.pxi":55
* if mode is False: return PETSC_SCATTER_FORWARD
* if mode is True: return PETSC_SCATTER_REVERSE
* if isinstance(mode, str): # <<<<<<<<<<<<<<
* if mode == 'forward': return PETSC_SCATTER_FORWARD
* if mode == 'reverse': return PETSC_SCATTER_REVERSE
*/
__pyx_t_2 = PyString_Check(__pyx_v_mode);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscdef.pxi":56
* if mode is True: return PETSC_SCATTER_REVERSE
* if isinstance(mode, str):
* if mode == 'forward': return PETSC_SCATTER_FORWARD # <<<<<<<<<<<<<<
* if mode == 'reverse': return PETSC_SCATTER_REVERSE
* else: raise ValueError("unknown scatter mode: %s" % mode)
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_forward, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 56, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_r = SCATTER_FORWARD;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdef.pxi":57
* if isinstance(mode, str):
* if mode == 'forward': return PETSC_SCATTER_FORWARD
* if mode == 'reverse': return PETSC_SCATTER_REVERSE # <<<<<<<<<<<<<<
* else: raise ValueError("unknown scatter mode: %s" % mode)
* return mode
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_reverse, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 57, __pyx_L1_error)
if (likely(__pyx_t_1)) {
__pyx_r = SCATTER_REVERSE;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdef.pxi":58
* if mode == 'forward': return PETSC_SCATTER_FORWARD
* if mode == 'reverse': return PETSC_SCATTER_REVERSE
* else: raise ValueError("unknown scatter mode: %s" % mode) # <<<<<<<<<<<<<<
* return mode
*
*/
/*else*/ {
__pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_scatter_mode_s, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(3, 58, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscdef.pxi":55
* if mode is False: return PETSC_SCATTER_FORWARD
* if mode is True: return PETSC_SCATTER_REVERSE
* if isinstance(mode, str): # <<<<<<<<<<<<<<
* if mode == 'forward': return PETSC_SCATTER_FORWARD
* if mode == 'reverse': return PETSC_SCATTER_REVERSE
*/
}
/* "petsc4py/PETSc/petscdef.pxi":59
* if mode == 'reverse': return PETSC_SCATTER_REVERSE
* else: raise ValueError("unknown scatter mode: %s" % mode)
* return mode # <<<<<<<<<<<<<<
*
*/
__pyx_t_5 = ((ScatterMode)__Pyx_PyInt_As_ScatterMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 59, __pyx_L1_error)
__pyx_r = __pyx_t_5;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdef.pxi":50
* 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_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":38
* #
*
* cdef getprefix(prefix, deft=None): # <<<<<<<<<<<<<<
* if prefix is None:
* prefix = deft
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getprefix(PyObject *__pyx_v_prefix, struct __pyx_opt_args_8petsc4py_5PETSc_getprefix *__pyx_optional_args) {
PyObject *__pyx_v_deft = ((PyObject *)Py_None);
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getprefix", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_deft = __pyx_optional_args->deft;
}
}
__Pyx_INCREF(__pyx_v_prefix);
/* "petsc4py/PETSc/petscopt.pxi":39
*
* cdef getprefix(prefix, deft=None):
* if prefix is None: # <<<<<<<<<<<<<<
* prefix = deft
* elif isinstance(prefix, Options):
*/
__pyx_t_1 = (__pyx_v_prefix == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscopt.pxi":40
* cdef getprefix(prefix, deft=None):
* if prefix is None:
* prefix = deft # <<<<<<<<<<<<<<
* elif isinstance(prefix, Options):
* prefix = prefix.prefix
*/
__Pyx_INCREF(__pyx_v_deft);
__Pyx_DECREF_SET(__pyx_v_prefix, __pyx_v_deft);
/* "petsc4py/PETSc/petscopt.pxi":39
*
* cdef getprefix(prefix, deft=None):
* if prefix is None: # <<<<<<<<<<<<<<
* prefix = deft
* elif isinstance(prefix, Options):
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscopt.pxi":41
* if prefix is None:
* prefix = deft
* elif isinstance(prefix, Options): # <<<<<<<<<<<<<<
* prefix = prefix.prefix
* elif isinstance(prefix, Object):
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_prefix, __pyx_ptype_8petsc4py_5PETSc_Options);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscopt.pxi":42
* prefix = deft
* elif isinstance(prefix, Options):
* prefix = prefix.prefix # <<<<<<<<<<<<<<
* elif isinstance(prefix, Object):
* prefix = prefix.getOptionsPrefix()
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix, __pyx_n_s_prefix); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 42, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscopt.pxi":41
* if prefix is None:
* prefix = deft
* elif isinstance(prefix, Options): # <<<<<<<<<<<<<<
* prefix = prefix.prefix
* elif isinstance(prefix, Object):
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscopt.pxi":43
* elif isinstance(prefix, Options):
* prefix = prefix.prefix
* elif isinstance(prefix, Object): # <<<<<<<<<<<<<<
* prefix = prefix.getOptionsPrefix()
* elif not isinstance(prefix, str):
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_prefix, __pyx_ptype_8petsc4py_5PETSc_Object);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscopt.pxi":44
* prefix = prefix.prefix
* elif isinstance(prefix, Object):
* prefix = prefix.getOptionsPrefix() # <<<<<<<<<<<<<<
* elif not isinstance(prefix, str):
* raise TypeError('option prefix must be string')
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix, __pyx_n_s_getOptionsPrefix); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 44, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 44, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscopt.pxi":43
* elif isinstance(prefix, Options):
* prefix = prefix.prefix
* elif isinstance(prefix, Object): # <<<<<<<<<<<<<<
* prefix = prefix.getOptionsPrefix()
* elif not isinstance(prefix, str):
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscopt.pxi":45
* elif isinstance(prefix, Object):
* prefix = prefix.getOptionsPrefix()
* elif not isinstance(prefix, str): # <<<<<<<<<<<<<<
* raise TypeError('option prefix must be string')
* if not prefix:
*/
__pyx_t_2 = PyString_Check(__pyx_v_prefix);
__pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/petscopt.pxi":46
* prefix = prefix.getOptionsPrefix()
* elif not isinstance(prefix, str):
* raise TypeError('option prefix must be string') # <<<<<<<<<<<<<<
* if not prefix:
* return None
*/
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 46, __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(4, 46, __pyx_L1_error)
/* "petsc4py/PETSc/petscopt.pxi":45
* elif isinstance(prefix, Object):
* prefix = prefix.getOptionsPrefix()
* elif not isinstance(prefix, str): # <<<<<<<<<<<<<<
* raise TypeError('option prefix must be string')
* if not prefix:
*/
}
__pyx_L3:;
/* "petsc4py/PETSc/petscopt.pxi":47
* elif not isinstance(prefix, str):
* raise TypeError('option prefix must be string')
* if not prefix: # <<<<<<<<<<<<<<
* return None
* if prefix.count(' '):
*/
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 47, __pyx_L1_error)
__pyx_t_2 = ((!__pyx_t_1) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscopt.pxi":48
* raise TypeError('option prefix must be string')
* if not prefix:
* return None # <<<<<<<<<<<<<<
* if prefix.count(' '):
* raise ValueError('option prefix should not have spaces')
*/
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
/* "petsc4py/PETSc/petscopt.pxi":47
* elif not isinstance(prefix, str):
* raise TypeError('option prefix must be string')
* if not prefix: # <<<<<<<<<<<<<<
* return None
* if prefix.count(' '):
*/
}
/* "petsc4py/PETSc/petscopt.pxi":49
* if not prefix:
* return None
* if prefix.count(' '): # <<<<<<<<<<<<<<
* raise ValueError('option prefix should not have spaces')
* if prefix.startswith('-'):
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix, __pyx_n_s_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 49, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s_) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 49, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 49, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/petscopt.pxi":50
* return None
* if prefix.count(' '):
* raise ValueError('option prefix should not have spaces') # <<<<<<<<<<<<<<
* if prefix.startswith('-'):
* raise ValueError('option prefix should not start with a hyphen')
*/
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 50, __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(4, 50, __pyx_L1_error)
/* "petsc4py/PETSc/petscopt.pxi":49
* if not prefix:
* return None
* if prefix.count(' '): # <<<<<<<<<<<<<<
* raise ValueError('option prefix should not have spaces')
* if prefix.startswith('-'):
*/
}
/* "petsc4py/PETSc/petscopt.pxi":51
* if prefix.count(' '):
* raise ValueError('option prefix should not have spaces')
* if prefix.startswith('-'): # <<<<<<<<<<<<<<
* raise ValueError('option prefix should not start with a hyphen')
* return prefix
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 51, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s__4) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s__4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 51, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 51, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/petscopt.pxi":52
* raise ValueError('option prefix should not have spaces')
* if prefix.startswith('-'):
* raise ValueError('option prefix should not start with a hyphen') # <<<<<<<<<<<<<<
* return prefix
*
*/
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 52, __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(4, 52, __pyx_L1_error)
/* "petsc4py/PETSc/petscopt.pxi":51
* if prefix.count(' '):
* raise ValueError('option prefix should not have spaces')
* if prefix.startswith('-'): # <<<<<<<<<<<<<<
* raise ValueError('option prefix should not start with a hyphen')
* return prefix
*/
}
/* "petsc4py/PETSc/petscopt.pxi":53
* if prefix.startswith('-'):
* raise ValueError('option prefix should not start with a hyphen')
* return prefix # <<<<<<<<<<<<<<
*
* #
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_prefix);
__pyx_r = __pyx_v_prefix;
goto __pyx_L0;
/* "petsc4py/PETSc/petscopt.pxi":38
* #
*
* cdef getprefix(prefix, deft=None): # <<<<<<<<<<<<<<
* if prefix is None:
* prefix = deft
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.getprefix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_prefix);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscopt.pxi":57
* #
*
* cdef opt2str(const char *pre, const char *name): # <<<<<<<<<<<<<<
* p = bytes2str(pre) if pre!=NULL else None
* n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1])
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_opt2str(char const *__pyx_v_pre, char const *__pyx_v_name) {
PyObject *__pyx_v_p = NULL;
PyObject *__pyx_v_n = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("opt2str", 0);
/* "petsc4py/PETSc/petscopt.pxi":58
*
* cdef opt2str(const char *pre, const char *name):
* p = bytes2str(pre) if pre!=NULL else None # <<<<<<<<<<<<<<
* n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1])
* return '(prefix:%s, name:%s)' % (p, n)
*/
if (((__pyx_v_pre != NULL) != 0)) {
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_pre); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = __pyx_t_2;
__pyx_t_2 = 0;
} else {
__Pyx_INCREF(Py_None);
__pyx_t_1 = Py_None;
}
__pyx_v_p = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscopt.pxi":59
* cdef opt2str(const char *pre, const char *name):
* p = bytes2str(pre) if pre!=NULL else None
* n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1]) # <<<<<<<<<<<<<<
* return '(prefix:%s, name:%s)' % (p, n)
*
*/
if ((((__pyx_v_name[0]) != '-') != 0)) {
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 59, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = __pyx_t_2;
__pyx_t_2 = 0;
} else {
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str((&(__pyx_v_name[1]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 59, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = __pyx_t_2;
__pyx_t_2 = 0;
}
__pyx_v_n = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscopt.pxi":60
* p = bytes2str(pre) if pre!=NULL else None
* n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1])
* return '(prefix:%s, name:%s)' % (p, n) # <<<<<<<<<<<<<<
*
* cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 60, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_p);
__Pyx_GIVEREF(__pyx_v_p);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_p);
__Pyx_INCREF(__pyx_v_n);
__Pyx_GIVEREF(__pyx_v_n);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_n);
__pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_prefix_s_name_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 60, __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/petscopt.pxi":57
* #
*
* cdef opt2str(const char *pre, const char *name): # <<<<<<<<<<<<<<
* p = bytes2str(pre) if pre!=NULL else None
* n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1])
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.opt2str", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_p);
__Pyx_XDECREF(__pyx_v_n);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscopt.pxi":62
* return '(prefix:%s, name:%s)' % (p, n)
*
* cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<<
* cdef PetscBool value = PETSC_FALSE
* cdef PetscBool flag = PETSC_FALSE
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Bool(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) {
PetscBool __pyx_v_value;
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getopt_Bool", 0);
/* "petsc4py/PETSc/petscopt.pxi":63
*
* cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft):
* cdef PetscBool value = PETSC_FALSE # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) )
*/
__pyx_v_value = PETSC_FALSE;
/* "petsc4py/PETSc/petscopt.pxi":64
* cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft):
* cdef PetscBool value = PETSC_FALSE
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) )
* if flag==PETSC_TRUE: return toBool(value)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/petscopt.pxi":65
* cdef PetscBool value = PETSC_FALSE
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) ) # <<<<<<<<<<<<<<
* if flag==PETSC_TRUE: return toBool(value)
* if deft is not None: return deft
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetBool(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 65, __pyx_L1_error)
/* "petsc4py/PETSc/petscopt.pxi":66
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) )
* if flag==PETSC_TRUE: return toBool(value) # <<<<<<<<<<<<<<
* if deft is not None: return deft
* raise KeyError(opt2str(pre, name))
*/
__pyx_t_2 = ((__pyx_v_flag == PETSC_TRUE) != 0);
if (__pyx_t_2) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 66, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":67
* CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) )
* if flag==PETSC_TRUE: return toBool(value)
* if deft is not None: return deft # <<<<<<<<<<<<<<
* raise KeyError(opt2str(pre, name))
*
*/
__pyx_t_2 = (__pyx_v_deft != Py_None);
__pyx_t_4 = (__pyx_t_2 != 0);
if (__pyx_t_4) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_deft);
__pyx_r = __pyx_v_deft;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":68
* if flag==PETSC_TRUE: return toBool(value)
* if deft is not None: return deft
* raise KeyError(opt2str(pre, name)) # <<<<<<<<<<<<<<
*
* cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft):
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 68, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 68, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(4, 68, __pyx_L1_error)
/* "petsc4py/PETSc/petscopt.pxi":62
* return '(prefix:%s, name:%s)' % (p, n)
*
* cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<<
* cdef PetscBool value = PETSC_FALSE
* cdef PetscBool flag = PETSC_FALSE
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.getopt_Bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscopt.pxi":70
* raise KeyError(opt2str(pre, name))
*
* cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<<
* cdef PetscInt value = 0
* cdef PetscBool flag = PETSC_FALSE
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Int(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) {
PetscInt __pyx_v_value;
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getopt_Int", 0);
/* "petsc4py/PETSc/petscopt.pxi":71
*
* cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft):
* cdef PetscInt value = 0 # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) )
*/
__pyx_v_value = 0;
/* "petsc4py/PETSc/petscopt.pxi":72
* cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft):
* cdef PetscInt value = 0
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) )
* if flag==PETSC_TRUE: return toInt(value)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/petscopt.pxi":73
* cdef PetscInt value = 0
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) ) # <<<<<<<<<<<<<<
* if flag==PETSC_TRUE: return toInt(value)
* if deft is not None: return deft
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetInt(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 73, __pyx_L1_error)
/* "petsc4py/PETSc/petscopt.pxi":74
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) )
* if flag==PETSC_TRUE: return toInt(value) # <<<<<<<<<<<<<<
* if deft is not None: return deft
* raise KeyError(opt2str(pre, name))
*/
__pyx_t_2 = ((__pyx_v_flag == PETSC_TRUE) != 0);
if (__pyx_t_2) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 74, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":75
* CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) )
* if flag==PETSC_TRUE: return toInt(value)
* if deft is not None: return deft # <<<<<<<<<<<<<<
* raise KeyError(opt2str(pre, name))
*
*/
__pyx_t_2 = (__pyx_v_deft != Py_None);
__pyx_t_4 = (__pyx_t_2 != 0);
if (__pyx_t_4) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_deft);
__pyx_r = __pyx_v_deft;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":76
* if flag==PETSC_TRUE: return toInt(value)
* if deft is not None: return deft
* raise KeyError(opt2str(pre, name)) # <<<<<<<<<<<<<<
*
* cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft):
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 76, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 76, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(4, 76, __pyx_L1_error)
/* "petsc4py/PETSc/petscopt.pxi":70
* raise KeyError(opt2str(pre, name))
*
* cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<<
* cdef PetscInt value = 0
* cdef PetscBool flag = PETSC_FALSE
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.getopt_Int", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscopt.pxi":78
* raise KeyError(opt2str(pre, name))
*
* cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<<
* cdef PetscReal value = 0
* cdef PetscBool flag = PETSC_FALSE
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Real(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) {
PetscReal __pyx_v_value;
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getopt_Real", 0);
/* "petsc4py/PETSc/petscopt.pxi":79
*
* cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft):
* cdef PetscReal value = 0 # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) )
*/
__pyx_v_value = 0.0;
/* "petsc4py/PETSc/petscopt.pxi":80
* cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft):
* cdef PetscReal value = 0
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) )
* if flag==PETSC_TRUE: return toReal(value)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/petscopt.pxi":81
* cdef PetscReal value = 0
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) ) # <<<<<<<<<<<<<<
* if flag==PETSC_TRUE: return toReal(value)
* if deft is not None: return deft
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetReal(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 81, __pyx_L1_error)
/* "petsc4py/PETSc/petscopt.pxi":82
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) )
* if flag==PETSC_TRUE: return toReal(value) # <<<<<<<<<<<<<<
* if deft is not None: return deft
* raise KeyError(opt2str(pre, name))
*/
__pyx_t_2 = ((__pyx_v_flag == PETSC_TRUE) != 0);
if (__pyx_t_2) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 82, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":83
* CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) )
* if flag==PETSC_TRUE: return toReal(value)
* if deft is not None: return deft # <<<<<<<<<<<<<<
* raise KeyError(opt2str(pre, name))
*
*/
__pyx_t_2 = (__pyx_v_deft != Py_None);
__pyx_t_4 = (__pyx_t_2 != 0);
if (__pyx_t_4) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_deft);
__pyx_r = __pyx_v_deft;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":84
* if flag==PETSC_TRUE: return toReal(value)
* if deft is not None: return deft
* raise KeyError(opt2str(pre, name)) # <<<<<<<<<<<<<<
*
* cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft):
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(4, 84, __pyx_L1_error)
/* "petsc4py/PETSc/petscopt.pxi":78
* raise KeyError(opt2str(pre, name))
*
* cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<<
* cdef PetscReal value = 0
* cdef PetscBool flag = PETSC_FALSE
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.getopt_Real", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscopt.pxi":86
* raise KeyError(opt2str(pre, name))
*
* cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<<
* cdef PetscScalar value = 0
* cdef PetscBool flag = PETSC_FALSE
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Scalar(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) {
PetscScalar __pyx_v_value;
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getopt_Scalar", 0);
/* "petsc4py/PETSc/petscopt.pxi":87
*
* cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft):
* cdef PetscScalar value = 0 # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) )
*/
__pyx_v_value = 0.0;
/* "petsc4py/PETSc/petscopt.pxi":88
* cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft):
* cdef PetscScalar value = 0
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) )
* if flag==PETSC_TRUE: return toScalar(value)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/petscopt.pxi":89
* cdef PetscScalar value = 0
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) ) # <<<<<<<<<<<<<<
* if flag==PETSC_TRUE: return toScalar(value)
* if deft is not None: return deft
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetScalar(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 89, __pyx_L1_error)
/* "petsc4py/PETSc/petscopt.pxi":90
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) )
* if flag==PETSC_TRUE: return toScalar(value) # <<<<<<<<<<<<<<
* if deft is not None: return deft
* raise KeyError(opt2str(pre, name))
*/
__pyx_t_2 = ((__pyx_v_flag == PETSC_TRUE) != 0);
if (__pyx_t_2) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":91
* CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) )
* if flag==PETSC_TRUE: return toScalar(value)
* if deft is not None: return deft # <<<<<<<<<<<<<<
* raise KeyError(opt2str(pre, name))
*
*/
__pyx_t_2 = (__pyx_v_deft != Py_None);
__pyx_t_4 = (__pyx_t_2 != 0);
if (__pyx_t_4) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_deft);
__pyx_r = __pyx_v_deft;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":92
* if flag==PETSC_TRUE: return toScalar(value)
* if deft is not None: return deft
* raise KeyError(opt2str(pre, name)) # <<<<<<<<<<<<<<
*
* cdef getopt_String(PetscOptions opt, const char *pre, const char *name, object deft):
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 92, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 92, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(4, 92, __pyx_L1_error)
/* "petsc4py/PETSc/petscopt.pxi":86
* raise KeyError(opt2str(pre, name))
*
* cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<<
* cdef PetscScalar value = 0
* cdef PetscBool flag = PETSC_FALSE
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.getopt_Scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscopt.pxi":94
* raise KeyError(opt2str(pre, name))
*
* cdef getopt_String(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<<
* cdef char value[1024+1]
* cdef PetscBool flag = PETSC_FALSE
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_String(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) {
char __pyx_v_value[(0x400 + 1)];
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getopt_String", 0);
/* "petsc4py/PETSc/petscopt.pxi":96
* cdef getopt_String(PetscOptions opt, const char *pre, const char *name, object deft):
* cdef char value[1024+1]
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsGetString(opt, pre, name, value, 1024, &flag) )
* if flag==PETSC_TRUE: return bytes2str(value)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/petscopt.pxi":97
* cdef char value[1024+1]
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsGetString(opt, pre, name, value, 1024, &flag) ) # <<<<<<<<<<<<<<
* if flag==PETSC_TRUE: return bytes2str(value)
* if deft is not None: return deft
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetString(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, __pyx_v_value, 0x400, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 97, __pyx_L1_error)
/* "petsc4py/PETSc/petscopt.pxi":98
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsGetString(opt, pre, name, value, 1024, &flag) )
* if flag==PETSC_TRUE: return bytes2str(value) # <<<<<<<<<<<<<<
* if deft is not None: return deft
* raise KeyError(opt2str(pre, name))
*/
__pyx_t_2 = ((__pyx_v_flag == PETSC_TRUE) != 0);
if (__pyx_t_2) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 98, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":99
* CHKERR( PetscOptionsGetString(opt, pre, name, value, 1024, &flag) )
* if flag==PETSC_TRUE: return bytes2str(value)
* if deft is not None: return deft # <<<<<<<<<<<<<<
* raise KeyError(opt2str(pre, name))
*
*/
__pyx_t_2 = (__pyx_v_deft != Py_None);
__pyx_t_4 = (__pyx_t_2 != 0);
if (__pyx_t_4) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_deft);
__pyx_r = __pyx_v_deft;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":100
* if flag==PETSC_TRUE: return bytes2str(value)
* if deft is not None: return deft
* raise KeyError(opt2str(pre, name)) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(4, 100, __pyx_L1_error)
/* "petsc4py/PETSc/petscopt.pxi":94
* raise KeyError(opt2str(pre, name))
*
* cdef getopt_String(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<<
* cdef char value[1024+1]
* cdef PetscBool flag = PETSC_FALSE
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_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":110
* OPT_STRING
*
* cdef getpair(prefix, name, const char **pr, const char **nm): # <<<<<<<<<<<<<<
* # --
* cdef const char *p = NULL
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getpair(PyObject *__pyx_v_prefix, PyObject *__pyx_v_name, char const **__pyx_v_pr, char const **__pyx_v_nm) {
char const *__pyx_v_p;
char const *__pyx_v_n;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getpair", 0);
__Pyx_INCREF(__pyx_v_prefix);
__Pyx_INCREF(__pyx_v_name);
/* "petsc4py/PETSc/petscopt.pxi":112
* cdef getpair(prefix, name, const char **pr, const char **nm):
* # --
* cdef const char *p = NULL # <<<<<<<<<<<<<<
* prefix = str2bytes(prefix, &p)
* if p != NULL and p[0] == c'-':
*/
__pyx_v_p = NULL;
/* "petsc4py/PETSc/petscopt.pxi":113
* # --
* cdef const char *p = NULL
* prefix = str2bytes(prefix, &p) # <<<<<<<<<<<<<<
* if p != NULL and p[0] == c'-':
* p = &p[1]
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_p)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscopt.pxi":114
* cdef const char *p = NULL
* prefix = str2bytes(prefix, &p)
* if p != NULL and p[0] == c'-': # <<<<<<<<<<<<<<
* p = &p[1]
* # --
*/
__pyx_t_3 = ((__pyx_v_p != NULL) != 0);
if (__pyx_t_3) {
} else {
__pyx_t_2 = __pyx_t_3;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_3 = (((__pyx_v_p[0]) == '-') != 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscopt.pxi":115
* prefix = str2bytes(prefix, &p)
* if p != NULL and p[0] == c'-':
* p = &p[1] # <<<<<<<<<<<<<<
* # --
* cdef const char *n = NULL
*/
__pyx_v_p = (&(__pyx_v_p[1]));
/* "petsc4py/PETSc/petscopt.pxi":114
* cdef const char *p = NULL
* prefix = str2bytes(prefix, &p)
* if p != NULL and p[0] == c'-': # <<<<<<<<<<<<<<
* p = &p[1]
* # --
*/
}
/* "petsc4py/PETSc/petscopt.pxi":117
* p = &p[1]
* # --
* cdef const char *n = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &n)
* if n != NULL and n[0] != c'-':
*/
__pyx_v_n = NULL;
/* "petsc4py/PETSc/petscopt.pxi":118
* # --
* cdef const char *n = NULL
* name = str2bytes(name, &n) # <<<<<<<<<<<<<<
* if n != NULL and n[0] != c'-':
* name = b'-' + name
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 118, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscopt.pxi":119
* cdef const char *n = NULL
* name = str2bytes(name, &n)
* if n != NULL and n[0] != c'-': # <<<<<<<<<<<<<<
* name = b'-' + name
* name = str2bytes(name, &n)
*/
__pyx_t_3 = ((__pyx_v_n != NULL) != 0);
if (__pyx_t_3) {
} else {
__pyx_t_2 = __pyx_t_3;
goto __pyx_L7_bool_binop_done;
}
__pyx_t_3 = (((__pyx_v_n[0]) != '-') != 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L7_bool_binop_done:;
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscopt.pxi":120
* name = str2bytes(name, &n)
* if n != NULL and n[0] != c'-':
* name = b'-' + name # <<<<<<<<<<<<<<
* name = str2bytes(name, &n)
* # --
*/
__pyx_t_1 = PyNumber_Add(__pyx_kp_b__4, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscopt.pxi":121
* if n != NULL and n[0] != c'-':
* name = b'-' + name
* name = str2bytes(name, &n) # <<<<<<<<<<<<<<
* # --
* pr[0] = p
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscopt.pxi":119
* cdef const char *n = NULL
* name = str2bytes(name, &n)
* if n != NULL and n[0] != c'-': # <<<<<<<<<<<<<<
* name = b'-' + name
* name = str2bytes(name, &n)
*/
}
/* "petsc4py/PETSc/petscopt.pxi":123
* name = str2bytes(name, &n)
* # --
* pr[0] = p # <<<<<<<<<<<<<<
* nm[0] = n
* return (prefix, name)
*/
(__pyx_v_pr[0]) = __pyx_v_p;
/* "petsc4py/PETSc/petscopt.pxi":124
* # --
* pr[0] = p
* nm[0] = n # <<<<<<<<<<<<<<
* return (prefix, name)
*
*/
(__pyx_v_nm[0]) = __pyx_v_n;
/* "petsc4py/PETSc/petscopt.pxi":125
* pr[0] = p
* nm[0] = n
* return (prefix, name) # <<<<<<<<<<<<<<
*
* cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 125, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_prefix);
__Pyx_GIVEREF(__pyx_v_prefix);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_prefix);
__Pyx_INCREF(__pyx_v_name);
__Pyx_GIVEREF(__pyx_v_name);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_name);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscopt.pxi":110
* OPT_STRING
*
* cdef getpair(prefix, name, const char **pr, const char **nm): # <<<<<<<<<<<<<<
* # --
* cdef const char *p = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.getpair", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_prefix);
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscopt.pxi":127
* return (prefix, name)
*
* cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft): # <<<<<<<<<<<<<<
* cdef const char *pr = NULL
* cdef const char *nm = NULL
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getopt(PetscOptions __pyx_v_opt, enum __pyx_t_8petsc4py_5PETSc_PetscOptType __pyx_v_otype, PyObject *__pyx_v_prefix, PyObject *__pyx_v_name, PyObject *__pyx_v_deft) {
char const *__pyx_v_pr;
char const *__pyx_v_nm;
CYTHON_UNUSED PyObject *__pyx_v_tmp = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getopt", 0);
/* "petsc4py/PETSc/petscopt.pxi":128
*
* cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft):
* cdef const char *pr = NULL # <<<<<<<<<<<<<<
* cdef const char *nm = NULL
* tmp = getpair(prefix, name, &pr, &nm)
*/
__pyx_v_pr = NULL;
/* "petsc4py/PETSc/petscopt.pxi":129
* cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft):
* cdef const char *pr = NULL
* cdef const char *nm = NULL # <<<<<<<<<<<<<<
* tmp = getpair(prefix, name, &pr, &nm)
* if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft)
*/
__pyx_v_nm = NULL;
/* "petsc4py/PETSc/petscopt.pxi":130
* cdef const char *pr = NULL
* cdef const char *nm = NULL
* tmp = getpair(prefix, name, &pr, &nm) # <<<<<<<<<<<<<<
* if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft)
* if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getpair(__pyx_v_prefix, __pyx_v_name, (&__pyx_v_pr), (&__pyx_v_nm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tmp = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscopt.pxi":131
* cdef const char *nm = NULL
* tmp = getpair(prefix, name, &pr, &nm)
* if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft) # <<<<<<<<<<<<<<
* if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft)
* if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft)
*/
__pyx_t_2 = ((__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_BOOL) != 0);
if (__pyx_t_2) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_Bool(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":132
* tmp = getpair(prefix, name, &pr, &nm)
* if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft)
* if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft) # <<<<<<<<<<<<<<
* if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft)
* if otype == OPT_SCALAR : return getopt_Scalar (opt, pr, nm, deft)
*/
__pyx_t_2 = ((__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_INT) != 0);
if (__pyx_t_2) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_Int(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":133
* if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft)
* if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft)
* if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft) # <<<<<<<<<<<<<<
* if otype == OPT_SCALAR : return getopt_Scalar (opt, pr, nm, deft)
* if otype == OPT_STRING : return getopt_String (opt, pr, nm, deft)
*/
__pyx_t_2 = ((__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_REAL) != 0);
if (__pyx_t_2) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_Real(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 133, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":134
* if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft)
* if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft)
* if otype == OPT_SCALAR : return getopt_Scalar (opt, pr, nm, deft) # <<<<<<<<<<<<<<
* if otype == OPT_STRING : return getopt_String (opt, pr, nm, deft)
*
*/
__pyx_t_2 = ((__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_SCALAR) != 0);
if (__pyx_t_2) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_Scalar(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 134, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":135
* if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft)
* if otype == OPT_SCALAR : return getopt_Scalar (opt, pr, nm, deft)
* if otype == OPT_STRING : return getopt_String (opt, pr, nm, deft) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_2 = ((__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_STRING) != 0);
if (__pyx_t_2) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_String(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":127
* return (prefix, name)
*
* cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft): # <<<<<<<<<<<<<<
* cdef const char *pr = NULL
* cdef const char *nm = NULL
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.getopt", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscopt.pxi":140
* # simple minded options parser
*
* cdef tokenize(options): # <<<<<<<<<<<<<<
* cdef PetscToken t = NULL
* cdef const char *s = NULL
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_tokenize(PyObject *__pyx_v_options) {
PetscToken __pyx_v_t;
char const *__pyx_v_s;
char const *__pyx_v_p;
PyObject *__pyx_v_tokens = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
int __pyx_t_6;
char const *__pyx_t_7;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("tokenize", 0);
__Pyx_INCREF(__pyx_v_options);
/* "petsc4py/PETSc/petscopt.pxi":141
*
* cdef tokenize(options):
* cdef PetscToken t = NULL # <<<<<<<<<<<<<<
* cdef const char *s = NULL
* cdef const char *p = NULL
*/
__pyx_v_t = NULL;
/* "petsc4py/PETSc/petscopt.pxi":142
* cdef tokenize(options):
* cdef PetscToken t = NULL
* cdef const char *s = NULL # <<<<<<<<<<<<<<
* cdef const char *p = NULL
* options = str2bytes(options, &s)
*/
__pyx_v_s = NULL;
/* "petsc4py/PETSc/petscopt.pxi":143
* cdef PetscToken t = NULL
* cdef const char *s = NULL
* cdef const char *p = NULL # <<<<<<<<<<<<<<
* options = str2bytes(options, &s)
* cdef list tokens = []
*/
__pyx_v_p = NULL;
/* "petsc4py/PETSc/petscopt.pxi":144
* cdef const char *s = NULL
* cdef const char *p = NULL
* options = str2bytes(options, &s) # <<<<<<<<<<<<<<
* cdef list tokens = []
* CHKERR( PetscTokenCreate(s, c' ', &t) )
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_options, (&__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 144, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_options, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscopt.pxi":145
* cdef const char *p = NULL
* options = str2bytes(options, &s)
* cdef list tokens = [] # <<<<<<<<<<<<<<
* CHKERR( PetscTokenCreate(s, c' ', &t) )
* try:
*/
__pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 145, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tokens = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscopt.pxi":146
* options = str2bytes(options, &s)
* cdef list tokens = []
* CHKERR( PetscTokenCreate(s, c' ', &t) ) # <<<<<<<<<<<<<<
* try:
* CHKERR( PetscTokenFind(t, <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(4, 146, __pyx_L1_error)
/* "petsc4py/PETSc/petscopt.pxi":147
* cdef list tokens = []
* CHKERR( PetscTokenCreate(s, c' ', &t) )
* try: # <<<<<<<<<<<<<<
* CHKERR( PetscTokenFind(t, <char**>&p) )
* while p != NULL:
*/
/*try:*/ {
/* "petsc4py/PETSc/petscopt.pxi":148
* CHKERR( PetscTokenCreate(s, c' ', &t) )
* try:
* CHKERR( PetscTokenFind(t, <char**>&p) ) # <<<<<<<<<<<<<<
* while p != NULL:
* tokens.append(bytes2str(p))
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTokenFind(__pyx_v_t, ((char **)(&__pyx_v_p)))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 148, __pyx_L4_error)
/* "petsc4py/PETSc/petscopt.pxi":149
* try:
* CHKERR( PetscTokenFind(t, <char**>&p) )
* while p != NULL: # <<<<<<<<<<<<<<
* tokens.append(bytes2str(p))
* CHKERR( PetscTokenFind(t, <char**>&p) )
*/
while (1) {
__pyx_t_3 = ((__pyx_v_p != NULL) != 0);
if (!__pyx_t_3) break;
/* "petsc4py/PETSc/petscopt.pxi":150
* CHKERR( PetscTokenFind(t, <char**>&p) )
* while p != NULL:
* tokens.append(bytes2str(p)) # <<<<<<<<<<<<<<
* CHKERR( PetscTokenFind(t, <char**>&p) )
* finally:
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 150, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __Pyx_PyList_Append(__pyx_v_tokens, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 150, __pyx_L4_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/petscopt.pxi":151
* while p != NULL:
* tokens.append(bytes2str(p))
* CHKERR( PetscTokenFind(t, <char**>&p) ) # <<<<<<<<<<<<<<
* finally:
* CHKERR( PetscTokenDestroy(&t) )
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTokenFind(__pyx_v_t, ((char **)(&__pyx_v_p)))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 151, __pyx_L4_error)
}
}
/* "petsc4py/PETSc/petscopt.pxi":153
* CHKERR( PetscTokenFind(t, <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(4, 153, __pyx_L1_error)
goto __pyx_L5;
}
__pyx_L4_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_11);
__Pyx_XGOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_t_13);
__pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename;
{
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTokenDestroy((&__pyx_v_t))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 153, __pyx_L9_error)
}
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
}
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
__pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
__pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7;
goto __pyx_L1_error;
__pyx_L9_error:;
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
}
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
goto __pyx_L1_error;
}
__pyx_L5:;
}
/* "petsc4py/PETSc/petscopt.pxi":154
* finally:
* CHKERR( PetscTokenDestroy(&t) )
* return tokens # <<<<<<<<<<<<<<
*
* cdef bint iskey(key):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_tokens);
__pyx_r = __pyx_v_tokens;
goto __pyx_L0;
/* "petsc4py/PETSc/petscopt.pxi":140
* # simple minded options parser
*
* cdef tokenize(options): # <<<<<<<<<<<<<<
* cdef PetscToken t = NULL
* cdef const char *s = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.tokenize", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tokens);
__Pyx_XDECREF(__pyx_v_options);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscopt.pxi":156
* return tokens
*
* cdef bint iskey(key): # <<<<<<<<<<<<<<
* cdef const char *k = NULL
* cdef PetscBool b = PETSC_FALSE
*/
static int __pyx_f_8petsc4py_5PETSc_iskey(PyObject *__pyx_v_key) {
char const *__pyx_v_k;
PetscBool __pyx_v_b;
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("iskey", 0);
__Pyx_INCREF(__pyx_v_key);
/* "petsc4py/PETSc/petscopt.pxi":157
*
* cdef bint iskey(key):
* cdef const char *k = NULL # <<<<<<<<<<<<<<
* cdef PetscBool b = PETSC_FALSE
* if key:
*/
__pyx_v_k = NULL;
/* "petsc4py/PETSc/petscopt.pxi":158
* cdef bint iskey(key):
* cdef const char *k = NULL
* cdef PetscBool b = PETSC_FALSE # <<<<<<<<<<<<<<
* if key:
* key = str2bytes(key, &k)
*/
__pyx_v_b = PETSC_FALSE;
/* "petsc4py/PETSc/petscopt.pxi":159
* cdef const char *k = NULL
* cdef PetscBool b = PETSC_FALSE
* if key: # <<<<<<<<<<<<<<
* key = str2bytes(key, &k)
* CHKERR( PetscOptionsValidKey(k, &b) )
*/
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_key); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 159, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscopt.pxi":160
* cdef PetscBool b = PETSC_FALSE
* if key:
* key = str2bytes(key, &k) # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsValidKey(k, &b) )
* if b == PETSC_TRUE:
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_key, (&__pyx_v_k)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_key, __pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscopt.pxi":161
* if key:
* key = str2bytes(key, &k)
* CHKERR( PetscOptionsValidKey(k, &b) ) # <<<<<<<<<<<<<<
* if b == PETSC_TRUE:
* return True
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsValidKey(__pyx_v_k, (&__pyx_v_b))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(4, 161, __pyx_L1_error)
/* "petsc4py/PETSc/petscopt.pxi":162
* key = str2bytes(key, &k)
* CHKERR( PetscOptionsValidKey(k, &b) )
* if b == PETSC_TRUE: # <<<<<<<<<<<<<<
* return True
* return False
*/
__pyx_t_1 = ((__pyx_v_b == PETSC_TRUE) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscopt.pxi":163
* CHKERR( PetscOptionsValidKey(k, &b) )
* if b == PETSC_TRUE:
* return True # <<<<<<<<<<<<<<
* return False
*
*/
__pyx_r = 1;
goto __pyx_L0;
/* "petsc4py/PETSc/petscopt.pxi":162
* key = str2bytes(key, &k)
* CHKERR( PetscOptionsValidKey(k, &b) )
* if b == PETSC_TRUE: # <<<<<<<<<<<<<<
* return True
* return False
*/
}
/* "petsc4py/PETSc/petscopt.pxi":159
* cdef const char *k = NULL
* cdef PetscBool b = PETSC_FALSE
* if key: # <<<<<<<<<<<<<<
* key = str2bytes(key, &k)
* CHKERR( PetscOptionsValidKey(k, &b) )
*/
}
/* "petsc4py/PETSc/petscopt.pxi":164
* if b == PETSC_TRUE:
* return True
* return False # <<<<<<<<<<<<<<
*
* cdef gettok(tokens):
*/
__pyx_r = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscopt.pxi":156
* return tokens
*
* cdef bint iskey(key): # <<<<<<<<<<<<<<
* cdef const char *k = NULL
* cdef PetscBool b = PETSC_FALSE
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_WriteUnraisable("petsc4py.PETSc.iskey", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_key);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscopt.pxi":166
* return False
*
* cdef gettok(tokens): # <<<<<<<<<<<<<<
* if tokens:
* return tokens.pop(0)
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_gettok(PyObject *__pyx_v_tokens) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("gettok", 0);
/* "petsc4py/PETSc/petscopt.pxi":167
*
* cdef gettok(tokens):
* if tokens: # <<<<<<<<<<<<<<
* return tokens.pop(0)
* else:
*/
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_tokens); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 167, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscopt.pxi":168
* cdef gettok(tokens):
* if tokens:
* return tokens.pop(0) # <<<<<<<<<<<<<<
* else:
* return None
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_PopIndex(__pyx_v_tokens, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscopt.pxi":167
*
* cdef gettok(tokens):
* if tokens: # <<<<<<<<<<<<<<
* return tokens.pop(0)
* else:
*/
}
/* "petsc4py/PETSc/petscopt.pxi":170
* return tokens.pop(0)
* else:
* return None # <<<<<<<<<<<<<<
*
* cdef getkey(key, prefix):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscopt.pxi":166
* return False
*
* cdef gettok(tokens): # <<<<<<<<<<<<<<
* if tokens:
* return tokens.pop(0)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.gettok", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscopt.pxi":172
* return None
*
* cdef getkey(key, prefix): # <<<<<<<<<<<<<<
* if not iskey(key):
* return None
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_getkey(PyObject *__pyx_v_key, PyObject *__pyx_v_prefix) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getkey", 0);
__Pyx_INCREF(__pyx_v_key);
/* "petsc4py/PETSc/petscopt.pxi":173
*
* cdef getkey(key, prefix):
* if not iskey(key): # <<<<<<<<<<<<<<
* return None
* key = key[1:]
*/
__pyx_t_1 = ((!(__pyx_f_8petsc4py_5PETSc_iskey(__pyx_v_key) != 0)) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscopt.pxi":174
* cdef getkey(key, prefix):
* if not iskey(key):
* return None # <<<<<<<<<<<<<<
* key = key[1:]
* if key[0] == '-':
*/
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
/* "petsc4py/PETSc/petscopt.pxi":173
*
* cdef getkey(key, prefix):
* if not iskey(key): # <<<<<<<<<<<<<<
* return None
* key = key[1:]
*/
}
/* "petsc4py/PETSc/petscopt.pxi":175
* if not iskey(key):
* return None
* key = key[1:] # <<<<<<<<<<<<<<
* if key[0] == '-':
* key = key[1:]
*/
__pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_key, 1, 0, NULL, NULL, &__pyx_slice__6, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 175, __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":176
* return None
* key = key[1:]
* if key[0] == '-': # <<<<<<<<<<<<<<
* key = key[1:]
* if not key.startswith(prefix):
*/
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__4, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 176, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscopt.pxi":177
* key = key[1:]
* if key[0] == '-':
* key = key[1:] # <<<<<<<<<<<<<<
* if not key.startswith(prefix):
* return None
*/
__pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_key, 1, 0, NULL, NULL, &__pyx_slice__6, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 177, __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":176
* return None
* key = key[1:]
* if key[0] == '-': # <<<<<<<<<<<<<<
* key = key[1:]
* if not key.startswith(prefix):
*/
}
/* "petsc4py/PETSc/petscopt.pxi":178
* if key[0] == '-':
* key = key[1:]
* if not key.startswith(prefix): # <<<<<<<<<<<<<<
* return None
* return key.replace(prefix, '', 1)
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 178, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_prefix) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_prefix);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 178, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 178, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_5 = ((!__pyx_t_1) != 0);
if (__pyx_t_5) {
/* "petsc4py/PETSc/petscopt.pxi":179
* key = key[1:]
* if not key.startswith(prefix):
* return None # <<<<<<<<<<<<<<
* return key.replace(prefix, '', 1)
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
/* "petsc4py/PETSc/petscopt.pxi":178
* if key[0] == '-':
* key = key[1:]
* if not key.startswith(prefix): # <<<<<<<<<<<<<<
* return None
* return key.replace(prefix, '', 1)
*/
}
/* "petsc4py/PETSc/petscopt.pxi":180
* if not key.startswith(prefix):
* return None
* return key.replace(prefix, '', 1) # <<<<<<<<<<<<<<
*
* cdef parseopt(options, prefix):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_replace); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 180, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_prefix, __pyx_kp_s__7, __pyx_int_1};
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 180, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_prefix, __pyx_kp_s__7, __pyx_int_1};
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 180, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else
#endif
{
__pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 180, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_v_prefix);
__Pyx_GIVEREF(__pyx_v_prefix);
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_prefix);
__Pyx_INCREF(__pyx_kp_s__7);
__Pyx_GIVEREF(__pyx_kp_s__7);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s__7);
__Pyx_INCREF(__pyx_int_1);
__Pyx_GIVEREF(__pyx_int_1);
PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_int_1);
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 180, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscopt.pxi":172
* return None
*
* cdef getkey(key, prefix): # <<<<<<<<<<<<<<
* if not iskey(key):
* return None
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.getkey", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_key);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscopt.pxi":182
* return key.replace(prefix, '', 1)
*
* cdef parseopt(options, prefix): # <<<<<<<<<<<<<<
* if isinstance(options, str):
* tokens = tokenize(options)
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_parseopt(PyObject *__pyx_v_options, PyObject *__pyx_v_prefix) {
PyObject *__pyx_v_tokens = NULL;
PyObject *__pyx_v_opts = NULL;
PyObject *__pyx_v_first = NULL;
PyObject *__pyx_v_key = NULL;
PyObject *__pyx_v_second = NULL;
PyObject *__pyx_v_value = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("parseopt", 0);
__Pyx_INCREF(__pyx_v_prefix);
/* "petsc4py/PETSc/petscopt.pxi":183
*
* cdef parseopt(options, prefix):
* if isinstance(options, str): # <<<<<<<<<<<<<<
* tokens = tokenize(options)
* else:
*/
__pyx_t_1 = PyString_Check(__pyx_v_options);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscopt.pxi":184
* cdef parseopt(options, prefix):
* if isinstance(options, str):
* tokens = tokenize(options) # <<<<<<<<<<<<<<
* else:
* tokens = list(options)
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_tokenize(__pyx_v_options); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_tokens = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscopt.pxi":183
*
* cdef parseopt(options, prefix):
* if isinstance(options, str): # <<<<<<<<<<<<<<
* tokens = tokenize(options)
* else:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscopt.pxi":186
* tokens = tokenize(options)
* else:
* tokens = list(options) # <<<<<<<<<<<<<<
* prefix = prefix or ''
* # parser loop
*/
/*else*/ {
__pyx_t_3 = PySequence_List(__pyx_v_options); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_tokens = __pyx_t_3;
__pyx_t_3 = 0;
}
__pyx_L3:;
/* "petsc4py/PETSc/petscopt.pxi":187
* else:
* tokens = list(options)
* prefix = prefix or '' # <<<<<<<<<<<<<<
* # parser loop
* opts = {}
*/
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 187, __pyx_L1_error)
if (!__pyx_t_2) {
} else {
__Pyx_INCREF(__pyx_v_prefix);
__pyx_t_3 = __pyx_v_prefix;
goto __pyx_L4_bool_binop_done;
}
__Pyx_INCREF(__pyx_kp_s__7);
__pyx_t_3 = __pyx_kp_s__7;
__pyx_L4_bool_binop_done:;
__Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscopt.pxi":189
* prefix = prefix or ''
* # parser loop
* opts = {} # <<<<<<<<<<<<<<
* first = gettok(tokens)
* while first:
*/
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_opts = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscopt.pxi":190
* # parser loop
* opts = {}
* first = gettok(tokens) # <<<<<<<<<<<<<<
* while first:
* key = getkey(first, prefix)
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_gettok(__pyx_v_tokens); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 190, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_first = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscopt.pxi":191
* opts = {}
* first = gettok(tokens)
* while first: # <<<<<<<<<<<<<<
* key = getkey(first, prefix)
* if not key:
*/
while (1) {
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_first); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 191, __pyx_L1_error)
if (!__pyx_t_2) break;
/* "petsc4py/PETSc/petscopt.pxi":192
* first = gettok(tokens)
* while first:
* key = getkey(first, prefix) # <<<<<<<<<<<<<<
* if not key:
* first = gettok(tokens)
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_getkey(__pyx_v_first, __pyx_v_prefix); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscopt.pxi":193
* while first:
* key = getkey(first, prefix)
* if not key: # <<<<<<<<<<<<<<
* first = gettok(tokens)
* else:
*/
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_key); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 193, __pyx_L1_error)
__pyx_t_1 = ((!__pyx_t_2) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscopt.pxi":194
* key = getkey(first, prefix)
* if not key:
* first = gettok(tokens) # <<<<<<<<<<<<<<
* else:
* second = gettok(tokens)
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_gettok(__pyx_v_tokens); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 194, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_first, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscopt.pxi":193
* while first:
* key = getkey(first, prefix)
* if not key: # <<<<<<<<<<<<<<
* first = gettok(tokens)
* else:
*/
goto __pyx_L8;
}
/* "petsc4py/PETSc/petscopt.pxi":196
* first = gettok(tokens)
* else:
* second = gettok(tokens) # <<<<<<<<<<<<<<
* if getkey(second, prefix):
* value = None
*/
/*else*/ {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_gettok(__pyx_v_tokens); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_XDECREF_SET(__pyx_v_second, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscopt.pxi":197
* else:
* second = gettok(tokens)
* if getkey(second, prefix): # <<<<<<<<<<<<<<
* value = None
* first = second
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_getkey(__pyx_v_second, __pyx_v_prefix); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 197, __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(4, 197, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscopt.pxi":198
* second = gettok(tokens)
* if getkey(second, prefix):
* value = None # <<<<<<<<<<<<<<
* first = second
* else:
*/
__Pyx_INCREF(Py_None);
__Pyx_XDECREF_SET(__pyx_v_value, Py_None);
/* "petsc4py/PETSc/petscopt.pxi":199
* if getkey(second, prefix):
* value = None
* first = second # <<<<<<<<<<<<<<
* else:
* value = second
*/
__Pyx_INCREF(__pyx_v_second);
__Pyx_DECREF_SET(__pyx_v_first, __pyx_v_second);
/* "petsc4py/PETSc/petscopt.pxi":197
* else:
* second = gettok(tokens)
* if getkey(second, prefix): # <<<<<<<<<<<<<<
* value = None
* first = second
*/
goto __pyx_L9;
}
/* "petsc4py/PETSc/petscopt.pxi":201
* first = second
* else:
* value = second # <<<<<<<<<<<<<<
* first = gettok(tokens)
* opts[key] = value
*/
/*else*/ {
__Pyx_INCREF(__pyx_v_second);
__Pyx_XDECREF_SET(__pyx_v_value, __pyx_v_second);
/* "petsc4py/PETSc/petscopt.pxi":202
* else:
* value = second
* first = gettok(tokens) # <<<<<<<<<<<<<<
* opts[key] = value
* # we are done
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_gettok(__pyx_v_tokens); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_first, __pyx_t_3);
__pyx_t_3 = 0;
}
__pyx_L9:;
/* "petsc4py/PETSc/petscopt.pxi":203
* value = second
* first = gettok(tokens)
* opts[key] = value # <<<<<<<<<<<<<<
* # we are done
* return opts
*/
if (unlikely(PyDict_SetItem(__pyx_v_opts, __pyx_v_key, __pyx_v_value) < 0)) __PYX_ERR(4, 203, __pyx_L1_error)
}
__pyx_L8:;
}
/* "petsc4py/PETSc/petscopt.pxi":205
* opts[key] = value
* # we are done
* return opts # <<<<<<<<<<<<<<
*
* #
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_opts);
__pyx_r = __pyx_v_opts;
goto __pyx_L0;
/* "petsc4py/PETSc/petscopt.pxi":182
* return key.replace(prefix, '', 1)
*
* cdef parseopt(options, prefix): # <<<<<<<<<<<<<<
* if isinstance(options, str):
* tokens = tokenize(options)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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 *: # <<<<<<<<<<<<<<
* from mpi4py import MPI
* cdef PyMPICommGet *commget = \
*/
static CYTHON_INLINE MPI_Comm __pyx_f_8petsc4py_5PETSc_mpi4py_Comm_Get(PyObject *__pyx_v_comm) {
PyObject *__pyx_v_MPI = NULL;
__pyx_t_8petsc4py_5PETSc_PyMPICommGet *__pyx_v_commget;
MPI_Comm *__pyx_v_ptr;
MPI_Comm __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
void *__pyx_t_3;
int __pyx_t_4;
MPI_Comm *__pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mpi4py_Comm_Get", 0);
/* "petsc4py/PETSc/petscmpi.pxi":45
*
* cdef inline MPI_Comm mpi4py_Comm_Get(object comm) except *:
* from mpi4py import MPI # <<<<<<<<<<<<<<
* cdef PyMPICommGet *commget = \
* <PyMPICommGet*> Cython_ImportFunction(
*/
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 45, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_n_s_MPI);
__Pyx_GIVEREF(__pyx_n_s_MPI);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_MPI);
__pyx_t_2 = __Pyx_Import(__pyx_n_s_mpi4py, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 45, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 45, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_1);
__pyx_v_MPI = __pyx_t_1;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/petscmpi.pxi":47
* 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
*/
__pyx_t_3 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIComm_Get"), ((char *)"MPI_Comm *(PyObject *)")); if (unlikely(__pyx_t_3 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(15, 47, __pyx_L1_error)
__pyx_v_commget = ((__pyx_t_8petsc4py_5PETSc_PyMPICommGet *)__pyx_t_3);
/* "petsc4py/PETSc/petscmpi.pxi":49
* <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_4 = ((__pyx_v_commget == NULL) != 0);
if (__pyx_t_4) {
__pyx_r = MPI_COMM_NULL;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmpi.pxi":50
* MPI, b"PyMPIComm_Get", b"MPI_Comm *(PyObject *)")
* if commget == NULL: return MPI_COMM_NULL
* cdef MPI_Comm *ptr = commget(comm) # <<<<<<<<<<<<<<
* if ptr == NULL: return MPI_COMM_NULL
* return ptr[0]
*/
__pyx_t_5 = __pyx_v_commget(__pyx_v_comm); if (unlikely(__pyx_t_5 == ((MPI_Comm *)NULL))) __PYX_ERR(15, 50, __pyx_L1_error)
__pyx_v_ptr = __pyx_t_5;
/* "petsc4py/PETSc/petscmpi.pxi":51
* if commget == NULL: return MPI_COMM_NULL
* cdef MPI_Comm *ptr = commget(comm)
* if ptr == NULL: return MPI_COMM_NULL # <<<<<<<<<<<<<<
* return ptr[0]
*
*/
__pyx_t_4 = ((__pyx_v_ptr == NULL) != 0);
if (__pyx_t_4) {
__pyx_r = MPI_COMM_NULL;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmpi.pxi":52
* 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 *: # <<<<<<<<<<<<<<
* from mpi4py import MPI
* cdef PyMPICommGet *commget = \
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.mpi4py_Comm_Get", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_MPI);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmpi.pxi":54
* return ptr[0]
*
* cdef inline object mpi4py_Comm_New(MPI_Comm comm): # <<<<<<<<<<<<<<
* from mpi4py import MPI
* cdef PyMPICommNew *commnew = \
*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_mpi4py_Comm_New(MPI_Comm __pyx_v_comm) {
PyObject *__pyx_v_MPI = NULL;
__pyx_t_8petsc4py_5PETSc_PyMPICommNew *__pyx_v_commnew;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
void *__pyx_t_3;
int __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mpi4py_Comm_New", 0);
/* "petsc4py/PETSc/petscmpi.pxi":55
*
* cdef inline object mpi4py_Comm_New(MPI_Comm comm):
* from mpi4py import MPI # <<<<<<<<<<<<<<
* cdef PyMPICommNew *commnew = \
* <PyMPICommNew*> Cython_ImportFunction(
*/
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 55, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_n_s_MPI);
__Pyx_GIVEREF(__pyx_n_s_MPI);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_MPI);
__pyx_t_2 = __Pyx_Import(__pyx_n_s_mpi4py, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 55, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 55, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_1);
__pyx_v_MPI = __pyx_t_1;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/petscmpi.pxi":57
* from mpi4py import MPI
* cdef PyMPICommNew *commnew = \
* <PyMPICommNew*> Cython_ImportFunction( # <<<<<<<<<<<<<<
* MPI, b"PyMPIComm_New", b"PyObject *(MPI_Comm)")
* if commnew == NULL: return None
*/
__pyx_t_3 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIComm_New"), ((char *)"PyObject *(MPI_Comm)")); if (unlikely(__pyx_t_3 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(15, 57, __pyx_L1_error)
__pyx_v_commnew = ((__pyx_t_8petsc4py_5PETSc_PyMPICommNew *)__pyx_t_3);
/* "petsc4py/PETSc/petscmpi.pxi":59
* <PyMPICommNew*> Cython_ImportFunction(
* MPI, b"PyMPIComm_New", b"PyObject *(MPI_Comm)")
* if commnew == NULL: return None # <<<<<<<<<<<<<<
* return commnew(comm)
*
*/
__pyx_t_4 = ((__pyx_v_commnew == NULL) != 0);
if (__pyx_t_4) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmpi.pxi":60
* MPI, b"PyMPIComm_New", b"PyObject *(MPI_Comm)")
* if commnew == NULL: return None
* return commnew(comm) # <<<<<<<<<<<<<<
*
* cdef inline MPI_Datatype mpi4py_Datatype_Get(object datatype) except *:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_v_commnew(__pyx_v_comm); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 60, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscmpi.pxi":54
* return ptr[0]
*
* cdef inline object mpi4py_Comm_New(MPI_Comm comm): # <<<<<<<<<<<<<<
* from mpi4py import MPI
* cdef PyMPICommNew *commnew = \
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.mpi4py_Comm_New", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_MPI);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmpi.pxi":62
* return commnew(comm)
*
* cdef inline MPI_Datatype mpi4py_Datatype_Get(object datatype) except *: # <<<<<<<<<<<<<<
* from mpi4py import MPI
* cdef PyMPIDatatypeGet *datatypeget = \
*/
static CYTHON_INLINE MPI_Datatype __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(PyObject *__pyx_v_datatype) {
PyObject *__pyx_v_MPI = NULL;
__pyx_t_8petsc4py_5PETSc_PyMPIDatatypeGet *__pyx_v_datatypeget;
MPI_Datatype *__pyx_v_ptr;
MPI_Datatype __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
void *__pyx_t_3;
int __pyx_t_4;
MPI_Datatype *__pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mpi4py_Datatype_Get", 0);
/* "petsc4py/PETSc/petscmpi.pxi":63
*
* cdef inline MPI_Datatype mpi4py_Datatype_Get(object datatype) except *:
* from mpi4py import MPI # <<<<<<<<<<<<<<
* cdef PyMPIDatatypeGet *datatypeget = \
* <PyMPIDatatypeGet*> Cython_ImportFunction(
*/
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 63, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_n_s_MPI);
__Pyx_GIVEREF(__pyx_n_s_MPI);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_MPI);
__pyx_t_2 = __Pyx_Import(__pyx_n_s_mpi4py, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 63, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 63, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_1);
__pyx_v_MPI = __pyx_t_1;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/petscmpi.pxi":65
* 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
*/
__pyx_t_3 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIDatatype_Get"), ((char *)"MPI_Datatype *(PyObject *)")); if (unlikely(__pyx_t_3 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(15, 65, __pyx_L1_error)
__pyx_v_datatypeget = ((__pyx_t_8petsc4py_5PETSc_PyMPIDatatypeGet *)__pyx_t_3);
/* "petsc4py/PETSc/petscmpi.pxi":67
* <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_4 = ((__pyx_v_datatypeget == NULL) != 0);
if (__pyx_t_4) {
__pyx_r = MPI_DATATYPE_NULL;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmpi.pxi":68
* MPI, b"PyMPIDatatype_Get", b"MPI_Datatype *(PyObject *)")
* if datatypeget == NULL: return MPI_DATATYPE_NULL
* cdef MPI_Datatype *ptr = datatypeget(datatype) # <<<<<<<<<<<<<<
* if ptr == NULL: return MPI_DATATYPE_NULL
* return ptr[0]
*/
__pyx_t_5 = __pyx_v_datatypeget(__pyx_v_datatype); if (unlikely(__pyx_t_5 == ((MPI_Datatype *)NULL))) __PYX_ERR(15, 68, __pyx_L1_error)
__pyx_v_ptr = __pyx_t_5;
/* "petsc4py/PETSc/petscmpi.pxi":69
* if datatypeget == NULL: return MPI_DATATYPE_NULL
* cdef MPI_Datatype *ptr = datatypeget(datatype)
* if ptr == NULL: return MPI_DATATYPE_NULL # <<<<<<<<<<<<<<
* return ptr[0]
*
*/
__pyx_t_4 = ((__pyx_v_ptr == NULL) != 0);
if (__pyx_t_4) {
__pyx_r = MPI_DATATYPE_NULL;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmpi.pxi":70
* cdef MPI_Datatype *ptr = datatypeget(datatype)
* if ptr == NULL: return MPI_DATATYPE_NULL
* return ptr[0] # <<<<<<<<<<<<<<
*
* cdef inline MPI_Op mpi4py_Op_Get(object op) except *:
*/
__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 *: # <<<<<<<<<<<<<<
* from mpi4py import MPI
* cdef PyMPIDatatypeGet *datatypeget = \
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.mpi4py_Datatype_Get", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_MPI);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmpi.pxi":72
* return ptr[0]
*
* cdef inline MPI_Op mpi4py_Op_Get(object op) except *: # <<<<<<<<<<<<<<
* from mpi4py import MPI
* cdef PyMPIOpGet *opget = \
*/
static CYTHON_INLINE MPI_Op __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(PyObject *__pyx_v_op) {
PyObject *__pyx_v_MPI = NULL;
__pyx_t_8petsc4py_5PETSc_PyMPIOpGet *__pyx_v_opget;
MPI_Op *__pyx_v_ptr;
MPI_Op __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
void *__pyx_t_3;
int __pyx_t_4;
MPI_Op *__pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mpi4py_Op_Get", 0);
/* "petsc4py/PETSc/petscmpi.pxi":73
*
* cdef inline MPI_Op mpi4py_Op_Get(object op) except *:
* from mpi4py import MPI # <<<<<<<<<<<<<<
* cdef PyMPIOpGet *opget = \
* <PyMPIOpGet*> Cython_ImportFunction(
*/
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 73, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_n_s_MPI);
__Pyx_GIVEREF(__pyx_n_s_MPI);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_MPI);
__pyx_t_2 = __Pyx_Import(__pyx_n_s_mpi4py, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 73, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 73, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_1);
__pyx_v_MPI = __pyx_t_1;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/petscmpi.pxi":75
* 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
*/
__pyx_t_3 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIOp_Get"), ((char *)"MPI_Op *(PyObject *)")); if (unlikely(__pyx_t_3 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(15, 75, __pyx_L1_error)
__pyx_v_opget = ((__pyx_t_8petsc4py_5PETSc_PyMPIOpGet *)__pyx_t_3);
/* "petsc4py/PETSc/petscmpi.pxi":77
* <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_4 = ((__pyx_v_opget == NULL) != 0);
if (__pyx_t_4) {
__pyx_r = MPI_OP_NULL;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmpi.pxi":78
* MPI, b"PyMPIOp_Get", b"MPI_Op *(PyObject *)")
* if opget == NULL: return MPI_OP_NULL
* cdef MPI_Op *ptr = opget(op) # <<<<<<<<<<<<<<
* if ptr == NULL: return MPI_OP_NULL
* return ptr[0]
*/
__pyx_t_5 = __pyx_v_opget(__pyx_v_op); if (unlikely(__pyx_t_5 == ((MPI_Op *)NULL))) __PYX_ERR(15, 78, __pyx_L1_error)
__pyx_v_ptr = __pyx_t_5;
/* "petsc4py/PETSc/petscmpi.pxi":79
* if opget == NULL: return MPI_OP_NULL
* cdef MPI_Op *ptr = opget(op)
* if ptr == NULL: return MPI_OP_NULL # <<<<<<<<<<<<<<
* return ptr[0]
*
*/
__pyx_t_4 = ((__pyx_v_ptr == NULL) != 0);
if (__pyx_t_4) {
__pyx_r = MPI_OP_NULL;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmpi.pxi":80
* 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":72
* return ptr[0]
*
* cdef inline MPI_Op mpi4py_Op_Get(object op) except *: # <<<<<<<<<<<<<<
* from mpi4py import MPI
* cdef PyMPIOpGet *opget = \
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.mpi4py_Op_Get", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_MPI);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmpi.pxi":84
* # --------------------------------------------------------------------
*
* 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;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("PetscCommDEALLOC", 0);
/* "petsc4py/PETSc/petscmpi.pxi":85
*
* 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) != 0);
if (__pyx_t_1) {
__pyx_r = PETSC_SUCCESS;
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] # <<<<<<<<<<<<<<
* if tmp == MPI_COMM_NULL: return PETSC_SUCCESS
* comm[0] = MPI_COMM_NULL
*/
__pyx_v_tmp = (__pyx_v_comm[0]);
/* "petsc4py/PETSc/petscmpi.pxi":87
* 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) != 0);
if (__pyx_t_1) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmpi.pxi":88
* 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":89
* 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)) != 0);
if (__pyx_t_1) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmpi.pxi":90
* 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":91
* if not (<int>PetscInitializeCalled): return PETSC_SUCCESS
* if (<int>PetscFinalizeCalled): return PETSC_SUCCESS
* return PetscCommDestroy(&tmp) # <<<<<<<<<<<<<<
*
* cdef inline MPI_Comm def_Comm(object comm, MPI_Comm defv) except *:
*/
__pyx_r = PetscCommDestroy((&__pyx_v_tmp));
goto __pyx_L0;
/* "petsc4py/PETSc/petscmpi.pxi":84
* # --------------------------------------------------------------------
*
* cdef inline PetscErrorCode PetscCommDEALLOC(MPI_Comm* comm): # <<<<<<<<<<<<<<
* if comm == NULL: return PETSC_SUCCESS
* cdef MPI_Comm tmp = comm[0]
*/
/* function exit code */
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmpi.pxi":93
* return PetscCommDestroy(&tmp)
*
* cdef inline MPI_Comm def_Comm(object comm, MPI_Comm defv) except *: # <<<<<<<<<<<<<<
* cdef MPI_Comm retv = MPI_COMM_NULL
* if comm is None:
*/
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;
int __pyx_t_2;
MPI_Comm __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("def_Comm", 0);
/* "petsc4py/PETSc/petscmpi.pxi":94
*
* cdef inline MPI_Comm def_Comm(object comm, MPI_Comm defv) except *:
* cdef MPI_Comm retv = MPI_COMM_NULL # <<<<<<<<<<<<<<
* if comm is None:
* retv = defv
*/
__pyx_v_retv = MPI_COMM_NULL;
/* "petsc4py/PETSc/petscmpi.pxi":95
* cdef inline MPI_Comm def_Comm(object comm, MPI_Comm defv) except *:
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmpi.pxi":96
* 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":95
* cdef inline MPI_Comm def_Comm(object comm, MPI_Comm defv) except *:
* cdef MPI_Comm retv = MPI_COMM_NULL
* if comm is None: # <<<<<<<<<<<<<<
* retv = defv
* elif isinstance(comm, Comm):
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscmpi.pxi":97
* if comm is None:
* retv = defv
* elif isinstance(comm, Comm): # <<<<<<<<<<<<<<
* retv = (<Comm>comm).comm
* elif type(comm).__module__ == 'mpi4py.MPI':
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_comm, __pyx_ptype_8petsc4py_5PETSc_Comm);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscmpi.pxi":98
* retv = defv
* elif isinstance(comm, Comm):
* retv = (<Comm>comm).comm # <<<<<<<<<<<<<<
* elif type(comm).__module__ == 'mpi4py.MPI':
* retv = mpi4py_Comm_Get(comm)
*/
__pyx_t_3 = ((struct PyPetscCommObject *)__pyx_v_comm)->comm;
__pyx_v_retv = __pyx_t_3;
/* "petsc4py/PETSc/petscmpi.pxi":97
* 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":99
* elif isinstance(comm, Comm):
* retv = (<Comm>comm).comm
* elif type(comm).__module__ == 'mpi4py.MPI': # <<<<<<<<<<<<<<
* retv = mpi4py_Comm_Get(comm)
* else:
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_comm)), __pyx_n_s_module); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 99, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s_mpi4py_MPI, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(15, 99, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscmpi.pxi":100
* retv = (<Comm>comm).comm
* elif type(comm).__module__ == 'mpi4py.MPI':
* retv = mpi4py_Comm_Get(comm) # <<<<<<<<<<<<<<
* else:
* retv = (<Comm?>comm).comm
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_mpi4py_Comm_Get(__pyx_v_comm); if (unlikely(PyErr_Occurred())) __PYX_ERR(15, 100, __pyx_L1_error)
__pyx_v_retv = __pyx_t_3;
/* "petsc4py/PETSc/petscmpi.pxi":99
* 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":102
* retv = mpi4py_Comm_Get(comm)
* else:
* retv = (<Comm?>comm).comm # <<<<<<<<<<<<<<
* return retv
*
*/
/*else*/ {
if (!(likely(__Pyx_TypeTest(__pyx_v_comm, __pyx_ptype_8petsc4py_5PETSc_Comm)))) __PYX_ERR(15, 102, __pyx_L1_error)
__pyx_t_3 = ((struct PyPetscCommObject *)__pyx_v_comm)->comm;
__pyx_v_retv = __pyx_t_3;
}
__pyx_L3:;
/* "petsc4py/PETSc/petscmpi.pxi":103
* 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":93
* return PetscCommDestroy(&tmp)
*
* cdef inline MPI_Comm def_Comm(object comm, MPI_Comm defv) except *: # <<<<<<<<<<<<<<
* cdef MPI_Comm retv = MPI_COMM_NULL
* if comm is None:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("petsc4py.PETSc.def_Comm", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmpi.pxi":105
* 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("new_Comm", 0);
/* "petsc4py/PETSc/petscmpi.pxi":106
*
* cdef inline Comm new_Comm(MPI_Comm comm):
* cdef Comm ob = <Comm> Comm() # <<<<<<<<<<<<<<
* ob.comm = comm
* return ob
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 106, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ob = ((struct PyPetscCommObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscmpi.pxi":107
* 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":108
* 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":105
* 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":112
* # --------------------------------------------------------------------
*
* cdef inline int comm_size(MPI_Comm comm) except ? -1: # <<<<<<<<<<<<<<
* if comm == MPI_COMM_NULL: raise ValueError("null communicator")
* cdef int size = 0
*/
static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_comm_size(MPI_Comm __pyx_v_comm) {
int __pyx_v_size;
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("comm_size", 0);
/* "petsc4py/PETSc/petscmpi.pxi":113
*
* 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) != 0);
if (unlikely(__pyx_t_1)) {
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 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(15, 113, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmpi.pxi":114
* 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":115
* if comm == MPI_COMM_NULL: raise ValueError("null communicator")
* cdef int size = 0
* CHKERR( <PetscErrorCode>MPI_Comm_size(comm, &size) ) # <<<<<<<<<<<<<<
* return size
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(((PetscErrorCode)MPI_Comm_size(__pyx_v_comm, (&__pyx_v_size)))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(15, 115, __pyx_L1_error)
/* "petsc4py/PETSc/petscmpi.pxi":116
* 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":112
* # --------------------------------------------------------------------
*
* cdef inline int comm_size(MPI_Comm comm) except ? -1: # <<<<<<<<<<<<<<
* if comm == MPI_COMM_NULL: raise ValueError("null communicator")
* cdef int size = 0
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.comm_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmpi.pxi":118
* return size
*
* cdef inline int comm_rank(MPI_Comm comm) except ? -1: # <<<<<<<<<<<<<<
* if comm == MPI_COMM_NULL: raise ValueError("null communicator")
* cdef int rank = 0
*/
static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_comm_rank(MPI_Comm __pyx_v_comm) {
int __pyx_v_rank;
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("comm_rank", 0);
/* "petsc4py/PETSc/petscmpi.pxi":119
*
* 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) != 0);
if (unlikely(__pyx_t_1)) {
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 119, __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(15, 119, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmpi.pxi":120
* 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":121
* if comm == MPI_COMM_NULL: raise ValueError("null communicator")
* cdef int rank = 0
* CHKERR( <PetscErrorCode>MPI_Comm_rank(comm, &rank) ) # <<<<<<<<<<<<<<
* return rank
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(((PetscErrorCode)MPI_Comm_rank(__pyx_v_comm, (&__pyx_v_rank)))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(15, 121, __pyx_L1_error)
/* "petsc4py/PETSc/petscmpi.pxi":122
* 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":118
* return size
*
* cdef inline int comm_rank(MPI_Comm comm) except ? -1: # <<<<<<<<<<<<<<
* if comm == MPI_COMM_NULL: raise ValueError("null communicator")
* cdef int rank = 0
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.comm_rank", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscsys.pxi":57
*
*
* cdef inline PetscErrorCode Sys_Sizes( # <<<<<<<<<<<<<<
* object size, object bsize,
* PetscInt *_b,
*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Sys_Sizes(PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PetscInt *__pyx_v__b, PetscInt *__pyx_v__n, PetscInt *__pyx_v__N) {
PetscInt __pyx_v_bs;
PetscInt __pyx_v_b;
PetscInt __pyx_v_n;
PetscInt __pyx_v_N;
PyObject *__pyx_v_on = 0;
PyObject *__pyx_v_oN = 0;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
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;
PyObject *__pyx_t_9 = NULL;
PyObject *(*__pyx_t_10)(PyObject *);
int __pyx_t_11;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("Sys_Sizes", 0);
/* "petsc4py/PETSc/petscsys.pxi":64
* ) except PETSC_ERR_PYTHON:
* # get block size
* cdef PetscInt bs=PETSC_DECIDE, b=PETSC_DECIDE # <<<<<<<<<<<<<<
* if bsize is not None: bs = b = asInt(bsize)
* if bs == PETSC_DECIDE: bs = 1
*/
__pyx_v_bs = PETSC_DECIDE;
__pyx_v_b = PETSC_DECIDE;
/* "petsc4py/PETSc/petscsys.pxi":65
* # get block size
* cdef PetscInt bs=PETSC_DECIDE, b=PETSC_DECIDE
* if bsize is not None: bs = b = asInt(bsize) # <<<<<<<<<<<<<<
* if bs == PETSC_DECIDE: bs = 1
* # unpack and get local and global sizes
*/
__pyx_t_1 = (__pyx_v_bsize != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
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(16, 65, __pyx_L1_error)
__pyx_v_bs = __pyx_t_3;
__pyx_v_b = __pyx_t_3;
}
/* "petsc4py/PETSc/petscsys.pxi":66
* cdef PetscInt bs=PETSC_DECIDE, b=PETSC_DECIDE
* if bsize is not None: bs = b = asInt(bsize)
* if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<<
* # unpack and get local and global sizes
* cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE
*/
__pyx_t_2 = ((__pyx_v_bs == PETSC_DECIDE) != 0);
if (__pyx_t_2) {
__pyx_v_bs = 1;
}
/* "petsc4py/PETSc/petscsys.pxi":68
* if bs == PETSC_DECIDE: bs = 1
* # unpack and get local and global sizes
* cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE # <<<<<<<<<<<<<<
* cdef object on, oN
* try:
*/
__pyx_v_n = PETSC_DECIDE;
__pyx_v_N = PETSC_DECIDE;
/* "petsc4py/PETSc/petscsys.pxi":70
* cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE
* cdef object on, oN
* try: # <<<<<<<<<<<<<<
* on, oN = size
* except (TypeError, ValueError):
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_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/petscsys.pxi":71
* cdef object on, oN
* try:
* on, oN = size # <<<<<<<<<<<<<<
* except (TypeError, ValueError):
* on = None; oN = size
*/
if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) {
PyObject* sequence = __pyx_v_size;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(16, 71, __pyx_L5_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
#else
__pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 71, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(16, 71, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_8);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_9 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(16, 71, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
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(16, 71, __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(16, 71, __pyx_L5_error)
__pyx_L12_unpacking_done:;
}
__pyx_v_on = __pyx_t_7;
__pyx_t_7 = 0;
__pyx_v_oN = __pyx_t_8;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/petscsys.pxi":70
* cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE
* cdef object on, oN
* try: # <<<<<<<<<<<<<<
* on, oN = size
* except (TypeError, ValueError):
*/
}
__Pyx_XDECREF(__pyx_t_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_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/petscsys.pxi":72
* try:
* on, oN = size
* except (TypeError, ValueError): # <<<<<<<<<<<<<<
* on = None; oN = size
* if on is not None: n = asInt(on)
*/
__pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
if (__pyx_t_11) {
__Pyx_AddTraceback("petsc4py.PETSc.Sys_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(16, 72, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_9);
/* "petsc4py/PETSc/petscsys.pxi":73
* on, oN = size
* except (TypeError, ValueError):
* on = None; oN = size # <<<<<<<<<<<<<<
* if on is not None: n = asInt(on)
* if oN is not None: N = asInt(oN)
*/
__Pyx_INCREF(Py_None);
__Pyx_XDECREF_SET(__pyx_v_on, Py_None);
__Pyx_INCREF(__pyx_v_size);
__Pyx_XDECREF_SET(__pyx_v_oN, __pyx_v_size);
__Pyx_XDECREF(__pyx_t_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;
__pyx_L7_except_error:;
/* "petsc4py/PETSc/petscsys.pxi":70
* cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE
* cdef object on, oN
* try: # <<<<<<<<<<<<<<
* on, oN = size
* except (TypeError, ValueError):
*/
__Pyx_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/petscsys.pxi":74
* except (TypeError, ValueError):
* on = None; oN = size
* if on is not None: n = asInt(on) # <<<<<<<<<<<<<<
* if oN is not None: N = asInt(oN)
* # check block, local, and and global sizes
*/
__pyx_t_2 = (__pyx_v_on != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_on); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(16, 74, __pyx_L1_error)
__pyx_v_n = __pyx_t_3;
}
/* "petsc4py/PETSc/petscsys.pxi":75
* on = None; oN = size
* if on is not None: n = asInt(on)
* if oN is not None: N = asInt(oN) # <<<<<<<<<<<<<<
* # check block, local, and and global sizes
* if (bs < 1): raise ValueError(
*/
__pyx_t_1 = (__pyx_v_oN != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_oN); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(16, 75, __pyx_L1_error)
__pyx_v_N = __pyx_t_3;
}
/* "petsc4py/PETSc/petscsys.pxi":77
* if oN is not None: N = asInt(oN)
* # check block, local, and and global sizes
* if (bs < 1): raise ValueError( # <<<<<<<<<<<<<<
* "block size %d must be positive" % toInt(bs))
* if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError(
*/
__pyx_t_2 = ((__pyx_v_bs < 1) != 0);
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/petscsys.pxi":78
* # check block, local, and and global sizes
* if (bs < 1): raise ValueError(
* "block size %d must be positive" % toInt(bs)) # <<<<<<<<<<<<<<
* if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError(
* "local and global sizes cannot be both 'DECIDE'")
*/
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_9)) __PYX_ERR(16, 78, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_block_size_d_must_be_positive, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 78, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
/* "petsc4py/PETSc/petscsys.pxi":77
* if oN is not None: N = asInt(oN)
* # check block, local, and and global sizes
* if (bs < 1): raise ValueError( # <<<<<<<<<<<<<<
* "block size %d must be positive" % toInt(bs))
* if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError(
*/
__pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(16, 77, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__PYX_ERR(16, 77, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscsys.pxi":79
* if (bs < 1): raise ValueError(
* "block size %d must be positive" % toInt(bs))
* if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( # <<<<<<<<<<<<<<
* "local and global sizes cannot be both 'DECIDE'")
* if (n > 0) and (n % bs): raise ValueError(
*/
__pyx_t_1 = ((__pyx_v_n == PETSC_DECIDE) != 0);
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L19_bool_binop_done;
}
__pyx_t_1 = ((__pyx_v_N == PETSC_DECIDE) != 0);
__pyx_t_2 = __pyx_t_1;
__pyx_L19_bool_binop_done:;
if (unlikely(__pyx_t_2)) {
__pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(16, 79, __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(16, 79, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscsys.pxi":81
* if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError(
* "local and global sizes cannot be both 'DECIDE'")
* if (n > 0) and (n % bs): raise ValueError( # <<<<<<<<<<<<<<
* "local size %d not divisible by block size %d" %
* (toInt(n), toInt(bs)) )
*/
__pyx_t_1 = ((__pyx_v_n > 0) != 0);
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L22_bool_binop_done;
}
__pyx_t_1 = ((__pyx_v_n % __pyx_v_bs) != 0);
__pyx_t_2 = __pyx_t_1;
__pyx_L22_bool_binop_done:;
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/petscsys.pxi":83
* if (n > 0) and (n % bs): raise ValueError(
* "local size %d not divisible by block size %d" %
* (toInt(n), toInt(bs)) ) # <<<<<<<<<<<<<<
* if (N > 0) and (N % bs): raise ValueError(
* "global size %d not divisible by block size %d" %
*/
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(16, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(16, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
__pyx_t_9 = 0;
__pyx_t_7 = 0;
/* "petsc4py/PETSc/petscsys.pxi":82
* "local and global sizes cannot be both 'DECIDE'")
* if (n > 0) and (n % bs): raise ValueError(
* "local size %d not divisible by block size %d" % # <<<<<<<<<<<<<<
* (toInt(n), toInt(bs)) )
* if (N > 0) and (N % bs): raise ValueError(
*/
__pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_local_size_d_not_divisible_by_bl, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 82, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "petsc4py/PETSc/petscsys.pxi":81
* if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError(
* "local and global sizes cannot be both 'DECIDE'")
* if (n > 0) and (n % bs): raise ValueError( # <<<<<<<<<<<<<<
* "local size %d not divisible by block size %d" %
* (toInt(n), toInt(bs)) )
*/
__pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(16, 81, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(16, 81, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscsys.pxi":84
* "local size %d not divisible by block size %d" %
* (toInt(n), toInt(bs)) )
* if (N > 0) and (N % bs): raise ValueError( # <<<<<<<<<<<<<<
* "global size %d not divisible by block size %d" %
* (toInt(N), toInt(bs)) )
*/
__pyx_t_1 = ((__pyx_v_N > 0) != 0);
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L25_bool_binop_done;
}
__pyx_t_1 = ((__pyx_v_N % __pyx_v_bs) != 0);
__pyx_t_2 = __pyx_t_1;
__pyx_L25_bool_binop_done:;
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/petscsys.pxi":86
* if (N > 0) and (N % bs): raise ValueError(
* "global size %d not divisible by block size %d" %
* (toInt(N), toInt(bs)) ) # <<<<<<<<<<<<<<
* # return result to the caller
* if _b != NULL: _b[0] = b
*/
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_8)) __PYX_ERR(16, 86, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 86, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(16, 86, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
__pyx_t_8 = 0;
__pyx_t_7 = 0;
/* "petsc4py/PETSc/petscsys.pxi":85
* (toInt(n), toInt(bs)) )
* if (N > 0) and (N % bs): raise ValueError(
* "global size %d not divisible by block size %d" % # <<<<<<<<<<<<<<
* (toInt(N), toInt(bs)) )
* # return result to the caller
*/
__pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_global_size_d_not_divisible_by_b, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
/* "petsc4py/PETSc/petscsys.pxi":84
* "local size %d not divisible by block size %d" %
* (toInt(n), toInt(bs)) )
* if (N > 0) and (N % bs): raise ValueError( # <<<<<<<<<<<<<<
* "global size %d not divisible by block size %d" %
* (toInt(N), toInt(bs)) )
*/
__pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(16, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__PYX_ERR(16, 84, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscsys.pxi":88
* (toInt(N), toInt(bs)) )
* # return result to the caller
* if _b != NULL: _b[0] = b # <<<<<<<<<<<<<<
* if _n != NULL: _n[0] = n
* if _N != NULL: _N[0] = N
*/
__pyx_t_2 = ((__pyx_v__b != NULL) != 0);
if (__pyx_t_2) {
(__pyx_v__b[0]) = __pyx_v_b;
}
/* "petsc4py/PETSc/petscsys.pxi":89
* # return result to the caller
* if _b != NULL: _b[0] = b
* if _n != NULL: _n[0] = n # <<<<<<<<<<<<<<
* if _N != NULL: _N[0] = N
* return PETSC_SUCCESS
*/
__pyx_t_2 = ((__pyx_v__n != NULL) != 0);
if (__pyx_t_2) {
(__pyx_v__n[0]) = __pyx_v_n;
}
/* "petsc4py/PETSc/petscsys.pxi":90
* if _b != NULL: _b[0] = b
* if _n != NULL: _n[0] = n
* if _N != NULL: _N[0] = N # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_2 = ((__pyx_v__N != NULL) != 0);
if (__pyx_t_2) {
(__pyx_v__N[0]) = __pyx_v_N;
}
/* "petsc4py/PETSc/petscsys.pxi":91
* if _n != NULL: _n[0] = n
* if _N != NULL: _N[0] = N
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef inline PetscErrorCode Sys_Layout(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscsys.pxi":57
*
*
* cdef inline PetscErrorCode Sys_Sizes( # <<<<<<<<<<<<<<
* object size, object bsize,
* PetscInt *_b,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("petsc4py.PETSc.Sys_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_on);
__Pyx_XDECREF(__pyx_v_oN);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscsys.pxi":93
* return PETSC_SUCCESS
*
* cdef inline PetscErrorCode Sys_Layout( # <<<<<<<<<<<<<<
* MPI_Comm comm,
* PetscInt bs,
*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Sys_Layout(MPI_Comm __pyx_v_comm, PetscInt __pyx_v_bs, PetscInt *__pyx_v__n, PetscInt *__pyx_v__N) {
PetscInt __pyx_v_n;
PetscInt __pyx_v_N;
PetscErrorCode __pyx_r;
__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("Sys_Layout", 0);
/* "petsc4py/PETSc/petscsys.pxi":99
* PetscInt *_N,
* ) except PETSC_ERR_PYTHON:
* cdef PetscInt n = _n[0] # <<<<<<<<<<<<<<
* cdef PetscInt N = _N[0]
* if bs < 0: bs = 1
*/
__pyx_v_n = (__pyx_v__n[0]);
/* "petsc4py/PETSc/petscsys.pxi":100
* ) except PETSC_ERR_PYTHON:
* cdef PetscInt n = _n[0]
* cdef PetscInt N = _N[0] # <<<<<<<<<<<<<<
* if bs < 0: bs = 1
* if n > 0: n = n // bs
*/
__pyx_v_N = (__pyx_v__N[0]);
/* "petsc4py/PETSc/petscsys.pxi":101
* cdef PetscInt n = _n[0]
* cdef PetscInt N = _N[0]
* if bs < 0: bs = 1 # <<<<<<<<<<<<<<
* if n > 0: n = n // bs
* if N > 0: N = N // bs
*/
__pyx_t_1 = ((__pyx_v_bs < 0) != 0);
if (__pyx_t_1) {
__pyx_v_bs = 1;
}
/* "petsc4py/PETSc/petscsys.pxi":102
* cdef PetscInt N = _N[0]
* if bs < 0: bs = 1
* if n > 0: n = n // bs # <<<<<<<<<<<<<<
* if N > 0: N = N // bs
* CHKERR( PetscSplitOwnership(comm, &n, &N) )
*/
__pyx_t_1 = ((__pyx_v_n > 0) != 0);
if (__pyx_t_1) {
__pyx_v_n = (__pyx_v_n / __pyx_v_bs);
}
/* "petsc4py/PETSc/petscsys.pxi":103
* if bs < 0: bs = 1
* if n > 0: n = n // bs
* if N > 0: N = N // bs # <<<<<<<<<<<<<<
* CHKERR( PetscSplitOwnership(comm, &n, &N) )
* _n[0] = n * bs
*/
__pyx_t_1 = ((__pyx_v_N > 0) != 0);
if (__pyx_t_1) {
__pyx_v_N = (__pyx_v_N / __pyx_v_bs);
}
/* "petsc4py/PETSc/petscsys.pxi":104
* if n > 0: n = n // bs
* if N > 0: N = N // bs
* CHKERR( PetscSplitOwnership(comm, &n, &N) ) # <<<<<<<<<<<<<<
* _n[0] = n * bs
* _N[0] = N * bs
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSplitOwnership(__pyx_v_comm, (&__pyx_v_n), (&__pyx_v_N))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(16, 104, __pyx_L1_error)
/* "petsc4py/PETSc/petscsys.pxi":105
* if N > 0: N = N // bs
* CHKERR( PetscSplitOwnership(comm, &n, &N) )
* _n[0] = n * bs # <<<<<<<<<<<<<<
* _N[0] = N * bs
* return PETSC_SUCCESS
*/
(__pyx_v__n[0]) = (__pyx_v_n * __pyx_v_bs);
/* "petsc4py/PETSc/petscsys.pxi":106
* CHKERR( PetscSplitOwnership(comm, &n, &N) )
* _n[0] = n * bs
* _N[0] = N * bs # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*/
(__pyx_v__N[0]) = (__pyx_v_N * __pyx_v_bs);
/* "petsc4py/PETSc/petscsys.pxi":107
* _n[0] = n * bs
* _N[0] = N * bs
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscsys.pxi":93
* return PETSC_SUCCESS
*
* cdef inline PetscErrorCode Sys_Layout( # <<<<<<<<<<<<<<
* MPI_Comm comm,
* PetscInt bs,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Sys_Layout", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "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)
*/
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_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("event_args2objs", 0);
/* "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
*/
(__pyx_v_o[0]) = NULL;
(__pyx_v_o[1]) = NULL;
(__pyx_v_o[2]) = NULL;
(__pyx_v_o[3]) = NULL;
/* "petsc4py/PETSc/petsclog.pxi":62
* 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(17, 62, __pyx_L1_error)
__pyx_v_n = __pyx_t_1;
/* "petsc4py/PETSc/petsclog.pxi":63
* 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":64
* 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) != 0);
if (__pyx_t_2) {
__pyx_v_n = 4;
}
/* "petsc4py/PETSc/petsclog.pxi":65
* 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":66
* if n > 4: n = 4
* for 0 <= i < n:
* tmp = args[i] # <<<<<<<<<<<<<<
* if tmp is not None:
* o[i] = tmp.obj[0]
*/
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(17, 66, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(17, 66, __pyx_L1_error)
__Pyx_DECREF_SET(__pyx_v_tmp, ((struct PyPetscObjectObject *)__pyx_t_3));
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petsclog.pxi":67
* 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);
__pyx_t_4 = (__pyx_t_2 != 0);
if (__pyx_t_4) {
/* "petsc4py/PETSc/petsclog.pxi":68
* 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":67
* for 0 <= i < n:
* tmp = args[i]
* if tmp is not None: # <<<<<<<<<<<<<<
* o[i] = tmp.obj[0]
* return 0
*/
}
}
/* "petsc4py/PETSc/petsclog.pxi":69
* if tmp is not None:
* o[i] = tmp.obj[0]
* return 0 # <<<<<<<<<<<<<<
*/
__pyx_r = 0;
goto __pyx_L0;
/* "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)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.event_args2objs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tmp);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscobj.pxi":50
* # --------------------------------------------------------------------
*
* cdef inline PetscErrorCode PetscINCREF(PetscObject *obj) nogil: # <<<<<<<<<<<<<<
* if obj == NULL: return PETSC_SUCCESS
* if obj[0] == NULL: return PETSC_SUCCESS
*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscINCREF(PetscObject *__pyx_v_obj) {
PetscErrorCode __pyx_r;
int __pyx_t_1;
/* "petsc4py/PETSc/petscobj.pxi":51
*
* cdef inline PetscErrorCode PetscINCREF(PetscObject *obj) 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) != 0);
if (__pyx_t_1) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":52
* cdef inline PetscErrorCode PetscINCREF(PetscObject *obj) 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) != 0);
if (__pyx_t_1) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":53
* if obj == NULL: return PETSC_SUCCESS
* if obj[0] == NULL: return PETSC_SUCCESS
* return PetscObjectReference(obj[0]) # <<<<<<<<<<<<<<
*
* cdef inline PetscErrorCode PetscCLEAR(PetscObject* obj) nogil:
*/
__pyx_r = PetscObjectReference((__pyx_v_obj[0]));
goto __pyx_L0;
/* "petsc4py/PETSc/petscobj.pxi":50
* # --------------------------------------------------------------------
*
* cdef inline PetscErrorCode PetscINCREF(PetscObject *obj) nogil: # <<<<<<<<<<<<<<
* if obj == NULL: return PETSC_SUCCESS
* if obj[0] == NULL: return PETSC_SUCCESS
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "petsc4py/PETSc/petscobj.pxi":55
* return PetscObjectReference(obj[0])
*
* cdef inline PetscErrorCode PetscCLEAR(PetscObject* obj) nogil: # <<<<<<<<<<<<<<
* if obj == NULL: return PETSC_SUCCESS
* if obj[0] == NULL: return PETSC_SUCCESS
*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscCLEAR(PetscObject *__pyx_v_obj) {
PetscObject __pyx_v_tmp;
PetscErrorCode __pyx_r;
int __pyx_t_1;
/* "petsc4py/PETSc/petscobj.pxi":56
*
* cdef inline PetscErrorCode PetscCLEAR(PetscObject* obj) nogil:
* if obj == NULL: return PETSC_SUCCESS # <<<<<<<<<<<<<<
* if obj[0] == NULL: return PETSC_SUCCESS
* cdef PetscObject tmp
*/
__pyx_t_1 = ((__pyx_v_obj == NULL) != 0);
if (__pyx_t_1) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":57
* cdef inline PetscErrorCode PetscCLEAR(PetscObject* obj) 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) != 0);
if (__pyx_t_1) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":59
* if obj[0] == NULL: return PETSC_SUCCESS
* cdef PetscObject tmp
* tmp = obj[0]; obj[0] = NULL # <<<<<<<<<<<<<<
* return PetscObjectDestroy(&tmp)
*
*/
__pyx_v_tmp = (__pyx_v_obj[0]);
(__pyx_v_obj[0]) = NULL;
/* "petsc4py/PETSc/petscobj.pxi":60
* cdef PetscObject tmp
* tmp = obj[0]; obj[0] = NULL
* return PetscObjectDestroy(&tmp) # <<<<<<<<<<<<<<
*
* cdef inline PetscErrorCode PetscDEALLOC(PetscObject* obj) nogil:
*/
__pyx_r = PetscObjectDestroy((&__pyx_v_tmp));
goto __pyx_L0;
/* "petsc4py/PETSc/petscobj.pxi":55
* return PetscObjectReference(obj[0])
*
* cdef inline PetscErrorCode PetscCLEAR(PetscObject* obj) nogil: # <<<<<<<<<<<<<<
* if obj == NULL: return PETSC_SUCCESS
* if obj[0] == NULL: return PETSC_SUCCESS
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "petsc4py/PETSc/petscobj.pxi":62
* return PetscObjectDestroy(&tmp)
*
* cdef inline PetscErrorCode PetscDEALLOC(PetscObject* obj) nogil: # <<<<<<<<<<<<<<
* if obj == NULL: return PETSC_SUCCESS
* if obj[0] == NULL: return PETSC_SUCCESS
*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscDEALLOC(PetscObject *__pyx_v_obj) {
PetscObject __pyx_v_tmp;
PetscErrorCode __pyx_r;
int __pyx_t_1;
/* "petsc4py/PETSc/petscobj.pxi":63
*
* cdef inline PetscErrorCode PetscDEALLOC(PetscObject* obj) nogil:
* if obj == NULL: return PETSC_SUCCESS # <<<<<<<<<<<<<<
* if obj[0] == NULL: return PETSC_SUCCESS
* cdef PetscObject tmp
*/
__pyx_t_1 = ((__pyx_v_obj == NULL) != 0);
if (__pyx_t_1) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":64
* cdef inline PetscErrorCode PetscDEALLOC(PetscObject* obj) 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) != 0);
if (__pyx_t_1) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":66
* if obj[0] == NULL: return PETSC_SUCCESS
* cdef PetscObject tmp
* tmp = obj[0]; obj[0] = NULL # <<<<<<<<<<<<<<
* if not (<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":67
* 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)) != 0);
if (__pyx_t_1) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":68
* tmp = obj[0]; obj[0] = NULL
* if not (<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":69
* if not (<int>PetscInitializeCalled): return PETSC_SUCCESS
* if (<int>PetscFinalizeCalled): return PETSC_SUCCESS
* return PetscObjectDelayedDestroy(&tmp) # <<<<<<<<<<<<<<
*
* cdef inline PetscErrorCode PetscINCSTATE(PetscObject *obj) nogil:
*/
__pyx_r = PetscObjectDelayedDestroy((&__pyx_v_tmp));
goto __pyx_L0;
/* "petsc4py/PETSc/petscobj.pxi":62
* return PetscObjectDestroy(&tmp)
*
* cdef inline PetscErrorCode PetscDEALLOC(PetscObject* obj) nogil: # <<<<<<<<<<<<<<
* if obj == NULL: return PETSC_SUCCESS
* if obj[0] == NULL: return PETSC_SUCCESS
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "petsc4py/PETSc/petscobj.pxi":71
* return PetscObjectDelayedDestroy(&tmp)
*
* cdef inline PetscErrorCode PetscINCSTATE(PetscObject *obj) nogil: # <<<<<<<<<<<<<<
* if obj == NULL: return PETSC_SUCCESS
* if obj[0] == NULL: return PETSC_SUCCESS
*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscINCSTATE(PetscObject *__pyx_v_obj) {
PetscErrorCode __pyx_r;
int __pyx_t_1;
/* "petsc4py/PETSc/petscobj.pxi":72
*
* cdef inline PetscErrorCode PetscINCSTATE(PetscObject *obj) 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) != 0);
if (__pyx_t_1) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":73
* cdef inline PetscErrorCode PetscINCSTATE(PetscObject *obj) 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) != 0);
if (__pyx_t_1) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":74
* if obj == NULL: return PETSC_SUCCESS
* if obj[0] == NULL: return PETSC_SUCCESS
* return PetscObjectStateIncrease(obj[0]) # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__pyx_r = PetscObjectStateIncrease((__pyx_v_obj[0]));
goto __pyx_L0;
/* "petsc4py/PETSc/petscobj.pxi":71
* return PetscObjectDelayedDestroy(&tmp)
*
* cdef inline PetscErrorCode PetscINCSTATE(PetscObject *obj) nogil: # <<<<<<<<<<<<<<
* if obj == NULL: return PETSC_SUCCESS
* if obj[0] == NULL: return PETSC_SUCCESS
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "petsc4py/PETSc/petscobj.pxi":94
* PetscErrorCode (*python_destroy)(void*)
*
* cdef inline void Py_DecRef(PyObject *ob) with gil: # <<<<<<<<<<<<<<
* _Py_DecRef(ob)
*
*/
static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_Py_DecRef(PyObject *__pyx_v_ob) {
__Pyx_RefNannyDeclarations
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("Py_DecRef", 0);
/* "petsc4py/PETSc/petscobj.pxi":95
*
* cdef inline void Py_DecRef(PyObject *ob) with gil:
* _Py_DecRef(ob) # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode PetscDelPyDict(void* ptr) nogil:
*/
Py_DECREF(__pyx_v_ob);
/* "petsc4py/PETSc/petscobj.pxi":94
* PetscErrorCode (*python_destroy)(void*)
*
* cdef inline void Py_DecRef(PyObject *ob) with gil: # <<<<<<<<<<<<<<
* _Py_DecRef(ob)
*
*/
/* function exit code */
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
}
/* "petsc4py/PETSc/petscobj.pxi":97
* _Py_DecRef(ob)
*
* cdef PetscErrorCode PetscDelPyDict(void* ptr) 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":98
*
* cdef PetscErrorCode PetscDelPyDict(void* ptr) nogil:
* if ptr != NULL and Py_IsInitialized(): # <<<<<<<<<<<<<<
* Py_DecRef(<PyObject*>ptr)
* return PETSC_SUCCESS
*/
__pyx_t_2 = ((__pyx_v_ptr != NULL) != 0);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_2 = (Py_IsInitialized() != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscobj.pxi":99
* cdef PetscErrorCode PetscDelPyDict(void* ptr) 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":98
*
* cdef PetscErrorCode PetscDelPyDict(void* ptr) nogil:
* if ptr != NULL and Py_IsInitialized(): # <<<<<<<<<<<<<<
* Py_DecRef(<PyObject*>ptr)
* return PETSC_SUCCESS
*/
}
/* "petsc4py/PETSc/petscobj.pxi":100
* 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":97
* _Py_DecRef(ob)
*
* cdef PetscErrorCode PetscDelPyDict(void* ptr) nogil: # <<<<<<<<<<<<<<
* if ptr != NULL and Py_IsInitialized():
* Py_DecRef(<PyObject*>ptr)
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "petsc4py/PETSc/petscobj.pxi":102
* return PETSC_SUCCESS
*
* cdef object PetscGetPyDict(PetscObject obj, bint create): # <<<<<<<<<<<<<<
* if obj.python_context != NULL:
* return <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":103
*
* 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) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscobj.pxi":104
* 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":103
*
* cdef object PetscGetPyDict(PetscObject obj, bint create):
* if obj.python_context != NULL: # <<<<<<<<<<<<<<
* return <object>obj.python_context
* if create:
*/
}
/* "petsc4py/PETSc/petscobj.pxi":105
* if obj.python_context != NULL:
* return <object>obj.python_context
* if create: # <<<<<<<<<<<<<<
* obj.python_destroy = PetscDelPyDict
* obj.python_context = <void*>PyDict_New()
*/
__pyx_t_1 = (__pyx_v_create != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscobj.pxi":106
* 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":107
* 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 == ((PyObject *)NULL))) __PYX_ERR(18, 107, __pyx_L1_error)
__pyx_v_obj->python_context = ((void *)__pyx_t_2);
/* "petsc4py/PETSc/petscobj.pxi":108
* obj.python_destroy = PetscDelPyDict
* obj.python_context = <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":105
* 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":109
* obj.python_context = <void*>PyDict_New()
* return <object>obj.python_context
* return None # <<<<<<<<<<<<<<
*
* cdef object PetscGetPyObj(PetscObject o, char name[]):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
/* "petsc4py/PETSc/petscobj.pxi":102
* return PETSC_SUCCESS
*
* cdef object PetscGetPyDict(PetscObject obj, bint create): # <<<<<<<<<<<<<<
* if obj.python_context != NULL:
* return <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":111
* return None
*
* cdef object PetscGetPyObj(PetscObject o, char name[]): # <<<<<<<<<<<<<<
* cdef object dct = PetscGetPyDict(o, False)
* if dct is None: return None
*/
static 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;
int __pyx_t_3;
PyObject *__pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("PetscGetPyObj", 0);
/* "petsc4py/PETSc/petscobj.pxi":112
*
* cdef 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(18, 112, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_dct = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscobj.pxi":113
* cdef 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":114
* cdef object dct = PetscGetPyDict(o, False)
* if dct is None: return None
* cdef object key = bytes2str(name) # <<<<<<<<<<<<<<
* cdef PyObject *d = <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(18, 114, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_key = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscobj.pxi":115
* if dct is None: return None
* cdef object key = bytes2str(name)
* cdef PyObject *d = <PyObject*>dct # <<<<<<<<<<<<<<
* cdef PyObject *k = <PyObject*>key
* cdef PyObject *v = NULL
*/
__pyx_v_d = ((PyObject *)__pyx_v_dct);
/* "petsc4py/PETSc/petscobj.pxi":116
* cdef object key = bytes2str(name)
* cdef PyObject *d = <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":117
* 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":118
* cdef PyObject *k = <PyObject*>key
* cdef PyObject *v = NULL
* v = PyDict_GetItem(d, k) # <<<<<<<<<<<<<<
* if v != NULL: return <object>v
* return None
*/
__pyx_t_4 = PyDict_GetItem(__pyx_v_d, __pyx_v_k); if (unlikely(PyErr_Occurred())) __PYX_ERR(18, 118, __pyx_L1_error)
__pyx_v_v = __pyx_t_4;
/* "petsc4py/PETSc/petscobj.pxi":119
* cdef PyObject *v = NULL
* v = PyDict_GetItem(d, k)
* if v != NULL: return <object>v # <<<<<<<<<<<<<<
* return None
*
*/
__pyx_t_3 = ((__pyx_v_v != NULL) != 0);
if (__pyx_t_3) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_v));
__pyx_r = ((PyObject *)__pyx_v_v);
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":120
* v = PyDict_GetItem(d, k)
* if v != NULL: return <object>v
* return None # <<<<<<<<<<<<<<
*
* cdef object PetscSetPyObj(PetscObject o, char name[], object p):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
/* "petsc4py/PETSc/petscobj.pxi":111
* return None
*
* cdef object PetscGetPyObj(PetscObject o, char name[]): # <<<<<<<<<<<<<<
* cdef object dct = PetscGetPyDict(o, False)
* if dct is None: return None
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.PetscGetPyObj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dct);
__Pyx_XDECREF(__pyx_v_key);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscobj.pxi":122
* return None
*
* cdef object PetscSetPyObj(PetscObject o, char name[], object p): # <<<<<<<<<<<<<<
* cdef object dct
* if p is not None:
*/
static 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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("PetscSetPyObj", 0);
/* "petsc4py/PETSc/petscobj.pxi":124
* cdef 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscobj.pxi":125
* cdef object dct
* if p is not None:
* dct = PetscGetPyDict(o, True) # <<<<<<<<<<<<<<
* else:
* dct = PetscGetPyDict(o, False)
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PetscGetPyDict(__pyx_v_o, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 125, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_dct = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscobj.pxi":124
* cdef object PetscSetPyObj(PetscObject o, char name[], object p):
* cdef object dct
* if p is not None: # <<<<<<<<<<<<<<
* dct = PetscGetPyDict(o, True)
* else:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscobj.pxi":127
* dct = PetscGetPyDict(o, True)
* else:
* dct = PetscGetPyDict(o, False) # <<<<<<<<<<<<<<
* if dct is None: return None
* cdef str key = bytes2str(name)
*/
/*else*/ {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PetscGetPyDict(__pyx_v_o, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 127, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_dct = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscobj.pxi":128
* else:
* dct = PetscGetPyDict(o, False)
* if dct is None: return None # <<<<<<<<<<<<<<
* cdef str key = bytes2str(name)
* cdef PyObject *d = <PyObject*>dct
*/
__pyx_t_2 = (__pyx_v_dct == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
}
__pyx_L3:;
/* "petsc4py/PETSc/petscobj.pxi":129
* dct = PetscGetPyDict(o, False)
* if dct is None: return None
* cdef str key = bytes2str(name) # <<<<<<<<<<<<<<
* cdef PyObject *d = <PyObject*>dct
* cdef PyObject *k = <PyObject*>key
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(18, 129, __pyx_L1_error)
__pyx_v_key = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscobj.pxi":130
* 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":131
* 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":132
* 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":133
* 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_4 = PyDict_SetItem(__pyx_v_d, __pyx_v_k, __pyx_v_v); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(18, 133, __pyx_L1_error)
/* "petsc4py/PETSc/petscobj.pxi":134
* 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)) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscobj.pxi":135
* PyDict_SetItem(d, k, v)
* if v == <PyObject*>None:
* PyDict_DelItem(d, k) # <<<<<<<<<<<<<<
* return None
*
*/
__pyx_t_4 = PyDict_DelItem(__pyx_v_d, __pyx_v_k); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(18, 135, __pyx_L1_error)
/* "petsc4py/PETSc/petscobj.pxi":134
* cdef PyObject *v = <PyObject*>p
* PyDict_SetItem(d, k, v)
* if v == <PyObject*>None: # <<<<<<<<<<<<<<
* PyDict_DelItem(d, k)
* return None
*/
}
/* "petsc4py/PETSc/petscobj.pxi":136
* 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":122
* return None
*
* cdef 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_3);
__Pyx_AddTraceback("petsc4py.PETSc.PetscSetPyObj", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dct);
__Pyx_XDECREF(__pyx_v_key);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscobj.pxi":143
* object PyLong_FromVoidPtr(void*)
*
* cdef inline Py_intptr_t Object_toFortran(PetscObject o) nogil: # <<<<<<<<<<<<<<
* return <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":144
*
* 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":143
* 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":148
* # --------------------------------------------------------------------
*
* 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":149
*
* 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":150
* 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) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM));
__pyx_r = __pyx_ptype_8petsc4py_5PETSc_DM;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":152
* if obj == NULL: return DM
* # ---
* cdef PetscBool match = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( PetscObjectTypeCompare(obj, b"da", &match) )
* if match == PETSC_TRUE: return DMDA
*/
__pyx_v_match = PETSC_FALSE;
/* "petsc4py/PETSc/petscobj.pxi":153
* # ---
* cdef PetscBool match = PETSC_FALSE
* CHKERR( PetscObjectTypeCompare(obj, b"da", &match) ) # <<<<<<<<<<<<<<
* if match == PETSC_TRUE: return DMDA
* CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) )
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"da"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(18, 153, __pyx_L1_error)
/* "petsc4py/PETSc/petscobj.pxi":154
* cdef PetscBool match = PETSC_FALSE
* CHKERR( PetscObjectTypeCompare(obj, b"da", &match) )
* if match == PETSC_TRUE: return DMDA # <<<<<<<<<<<<<<
* CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) )
* if match == PETSC_TRUE: return DMPlex
*/
__pyx_t_1 = ((__pyx_v_match == PETSC_TRUE) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA));
__pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMDA;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":155
* CHKERR( PetscObjectTypeCompare(obj, b"da", &match) )
* if match == PETSC_TRUE: return DMDA
* CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) ) # <<<<<<<<<<<<<<
* if match == PETSC_TRUE: return DMPlex
* CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) )
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"plex"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(18, 155, __pyx_L1_error)
/* "petsc4py/PETSc/petscobj.pxi":156
* if match == PETSC_TRUE: return DMDA
* CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) )
* if match == PETSC_TRUE: return DMPlex # <<<<<<<<<<<<<<
* CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) )
* if match == PETSC_TRUE: return DMComposite
*/
__pyx_t_1 = ((__pyx_v_match == PETSC_TRUE) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMPlex));
__pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMPlex;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":157
* CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) )
* if match == PETSC_TRUE: return DMPlex
* CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) ) # <<<<<<<<<<<<<<
* if match == PETSC_TRUE: return DMComposite
* CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) )
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"composite"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(18, 157, __pyx_L1_error)
/* "petsc4py/PETSc/petscobj.pxi":158
* if match == PETSC_TRUE: return DMPlex
* CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) )
* if match == PETSC_TRUE: return DMComposite # <<<<<<<<<<<<<<
* CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) )
* if match == PETSC_TRUE: return DMShell
*/
__pyx_t_1 = ((__pyx_v_match == PETSC_TRUE) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMComposite));
__pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMComposite;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":159
* CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) )
* if match == PETSC_TRUE: return DMComposite
* CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) ) # <<<<<<<<<<<<<<
* if match == PETSC_TRUE: return DMShell
* CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) )
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"shell"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(18, 159, __pyx_L1_error)
/* "petsc4py/PETSc/petscobj.pxi":160
* if match == PETSC_TRUE: return DMComposite
* CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) )
* if match == PETSC_TRUE: return DMShell # <<<<<<<<<<<<<<
* CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) )
* if match == PETSC_TRUE: return DMStag
*/
__pyx_t_1 = ((__pyx_v_match == PETSC_TRUE) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMShell));
__pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMShell;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":161
* CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) )
* if match == PETSC_TRUE: return DMShell
* CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) ) # <<<<<<<<<<<<<<
* if match == PETSC_TRUE: return DMStag
* CHKERR( PetscObjectTypeCompare(obj, b"swarm", &match) )
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"stag"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(18, 161, __pyx_L1_error)
/* "petsc4py/PETSc/petscobj.pxi":162
* if match == PETSC_TRUE: return DMShell
* CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) )
* if match == PETSC_TRUE: return DMStag # <<<<<<<<<<<<<<
* CHKERR( PetscObjectTypeCompare(obj, b"swarm", &match) )
* if match == PETSC_TRUE: return DMSwarm
*/
__pyx_t_1 = ((__pyx_v_match == PETSC_TRUE) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMStag));
__pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMStag;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":163
* CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) )
* if match == PETSC_TRUE: return DMStag
* CHKERR( PetscObjectTypeCompare(obj, b"swarm", &match) ) # <<<<<<<<<<<<<<
* if match == PETSC_TRUE: return DMSwarm
* # ---
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"swarm"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(18, 163, __pyx_L1_error)
/* "petsc4py/PETSc/petscobj.pxi":164
* if match == PETSC_TRUE: return DMStag
* CHKERR( PetscObjectTypeCompare(obj, b"swarm", &match) )
* if match == PETSC_TRUE: return DMSwarm # <<<<<<<<<<<<<<
* # ---
* return DM
*/
__pyx_t_1 = ((__pyx_v_match == PETSC_TRUE) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMSwarm));
__pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMSwarm;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":166
* if match == PETSC_TRUE: return DMSwarm
* # ---
* return DM # <<<<<<<<<<<<<<
*
* cdef inline type subtype_Object(PetscObject obj):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM));
__pyx_r = __pyx_ptype_8petsc4py_5PETSc_DM;
goto __pyx_L0;
/* "petsc4py/PETSc/petscobj.pxi":148
* # --------------------------------------------------------------------
*
* cdef inline type subtype_DM(PetscDM dm): # <<<<<<<<<<<<<<
* cdef PetscObject obj = <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":168
* return DM
*
* cdef inline type subtype_Object(PetscObject obj): # <<<<<<<<<<<<<<
* cdef type klass = Object
* if obj == NULL: return klass
*/
static CYTHON_INLINE PyTypeObject *__pyx_f_8petsc4py_5PETSc_subtype_Object(PetscObject __pyx_v_obj) {
PyTypeObject *__pyx_v_klass = 0;
PetscClassId __pyx_v_classid;
PyTypeObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("subtype_Object", 0);
/* "petsc4py/PETSc/petscobj.pxi":169
*
* cdef inline type subtype_Object(PetscObject obj):
* cdef type klass = Object # <<<<<<<<<<<<<<
* if obj == NULL: return klass
* cdef PetscClassId classid = 0
*/
__Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object));
__pyx_v_klass = __pyx_ptype_8petsc4py_5PETSc_Object;
/* "petsc4py/PETSc/petscobj.pxi":170
* cdef inline type subtype_Object(PetscObject obj):
* cdef type klass = Object
* if obj == NULL: return klass # <<<<<<<<<<<<<<
* cdef PetscClassId classid = 0
* CHKERR( PetscObjectGetClassId(obj,&classid) )
*/
__pyx_t_1 = ((__pyx_v_obj == NULL) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_v_klass));
__pyx_r = __pyx_v_klass;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscobj.pxi":171
* cdef type klass = Object
* if obj == NULL: return klass
* cdef PetscClassId classid = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscObjectGetClassId(obj,&classid) )
* if classid == PETSC_DM_CLASSID:
*/
__pyx_v_classid = 0;
/* "petsc4py/PETSc/petscobj.pxi":172
* if obj == NULL: return klass
* cdef PetscClassId classid = 0
* CHKERR( PetscObjectGetClassId(obj,&classid) ) # <<<<<<<<<<<<<<
* if classid == PETSC_DM_CLASSID:
* klass = subtype_DM(<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(18, 172, __pyx_L1_error)
/* "petsc4py/PETSc/petscobj.pxi":173
* cdef PetscClassId classid = 0
* CHKERR( PetscObjectGetClassId(obj,&classid) )
* if classid == PETSC_DM_CLASSID: # <<<<<<<<<<<<<<
* klass = subtype_DM(<PetscDM>obj)
* else:
*/
__pyx_t_1 = ((__pyx_v_classid == DM_CLASSID) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscobj.pxi":174
* 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(18, 174, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_klass, ((PyTypeObject*)__pyx_t_3));
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscobj.pxi":173
* cdef PetscClassId classid = 0
* CHKERR( PetscObjectGetClassId(obj,&classid) )
* if classid == PETSC_DM_CLASSID: # <<<<<<<<<<<<<<
* klass = subtype_DM(<PetscDM>obj)
* else:
*/
goto __pyx_L4;
}
/* "petsc4py/PETSc/petscobj.pxi":176
* 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(18, 176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_klass, ((PyTypeObject*)__pyx_t_3));
__pyx_t_3 = 0;
}
__pyx_L4:;
/* "petsc4py/PETSc/petscobj.pxi":177
* else:
* klass = PyPetscType_Lookup(classid)
* return klass # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_v_klass));
__pyx_r = __pyx_v_klass;
goto __pyx_L0;
/* "petsc4py/PETSc/petscobj.pxi":168
* return DM
*
* cdef inline type subtype_Object(PetscObject obj): # <<<<<<<<<<<<<<
* cdef type klass = Object
* if obj == NULL: return klass
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.subtype_Object", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_klass);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscvwr.pxi":147
* # ---
*
* cdef inline PetscFileMode filemode(object mode) except <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;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PetscFileMode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("filemode", 0);
/* "petsc4py/PETSc/petscvwr.pxi":148
*
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscvwr.pxi":149
* 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":148
*
* 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":150
* if mode is None:
* return PETSC_FILE_MODE_READ
* if isinstance(mode, str): # <<<<<<<<<<<<<<
* if mode == 'r' : return PETSC_FILE_MODE_READ
* elif mode == 'w' : return PETSC_FILE_MODE_WRITE
*/
__pyx_t_2 = PyString_Check(__pyx_v_mode);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscvwr.pxi":151
* return PETSC_FILE_MODE_READ
* if isinstance(mode, str):
* if mode == 'r' : return PETSC_FILE_MODE_READ # <<<<<<<<<<<<<<
* elif mode == 'w' : return PETSC_FILE_MODE_WRITE
* elif mode == 'a' : return PETSC_FILE_MODE_APPEND
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(19, 151, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_r = FILE_MODE_READ;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscvwr.pxi":152
* if isinstance(mode, str):
* if mode == 'r' : return PETSC_FILE_MODE_READ
* elif mode == 'w' : return PETSC_FILE_MODE_WRITE # <<<<<<<<<<<<<<
* elif mode == 'a' : return PETSC_FILE_MODE_APPEND
* elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(19, 152, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_r = FILE_MODE_WRITE;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscvwr.pxi":153
* if mode == 'r' : return PETSC_FILE_MODE_READ
* elif mode == 'w' : return PETSC_FILE_MODE_WRITE
* elif mode == 'a' : return PETSC_FILE_MODE_APPEND # <<<<<<<<<<<<<<
* elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE
* elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_a, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(19, 153, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_r = FILE_MODE_APPEND;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscvwr.pxi":154
* elif mode == 'w' : return PETSC_FILE_MODE_WRITE
* elif mode == 'a' : return PETSC_FILE_MODE_APPEND
* elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE # <<<<<<<<<<<<<<
* elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE
* elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_kp_s_r_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(19, 154, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_r = FILE_MODE_UPDATE;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscvwr.pxi":155
* elif mode == 'a' : return PETSC_FILE_MODE_APPEND
* elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE
* elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE # <<<<<<<<<<<<<<
* elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE
* elif mode == 'u' : return PETSC_FILE_MODE_UPDATE
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_kp_s_w_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(19, 155, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_r = FILE_MODE_UPDATE;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscvwr.pxi":156
* elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE
* elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE
* elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE # <<<<<<<<<<<<<<
* elif mode == 'u' : return PETSC_FILE_MODE_UPDATE
* elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_kp_s_a_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(19, 156, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_r = FILE_MODE_APPEND_UPDATE;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscvwr.pxi":157
* elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE
* elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE
* elif mode == 'u' : return PETSC_FILE_MODE_UPDATE # <<<<<<<<<<<<<<
* elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE
* elif mode == 'ua' : return PETSC_FILE_MODE_APPEND_UPDATE
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_u, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(19, 157, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_r = FILE_MODE_UPDATE;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscvwr.pxi":158
* elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE
* elif mode == 'u' : return PETSC_FILE_MODE_UPDATE
* elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE # <<<<<<<<<<<<<<
* elif mode == 'ua' : return PETSC_FILE_MODE_APPEND_UPDATE
* return mode
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_au, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(19, 158, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_r = FILE_MODE_APPEND_UPDATE;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscvwr.pxi":159
* elif mode == 'u' : return PETSC_FILE_MODE_UPDATE
* elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE
* elif mode == 'ua' : return PETSC_FILE_MODE_APPEND_UPDATE # <<<<<<<<<<<<<<
* return mode
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_ua, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(19, 159, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_r = FILE_MODE_APPEND_UPDATE;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscvwr.pxi":150
* if mode is None:
* return PETSC_FILE_MODE_READ
* if isinstance(mode, str): # <<<<<<<<<<<<<<
* if mode == 'r' : return PETSC_FILE_MODE_READ
* elif mode == 'w' : return PETSC_FILE_MODE_WRITE
*/
}
/* "petsc4py/PETSc/petscvwr.pxi":160
* elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE
* elif mode == 'ua' : return PETSC_FILE_MODE_APPEND_UPDATE
* return mode # <<<<<<<<<<<<<<
*/
__pyx_t_3 = ((PetscFileMode)__Pyx_PyInt_As_PetscFileMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 160, __pyx_L1_error)
__pyx_r = __pyx_t_3;
goto __pyx_L0;
/* "petsc4py/PETSc/petscvwr.pxi":147
* # ---
*
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdevice.pxi":66
* PetscErrorCode PetscDeviceContextSetCurrentContext(PetscDeviceContext)
*
* 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;
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;
PetscDeviceType __pyx_t_9;
int __pyx_t_10;
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("asDeviceType", 0);
__Pyx_INCREF(__pyx_v_dtype);
/* "petsc4py/PETSc/petscdevice.pxi":67
*
* cdef inline PetscDeviceType asDeviceType(object dtype) except <PetscDeviceType>(-1):
* if isinstance(dtype, str): # <<<<<<<<<<<<<<
* dtype = dtype.upper()
* try:
*/
__pyx_t_1 = PyString_Check(__pyx_v_dtype);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscdevice.pxi":68
* cdef inline PetscDeviceType asDeviceType(object dtype) except <PetscDeviceType>(-1):
* if isinstance(dtype, str):
* dtype = dtype.upper() # <<<<<<<<<<<<<<
* try:
* return getattr(Device.Type, dtype)
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_upper); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 68, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 68, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscdevice.pxi":69
* if isinstance(dtype, str):
* dtype = dtype.upper()
* try: # <<<<<<<<<<<<<<
* return getattr(Device.Type, dtype)
* except AttributeError:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_8);
/*try:*/ {
/* "petsc4py/PETSc/petscdevice.pxi":70
* dtype = dtype.upper()
* try:
* return getattr(Device.Type, dtype) # <<<<<<<<<<<<<<
* except AttributeError:
* raise ValueError("unknown device type: %s" % dtype)
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Device), __pyx_n_s_Type); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 70, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_v_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 70, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_9 = ((PetscDeviceType)__Pyx_PyInt_As_PetscDeviceType(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 70, __pyx_L4_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_9;
goto __pyx_L8_try_return;
/* "petsc4py/PETSc/petscdevice.pxi":69
* if isinstance(dtype, str):
* dtype = dtype.upper()
* try: # <<<<<<<<<<<<<<
* return getattr(Device.Type, dtype)
* except AttributeError:
*/
}
__pyx_L4_error:;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscdevice.pxi":71
* try:
* return getattr(Device.Type, dtype)
* except AttributeError: # <<<<<<<<<<<<<<
* raise ValueError("unknown device type: %s" % dtype)
* return dtype
*/
__pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_t_10) {
__Pyx_AddTraceback("petsc4py.PETSc.asDeviceType", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_5) < 0) __PYX_ERR(5, 71, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_5);
/* "petsc4py/PETSc/petscdevice.pxi":72
* return getattr(Device.Type, dtype)
* except AttributeError:
* raise ValueError("unknown device type: %s" % dtype) # <<<<<<<<<<<<<<
* return dtype
*
*/
__pyx_t_11 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_device_type_s, __pyx_v_dtype); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 72, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_11);
__pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 72, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_Raise(__pyx_t_12, 0, 0, 0);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__PYX_ERR(5, 72, __pyx_L6_except_error)
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
/* "petsc4py/PETSc/petscdevice.pxi":69
* if isinstance(dtype, str):
* dtype = dtype.upper()
* try: # <<<<<<<<<<<<<<
* return getattr(Device.Type, dtype)
* except AttributeError:
*/
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
goto __pyx_L1_error;
__pyx_L8_try_return:;
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdevice.pxi":67
*
* cdef inline PetscDeviceType asDeviceType(object dtype) except <PetscDeviceType>(-1):
* if isinstance(dtype, str): # <<<<<<<<<<<<<<
* dtype = dtype.upper()
* try:
*/
}
/* "petsc4py/PETSc/petscdevice.pxi":73
* except AttributeError:
* raise ValueError("unknown device type: %s" % dtype)
* return dtype # <<<<<<<<<<<<<<
*
* cdef inline str toDeviceType(PetscDeviceType dtype):
*/
__pyx_t_9 = ((PetscDeviceType)__Pyx_PyInt_As_PetscDeviceType(__pyx_v_dtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 73, __pyx_L1_error)
__pyx_r = __pyx_t_9;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdevice.pxi":66
* PetscErrorCode PetscDeviceContextSetCurrentContext(PetscDeviceContext)
*
* cdef inline PetscDeviceType asDeviceType(object dtype) except <PetscDeviceType>(-1): # <<<<<<<<<<<<<<
* if isinstance(dtype, str):
* dtype = dtype.upper()
*/
/* 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_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_AddTraceback("petsc4py.PETSc.asDeviceType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = ((PetscDeviceType)-1L);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dtype);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdevice.pxi":75
* return dtype
*
* cdef inline str toDeviceType(PetscDeviceType dtype): # <<<<<<<<<<<<<<
* try:
* return Device.Type.__enum2str[dtype]
*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toDeviceType(PetscDeviceType __pyx_v_dtype) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("toDeviceType", 0);
/* "petsc4py/PETSc/petscdevice.pxi":76
*
* cdef inline str toDeviceType(PetscDeviceType dtype):
* try: # <<<<<<<<<<<<<<
* return Device.Type.__enum2str[dtype]
* except KeyError:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "petsc4py/PETSc/petscdevice.pxi":77
* cdef inline str toDeviceType(PetscDeviceType dtype):
* try:
* return Device.Type.__enum2str[dtype] # <<<<<<<<<<<<<<
* except KeyError:
* raise NotImplementedError("unhandled PetscDeviceType %d" % <int>dtype)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Device), __pyx_n_s_Type); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 77, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enum2str); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 77, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyInt_From_PetscDeviceType(__pyx_v_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 77, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 77, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(5, 77, __pyx_L3_error)
__pyx_r = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
goto __pyx_L7_try_return;
/* "petsc4py/PETSc/petscdevice.pxi":76
*
* cdef inline str toDeviceType(PetscDeviceType dtype):
* try: # <<<<<<<<<<<<<<
* return Device.Type.__enum2str[dtype]
* except KeyError:
*/
}
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdevice.pxi":78
* try:
* return Device.Type.__enum2str[dtype]
* except KeyError: # <<<<<<<<<<<<<<
* raise NotImplementedError("unhandled PetscDeviceType %d" % <int>dtype)
*
*/
__pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
if (__pyx_t_7) {
__Pyx_AddTraceback("petsc4py.PETSc.toDeviceType", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(5, 78, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_5);
/* "petsc4py/PETSc/petscdevice.pxi":79
* 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_8 = __Pyx_PyInt_From_int(((int)__pyx_v_dtype)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 79, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_unhandled_PetscDeviceType_d, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 79, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 79, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(5, 79, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
/* "petsc4py/PETSc/petscdevice.pxi":76
*
* cdef inline str toDeviceType(PetscDeviceType dtype):
* try: # <<<<<<<<<<<<<<
* return Device.Type.__enum2str[dtype]
* except KeyError:
*/
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
__pyx_L7_try_return:;
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdevice.pxi":75
* return dtype
*
* cdef inline str toDeviceType(PetscDeviceType dtype): # <<<<<<<<<<<<<<
* try:
* return Device.Type.__enum2str[dtype]
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("petsc4py.PETSc.toDeviceType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdevice.pxi":81
* raise NotImplementedError("unhandled PetscDeviceType %d" % <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;
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;
PetscStreamType __pyx_t_9;
int __pyx_t_10;
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("asStreamType", 0);
__Pyx_INCREF(__pyx_v_stype);
/* "petsc4py/PETSc/petscdevice.pxi":82
*
* cdef inline PetscStreamType asStreamType(object stype) except <PetscStreamType>(-1):
* if isinstance(stype, str): # <<<<<<<<<<<<<<
* stype = stype.upper()
* try:
*/
__pyx_t_1 = PyString_Check(__pyx_v_stype);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscdevice.pxi":83
* cdef inline PetscStreamType asStreamType(object stype) except <PetscStreamType>(-1):
* if isinstance(stype, str):
* stype = stype.upper() # <<<<<<<<<<<<<<
* try:
* return getattr(DeviceContext.StreamType, stype)
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stype, __pyx_n_s_upper); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_stype, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscdevice.pxi":84
* if isinstance(stype, str):
* stype = stype.upper()
* try: # <<<<<<<<<<<<<<
* return getattr(DeviceContext.StreamType, stype)
* except AttributeError:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_8);
/*try:*/ {
/* "petsc4py/PETSc/petscdevice.pxi":85
* stype = stype.upper()
* try:
* return getattr(DeviceContext.StreamType, stype) # <<<<<<<<<<<<<<
* except AttributeError:
* raise ValueError("unknown stream type: %s" % stype)
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext), __pyx_n_s_StreamType); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 85, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_v_stype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 85, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_9 = ((PetscStreamType)__Pyx_PyInt_As_PetscStreamType(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 85, __pyx_L4_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_9;
goto __pyx_L8_try_return;
/* "petsc4py/PETSc/petscdevice.pxi":84
* if isinstance(stype, str):
* stype = stype.upper()
* try: # <<<<<<<<<<<<<<
* return getattr(DeviceContext.StreamType, stype)
* except AttributeError:
*/
}
__pyx_L4_error:;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscdevice.pxi":86
* try:
* return getattr(DeviceContext.StreamType, stype)
* except AttributeError: # <<<<<<<<<<<<<<
* raise ValueError("unknown stream type: %s" % stype)
* return stype
*/
__pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_t_10) {
__Pyx_AddTraceback("petsc4py.PETSc.asStreamType", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_5) < 0) __PYX_ERR(5, 86, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_5);
/* "petsc4py/PETSc/petscdevice.pxi":87
* return getattr(DeviceContext.StreamType, stype)
* except AttributeError:
* raise ValueError("unknown stream type: %s" % stype) # <<<<<<<<<<<<<<
* return stype
*
*/
__pyx_t_11 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_stream_type_s, __pyx_v_stype); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 87, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_11);
__pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 87, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_Raise(__pyx_t_12, 0, 0, 0);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__PYX_ERR(5, 87, __pyx_L6_except_error)
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
/* "petsc4py/PETSc/petscdevice.pxi":84
* if isinstance(stype, str):
* stype = stype.upper()
* try: # <<<<<<<<<<<<<<
* return getattr(DeviceContext.StreamType, stype)
* except AttributeError:
*/
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
goto __pyx_L1_error;
__pyx_L8_try_return:;
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdevice.pxi":82
*
* cdef inline PetscStreamType asStreamType(object stype) except <PetscStreamType>(-1):
* if isinstance(stype, str): # <<<<<<<<<<<<<<
* stype = stype.upper()
* try:
*/
}
/* "petsc4py/PETSc/petscdevice.pxi":88
* except AttributeError:
* raise ValueError("unknown stream type: %s" % stype)
* return stype # <<<<<<<<<<<<<<
*
* cdef inline str toStreamType(PetscStreamType stype):
*/
__pyx_t_9 = ((PetscStreamType)__Pyx_PyInt_As_PetscStreamType(__pyx_v_stype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 88, __pyx_L1_error)
__pyx_r = __pyx_t_9;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdevice.pxi":81
* raise NotImplementedError("unhandled PetscDeviceType %d" % <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_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_AddTraceback("petsc4py.PETSc.asStreamType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = ((PetscStreamType)-1L);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_stype);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdevice.pxi":90
* return stype
*
* cdef inline str toStreamType(PetscStreamType stype): # <<<<<<<<<<<<<<
* try:
* return DeviceContext.StreamType.__enum2str[stype]
*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStreamType(PetscStreamType __pyx_v_stype) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("toStreamType", 0);
/* "petsc4py/PETSc/petscdevice.pxi":91
*
* cdef inline str toStreamType(PetscStreamType stype):
* try: # <<<<<<<<<<<<<<
* return DeviceContext.StreamType.__enum2str[stype]
* except KeyError:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "petsc4py/PETSc/petscdevice.pxi":92
* cdef inline str toStreamType(PetscStreamType stype):
* try:
* return DeviceContext.StreamType.__enum2str[stype] # <<<<<<<<<<<<<<
* except KeyError:
* raise NotImplementedError("unhandled PetscStreamType %d" % <int>stype)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext), __pyx_n_s_StreamType); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 92, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enum2str); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 92, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyInt_From_PetscStreamType(__pyx_v_stype); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 92, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 92, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(5, 92, __pyx_L3_error)
__pyx_r = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
goto __pyx_L7_try_return;
/* "petsc4py/PETSc/petscdevice.pxi":91
*
* cdef inline str toStreamType(PetscStreamType stype):
* try: # <<<<<<<<<<<<<<
* return DeviceContext.StreamType.__enum2str[stype]
* except KeyError:
*/
}
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdevice.pxi":93
* try:
* return DeviceContext.StreamType.__enum2str[stype]
* except KeyError: # <<<<<<<<<<<<<<
* raise NotImplementedError("unhandled PetscStreamType %d" % <int>stype)
*
*/
__pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
if (__pyx_t_7) {
__Pyx_AddTraceback("petsc4py.PETSc.toStreamType", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(5, 93, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_5);
/* "petsc4py/PETSc/petscdevice.pxi":94
* 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_8 = __Pyx_PyInt_From_int(((int)__pyx_v_stype)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 94, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_unhandled_PetscStreamType_d, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 94, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 94, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(5, 94, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
/* "petsc4py/PETSc/petscdevice.pxi":91
*
* cdef inline str toStreamType(PetscStreamType stype):
* try: # <<<<<<<<<<<<<<
* return DeviceContext.StreamType.__enum2str[stype]
* except KeyError:
*/
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
__pyx_L7_try_return:;
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdevice.pxi":90
* return stype
*
* cdef inline str toStreamType(PetscStreamType stype): # <<<<<<<<<<<<<<
* try:
* return DeviceContext.StreamType.__enum2str[stype]
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("petsc4py.PETSc.toStreamType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdevice.pxi":96
* raise NotImplementedError("unhandled PetscStreamType %d" % <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;
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;
PetscDeviceContextJoinMode __pyx_t_9;
int __pyx_t_10;
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("asJoinMode", 0);
__Pyx_INCREF(__pyx_v_jmode);
/* "petsc4py/PETSc/petscdevice.pxi":97
*
* cdef inline PetscDeviceContextJoinMode asJoinMode(object jmode) except <PetscDeviceContextJoinMode>(-1):
* if isinstance(jmode, str): # <<<<<<<<<<<<<<
* jmode = jmode.upper()
* try:
*/
__pyx_t_1 = PyString_Check(__pyx_v_jmode);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscdevice.pxi":98
* cdef inline PetscDeviceContextJoinMode asJoinMode(object jmode) except <PetscDeviceContextJoinMode>(-1):
* if isinstance(jmode, str):
* jmode = jmode.upper() # <<<<<<<<<<<<<<
* try:
* return getattr(DeviceContext.JoinMode, jmode)
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_jmode, __pyx_n_s_upper); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 98, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 98, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_jmode, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscdevice.pxi":99
* if isinstance(jmode, str):
* jmode = jmode.upper()
* try: # <<<<<<<<<<<<<<
* return getattr(DeviceContext.JoinMode, jmode)
* except AttributeError:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_8);
/*try:*/ {
/* "petsc4py/PETSc/petscdevice.pxi":100
* jmode = jmode.upper()
* try:
* return getattr(DeviceContext.JoinMode, jmode) # <<<<<<<<<<<<<<
* except AttributeError:
* raise ValueError("unknown join mode: %s" % jmode)
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext), __pyx_n_s_JoinMode); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 100, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_v_jmode); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 100, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_9 = ((PetscDeviceContextJoinMode)__Pyx_PyInt_As_PetscDeviceContextJoinMode(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 100, __pyx_L4_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_9;
goto __pyx_L8_try_return;
/* "petsc4py/PETSc/petscdevice.pxi":99
* if isinstance(jmode, str):
* jmode = jmode.upper()
* try: # <<<<<<<<<<<<<<
* return getattr(DeviceContext.JoinMode, jmode)
* except AttributeError:
*/
}
__pyx_L4_error:;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscdevice.pxi":101
* try:
* return getattr(DeviceContext.JoinMode, jmode)
* except AttributeError: # <<<<<<<<<<<<<<
* raise ValueError("unknown join mode: %s" % jmode)
* return jmode
*/
__pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_t_10) {
__Pyx_AddTraceback("petsc4py.PETSc.asJoinMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_5) < 0) __PYX_ERR(5, 101, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_5);
/* "petsc4py/PETSc/petscdevice.pxi":102
* return getattr(DeviceContext.JoinMode, jmode)
* except AttributeError:
* raise ValueError("unknown join mode: %s" % jmode) # <<<<<<<<<<<<<<
* return jmode
*
*/
__pyx_t_11 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_join_mode_s, __pyx_v_jmode); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 102, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_11);
__pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 102, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_Raise(__pyx_t_12, 0, 0, 0);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__PYX_ERR(5, 102, __pyx_L6_except_error)
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
/* "petsc4py/PETSc/petscdevice.pxi":99
* if isinstance(jmode, str):
* jmode = jmode.upper()
* try: # <<<<<<<<<<<<<<
* return getattr(DeviceContext.JoinMode, jmode)
* except AttributeError:
*/
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
goto __pyx_L1_error;
__pyx_L8_try_return:;
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdevice.pxi":97
*
* cdef inline PetscDeviceContextJoinMode asJoinMode(object jmode) except <PetscDeviceContextJoinMode>(-1):
* if isinstance(jmode, str): # <<<<<<<<<<<<<<
* jmode = jmode.upper()
* try:
*/
}
/* "petsc4py/PETSc/petscdevice.pxi":103
* except AttributeError:
* raise ValueError("unknown join mode: %s" % jmode)
* return jmode # <<<<<<<<<<<<<<
*
* cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode):
*/
__pyx_t_9 = ((PetscDeviceContextJoinMode)__Pyx_PyInt_As_PetscDeviceContextJoinMode(__pyx_v_jmode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 103, __pyx_L1_error)
__pyx_r = __pyx_t_9;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdevice.pxi":96
* raise NotImplementedError("unhandled PetscStreamType %d" % <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_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_AddTraceback("petsc4py.PETSc.asJoinMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = ((PetscDeviceContextJoinMode)-1L);
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_jmode);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdevice.pxi":105
* return jmode
*
* cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode): # <<<<<<<<<<<<<<
* try:
* return DeviceContext.JoinMode.__enum2str[jmode]
*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toJoinMode(PetscDeviceContextJoinMode __pyx_v_jmode) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("toJoinMode", 0);
/* "petsc4py/PETSc/petscdevice.pxi":106
*
* cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode):
* try: # <<<<<<<<<<<<<<
* return DeviceContext.JoinMode.__enum2str[jmode]
* except KeyError:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "petsc4py/PETSc/petscdevice.pxi":107
* cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode):
* try:
* return DeviceContext.JoinMode.__enum2str[jmode] # <<<<<<<<<<<<<<
* except KeyError:
* raise NotImplementedError("unhandled PetscDeviceContextJoinMode %d" % <int>jmode)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DeviceContext), __pyx_n_s_JoinMode); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 107, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enum2str); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 107, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyInt_From_PetscDeviceContextJoinMode(__pyx_v_jmode); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 107, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 107, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(5, 107, __pyx_L3_error)
__pyx_r = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
goto __pyx_L7_try_return;
/* "petsc4py/PETSc/petscdevice.pxi":106
*
* cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode):
* try: # <<<<<<<<<<<<<<
* return DeviceContext.JoinMode.__enum2str[jmode]
* except KeyError:
*/
}
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdevice.pxi":108
* try:
* return DeviceContext.JoinMode.__enum2str[jmode]
* except KeyError: # <<<<<<<<<<<<<<
* raise NotImplementedError("unhandled PetscDeviceContextJoinMode %d" % <int>jmode)
*/
__pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
if (__pyx_t_7) {
__Pyx_AddTraceback("petsc4py.PETSc.toJoinMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(5, 108, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_5);
/* "petsc4py/PETSc/petscdevice.pxi":109
* return DeviceContext.JoinMode.__enum2str[jmode]
* except KeyError:
* raise NotImplementedError("unhandled PetscDeviceContextJoinMode %d" % <int>jmode) # <<<<<<<<<<<<<<
*/
__pyx_t_8 = __Pyx_PyInt_From_int(((int)__pyx_v_jmode)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 109, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_unhandled_PetscDeviceContextJoin, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 109, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 109, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(5, 109, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
/* "petsc4py/PETSc/petscdevice.pxi":106
*
* cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode):
* try: # <<<<<<<<<<<<<<
* return DeviceContext.JoinMode.__enum2str[jmode]
* except KeyError:
*/
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
__pyx_L7_try_return:;
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdevice.pxi":105
* return jmode
*
* cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode): # <<<<<<<<<<<<<<
* try:
* return DeviceContext.JoinMode.__enum2str[jmode]
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("petsc4py.PETSc.toJoinMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscis.pxi":97
* # --------------------------------------------------------------------
*
* cdef inline IS ref_IS(PetscIS iset): # <<<<<<<<<<<<<<
* cdef IS ob = <IS> 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ref_IS", 0);
/* "petsc4py/PETSc/petscis.pxi":98
*
* cdef inline IS ref_IS(PetscIS iset):
* cdef IS ob = <IS> IS() # <<<<<<<<<<<<<<
* ob.iset = iset
* PetscINCREF(ob.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 98, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ob = ((struct PyPetscISObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscis.pxi":99
* cdef inline IS ref_IS(PetscIS iset):
* cdef IS ob = <IS> IS()
* ob.iset = iset # <<<<<<<<<<<<<<
* PetscINCREF(ob.obj)
* return ob
*/
__pyx_v_ob->iset = __pyx_v_iset;
/* "petsc4py/PETSc/petscis.pxi":100
* cdef IS ob = <IS> IS()
* ob.iset = iset
* PetscINCREF(ob.obj) # <<<<<<<<<<<<<<
* return ob
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj));
/* "petsc4py/PETSc/petscis.pxi":101
* ob.iset = iset
* PetscINCREF(ob.obj)
* return ob # <<<<<<<<<<<<<<
*
* cdef inline LGMap ref_LGMap(PetscLGMap lgm):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_v_ob));
__pyx_r = __pyx_v_ob;
goto __pyx_L0;
/* "petsc4py/PETSc/petscis.pxi":97
* # --------------------------------------------------------------------
*
* cdef inline IS ref_IS(PetscIS iset): # <<<<<<<<<<<<<<
* cdef IS ob = <IS> IS()
* ob.iset = iset
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.ref_IS", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ob);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscis.pxi":103
* return ob
*
* cdef inline LGMap ref_LGMap(PetscLGMap lgm): # <<<<<<<<<<<<<<
* cdef LGMap ob = <LGMap> 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ref_LGMap", 0);
/* "petsc4py/PETSc/petscis.pxi":104
*
* cdef inline LGMap ref_LGMap(PetscLGMap lgm):
* cdef LGMap ob = <LGMap> LGMap() # <<<<<<<<<<<<<<
* ob.lgm = lgm
* PetscINCREF(ob.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ob = ((struct PyPetscLGMapObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscis.pxi":105
* cdef inline LGMap ref_LGMap(PetscLGMap lgm):
* cdef LGMap ob = <LGMap> LGMap()
* ob.lgm = lgm # <<<<<<<<<<<<<<
* PetscINCREF(ob.obj)
* return ob
*/
__pyx_v_ob->lgm = __pyx_v_lgm;
/* "petsc4py/PETSc/petscis.pxi":106
* cdef LGMap ob = <LGMap> LGMap()
* ob.lgm = lgm
* PetscINCREF(ob.obj) # <<<<<<<<<<<<<<
* return ob
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj));
/* "petsc4py/PETSc/petscis.pxi":107
* ob.lgm = lgm
* PetscINCREF(ob.obj)
* return ob # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_v_ob));
__pyx_r = __pyx_v_ob;
goto __pyx_L0;
/* "petsc4py/PETSc/petscis.pxi":103
* return ob
*
* cdef inline LGMap ref_LGMap(PetscLGMap lgm): # <<<<<<<<<<<<<<
* cdef LGMap ob = <LGMap> LGMap()
* ob.lgm = lgm
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.ref_LGMap", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ob);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscis.pxi":118
* cdef bint hasarray
*
* def __cinit__(self, IS iset): # <<<<<<<<<<<<<<
* cdef PetscIS i = iset.iset
* CHKERR( PetscINCREF(<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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(6, 118, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_iset = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 118, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(6, 118, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer___cinit__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), __pyx_v_iset);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__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;
__Pyx_RefNannyDeclarations
IS __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/petscis.pxi":119
*
* 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":120
* 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(6, 120, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":121
* 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":122
* 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":123
* self.iset = i
* self.size = 0
* self.data = NULL # <<<<<<<<<<<<<<
* self.hasarray = 0
*
*/
__pyx_v_self->data = NULL;
/* "petsc4py/PETSc/petscis.pxi":124
* self.size = 0
* self.data = NULL
* self.hasarray = 0 # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
__pyx_v_self->hasarray = 0;
/* "petsc4py/PETSc/petscis.pxi":118
* cdef bint hasarray
*
* def __cinit__(self, IS iset): # <<<<<<<<<<<<<<
* cdef PetscIS i = iset.iset
* CHKERR( PetscINCREF(<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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscis.pxi":126
* self.hasarray = 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* if self.hasarray and self.iset != NULL:
* CHKERR( ISRestoreIndices(self.iset, &self.data) )
*/
/* Python wrapper */
static void __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__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) {
__Pyx_RefNannyDeclarations
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;
__Pyx_RefNannySetupContext("__dealloc__", 0);
/* "petsc4py/PETSc/petscis.pxi":127
*
* def __dealloc__(self):
* if self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<<
* CHKERR( ISRestoreIndices(self.iset, &self.data) )
* CHKERR( ISDestroy(&self.iset) )
*/
__pyx_t_2 = (__pyx_v_self->hasarray != 0);
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) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscis.pxi":128
* def __dealloc__(self):
* if self.hasarray and self.iset != NULL:
* CHKERR( ISRestoreIndices(self.iset, &self.data) ) # <<<<<<<<<<<<<<
* CHKERR( ISDestroy(&self.iset) )
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISRestoreIndices(__pyx_v_self->iset, (&__pyx_v_self->data))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 128, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":127
*
* def __dealloc__(self):
* if self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<<
* CHKERR( ISRestoreIndices(self.iset, &self.data) )
* CHKERR( ISDestroy(&self.iset) )
*/
}
/* "petsc4py/PETSc/petscis.pxi":129
* if self.hasarray and self.iset != NULL:
* CHKERR( ISRestoreIndices(self.iset, &self.data) )
* CHKERR( ISDestroy(&self.iset) ) # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDestroy((&__pyx_v_self->iset))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 129, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":126
* self.hasarray = 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* if self.hasarray and self.iset != NULL:
* CHKERR( ISRestoreIndices(self.iset, &self.data) )
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_WriteUnraisable("petsc4py.PETSc._IS_buffer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "petsc4py/PETSc/petscis.pxi":133
* #
*
* cdef int acquire(self) except -1: # <<<<<<<<<<<<<<
* if not self.hasarray and self.iset != NULL:
* CHKERR( ISGetLocalSize(self.iset, &self.size) )
*/
static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_acquire(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
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;
__Pyx_RefNannySetupContext("acquire", 0);
/* "petsc4py/PETSc/petscis.pxi":134
*
* cdef int acquire(self) except -1:
* if not self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<<
* CHKERR( ISGetLocalSize(self.iset, &self.size) )
* CHKERR( ISGetIndices(self.iset, &self.data) )
*/
__pyx_t_2 = ((!(__pyx_v_self->hasarray != 0)) != 0);
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) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscis.pxi":135
* cdef int acquire(self) except -1:
* if not self.hasarray and self.iset != NULL:
* CHKERR( ISGetLocalSize(self.iset, &self.size) ) # <<<<<<<<<<<<<<
* CHKERR( ISGetIndices(self.iset, &self.data) )
* self.hasarray = 1
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_self->size))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 135, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":136
* if not self.hasarray and self.iset != NULL:
* CHKERR( ISGetLocalSize(self.iset, &self.size) )
* CHKERR( ISGetIndices(self.iset, &self.data) ) # <<<<<<<<<<<<<<
* self.hasarray = 1
* return 0
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetIndices(__pyx_v_self->iset, (&__pyx_v_self->data))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 136, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":137
* CHKERR( ISGetLocalSize(self.iset, &self.size) )
* CHKERR( ISGetIndices(self.iset, &self.data) )
* self.hasarray = 1 # <<<<<<<<<<<<<<
* return 0
*
*/
__pyx_v_self->hasarray = 1;
/* "petsc4py/PETSc/petscis.pxi":134
*
* cdef int acquire(self) except -1:
* if not self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<<
* CHKERR( ISGetLocalSize(self.iset, &self.size) )
* CHKERR( ISGetIndices(self.iset, &self.data) )
*/
}
/* "petsc4py/PETSc/petscis.pxi":138
* CHKERR( ISGetIndices(self.iset, &self.data) )
* self.hasarray = 1
* return 0 # <<<<<<<<<<<<<<
*
* cdef int release(self) except -1:
*/
__pyx_r = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscis.pxi":133
* #
*
* cdef int acquire(self) except -1: # <<<<<<<<<<<<<<
* if not self.hasarray and self.iset != NULL:
* CHKERR( ISGetLocalSize(self.iset, &self.size) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscis.pxi":140
* return 0
*
* cdef int release(self) except -1: # <<<<<<<<<<<<<<
* if self.hasarray and self.iset != NULL:
* self.size = 0
*/
static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_release(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
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;
__Pyx_RefNannySetupContext("release", 0);
/* "petsc4py/PETSc/petscis.pxi":141
*
* cdef int release(self) except -1:
* if self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<<
* self.size = 0
* CHKERR( ISRestoreIndices(self.iset, &self.data) )
*/
__pyx_t_2 = (__pyx_v_self->hasarray != 0);
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) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscis.pxi":142
* cdef int release(self) except -1:
* if self.hasarray and self.iset != NULL:
* self.size = 0 # <<<<<<<<<<<<<<
* CHKERR( ISRestoreIndices(self.iset, &self.data) )
* self.hasarray = 0
*/
__pyx_v_self->size = 0;
/* "petsc4py/PETSc/petscis.pxi":143
* if self.hasarray and self.iset != NULL:
* self.size = 0
* CHKERR( ISRestoreIndices(self.iset, &self.data) ) # <<<<<<<<<<<<<<
* self.hasarray = 0
* self.data = NULL
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISRestoreIndices(__pyx_v_self->iset, (&__pyx_v_self->data))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 143, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":144
* self.size = 0
* CHKERR( ISRestoreIndices(self.iset, &self.data) )
* self.hasarray = 0 # <<<<<<<<<<<<<<
* self.data = NULL
* return 0
*/
__pyx_v_self->hasarray = 0;
/* "petsc4py/PETSc/petscis.pxi":145
* CHKERR( ISRestoreIndices(self.iset, &self.data) )
* self.hasarray = 0
* self.data = NULL # <<<<<<<<<<<<<<
* return 0
*
*/
__pyx_v_self->data = NULL;
/* "petsc4py/PETSc/petscis.pxi":141
*
* cdef int release(self) except -1:
* if self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<<
* self.size = 0
* CHKERR( ISRestoreIndices(self.iset, &self.data) )
*/
}
/* "petsc4py/PETSc/petscis.pxi":146
* self.hasarray = 0
* self.data = NULL
* return 0 # <<<<<<<<<<<<<<
*
* # buffer interface (PEP 3118)
*/
__pyx_r = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscis.pxi":140
* return 0
*
* cdef int release(self) except -1: # <<<<<<<<<<<<<<
* if self.hasarray and self.iset != NULL:
* self.size = 0
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.release", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscis.pxi":150
* # buffer interface (PEP 3118)
*
* cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: # <<<<<<<<<<<<<<
* self.acquire()
* PyPetscBuffer_FillInfo(view, <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":151
*
* 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(6, 151, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":152
* cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1:
* self.acquire()
* PyPetscBuffer_FillInfo(view, <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(6, 152, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":154
* 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":155
* c'i', 1, flags)
* view.obj = self
* return 0 # <<<<<<<<<<<<<<
*
* cdef int releasebuffer(self, Py_buffer *view) except -1:
*/
__pyx_r = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscis.pxi":150
* # buffer interface (PEP 3118)
*
* cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: # <<<<<<<<<<<<<<
* self.acquire()
* PyPetscBuffer_FillInfo(view, <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":157
* return 0
*
* cdef int releasebuffer(self, Py_buffer *view) except -1: # <<<<<<<<<<<<<<
* PyPetscBuffer_Release(view)
* self.release()
*/
static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_releasebuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("releasebuffer", 0);
/* "petsc4py/PETSc/petscis.pxi":158
*
* cdef int releasebuffer(self, Py_buffer *view) except -1:
* PyPetscBuffer_Release(view) # <<<<<<<<<<<<<<
* self.release()
* return 0
*/
PyPetscBuffer_Release(__pyx_v_view);
/* "petsc4py/PETSc/petscis.pxi":159
* cdef int releasebuffer(self, Py_buffer *view) except -1:
* PyPetscBuffer_Release(view)
* self.release() # <<<<<<<<<<<<<<
* return 0
*
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 159, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":160
* PyPetscBuffer_Release(view)
* self.release()
* return 0 # <<<<<<<<<<<<<<
*
* def __getbuffer__(self, Py_buffer *view, int flags):
*/
__pyx_r = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscis.pxi":157
* return 0
*
* cdef int releasebuffer(self, Py_buffer *view) except -1: # <<<<<<<<<<<<<<
* PyPetscBuffer_Release(view)
* self.release()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.releasebuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscis.pxi":162
* return 0
*
* def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<<
* self.acquirebuffer(view, flags)
*
*/
/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
__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 (__pyx_v_view == NULL) {
PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
return -1;
}
__Pyx_RefNannySetupContext("__getbuffer__", 0);
__pyx_v_view->obj = Py_None; __Pyx_INCREF(Py_None);
__Pyx_GIVEREF(__pyx_v_view->obj);
/* "petsc4py/PETSc/petscis.pxi":163
*
* def __getbuffer__(self, Py_buffer *view, int flags):
* self.acquirebuffer(view, flags) # <<<<<<<<<<<<<<
*
* def __releasebuffer__(self, Py_buffer *view):
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->acquirebuffer(__pyx_v_self, __pyx_v_view, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 163, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":162
* return 0
*
* def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<<
* self.acquirebuffer(view, flags)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
if (__pyx_v_view->obj != NULL) {
__Pyx_GOTREF(__pyx_v_view->obj);
__Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0;
}
goto __pyx_L2;
__pyx_L0:;
if (__pyx_v_view->obj == Py_None) {
__Pyx_GOTREF(__pyx_v_view->obj);
__Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0;
}
__pyx_L2:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscis.pxi":165
* self.acquirebuffer(view, flags)
*
* def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<<
* self.releasebuffer(view)
*
*/
/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view); /*proto*/
static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
__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) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__releasebuffer__", 0);
/* "petsc4py/PETSc/petscis.pxi":166
*
* def __releasebuffer__(self, Py_buffer *view):
* self.releasebuffer(view) # <<<<<<<<<<<<<<
*
* # 'with' statement (PEP 343)
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->releasebuffer(__pyx_v_self, __pyx_v_view); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 166, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":165
* self.acquirebuffer(view, flags)
*
* def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<<
* self.releasebuffer(view)
*
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_WriteUnraisable("petsc4py.PETSc._IS_buffer.__releasebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "petsc4py/PETSc/petscis.pxi":170
* # 'with' statement (PEP 343)
*
* cdef object enter(self): # <<<<<<<<<<<<<<
* self.acquire()
* return asarray(self)
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_10_IS_buffer_enter(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("enter", 0);
/* "petsc4py/PETSc/petscis.pxi":171
*
* cdef object enter(self):
* self.acquire() # <<<<<<<<<<<<<<
* return asarray(self)
*
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 171, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":172
* cdef object enter(self):
* self.acquire()
* return asarray(self) # <<<<<<<<<<<<<<
*
* cdef object exit(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscis.pxi":170
* # 'with' statement (PEP 343)
*
* cdef object enter(self): # <<<<<<<<<<<<<<
* self.acquire()
* return asarray(self)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.enter", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscis.pxi":174
* return asarray(self)
*
* cdef object exit(self): # <<<<<<<<<<<<<<
* self.release()
* return None
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_10_IS_buffer_exit(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("exit", 0);
/* "petsc4py/PETSc/petscis.pxi":175
*
* cdef object exit(self):
* self.release() # <<<<<<<<<<<<<<
* return None
*
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 175, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":176
* cdef object exit(self):
* self.release()
* return None # <<<<<<<<<<<<<<
*
* def __enter__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
/* "petsc4py/PETSc/petscis.pxi":174
* return asarray(self)
*
* cdef object exit(self): # <<<<<<<<<<<<<<
* self.release()
* return None
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.exit", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscis.pxi":178
* return None
*
* def __enter__(self): # <<<<<<<<<<<<<<
* return self.enter()
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_9__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_10_IS_buffer_8__enter__[] = "_IS_buffer.__enter__(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_9__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_8__enter__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_8__enter__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__enter__", 0);
/* "petsc4py/PETSc/petscis.pxi":179
*
* def __enter__(self):
* return self.enter() # <<<<<<<<<<<<<<
*
* def __exit__(self, *exc):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->enter(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 179, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscis.pxi":178
* return None
*
* def __enter__(self): # <<<<<<<<<<<<<<
* return self.enter()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscis.pxi":181
* return self.enter()
*
* def __exit__(self, *exc): # <<<<<<<<<<<<<<
* return self.exit()
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_10_IS_buffer_10__exit__[] = "_IS_buffer.__exit__(self, *exc)";
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;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_exc = __pyx_args;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_10__exit__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), __pyx_v_exc);
/* function exit code */
__Pyx_XDECREF(__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":182
*
* def __exit__(self, *exc):
* return self.exit() # <<<<<<<<<<<<<<
*
* # buffer interface (legacy)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->exit(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 182, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscis.pxi":181
* return self.enter()
*
* def __exit__(self, *exc): # <<<<<<<<<<<<<<
* return self.exit()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscis.pxi":186
* # buffer interface (legacy)
*
* cdef Py_ssize_t getbuffer(self, void **p) except -1: # <<<<<<<<<<<<<<
* cdef PetscInt n = 0
* if p != NULL:
*/
static Py_ssize_t __pyx_f_8petsc4py_5PETSc_10_IS_buffer_getbuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, void **__pyx_v_p) {
PetscInt __pyx_v_n;
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PetscInt __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getbuffer", 0);
/* "petsc4py/PETSc/petscis.pxi":187
*
* cdef Py_ssize_t getbuffer(self, void **p) except -1:
* cdef PetscInt n = 0 # <<<<<<<<<<<<<<
* if p != NULL:
* self.acquire()
*/
__pyx_v_n = 0;
/* "petsc4py/PETSc/petscis.pxi":188
* cdef Py_ssize_t getbuffer(self, void **p) except -1:
* cdef PetscInt n = 0
* if p != NULL: # <<<<<<<<<<<<<<
* self.acquire()
* p[0] = <void*>self.data
*/
__pyx_t_1 = ((__pyx_v_p != NULL) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscis.pxi":189
* cdef PetscInt n = 0
* if p != NULL:
* self.acquire() # <<<<<<<<<<<<<<
* p[0] = <void*>self.data
* n = self.size
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 189, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":190
* if p != NULL:
* self.acquire()
* p[0] = <void*>self.data # <<<<<<<<<<<<<<
* n = self.size
* elif self.iset != NULL:
*/
(__pyx_v_p[0]) = ((void *)__pyx_v_self->data);
/* "petsc4py/PETSc/petscis.pxi":191
* self.acquire()
* p[0] = <void*>self.data
* n = self.size # <<<<<<<<<<<<<<
* elif self.iset != NULL:
* CHKERR( ISGetLocalSize(self.iset, &n) )
*/
__pyx_t_3 = __pyx_v_self->size;
__pyx_v_n = __pyx_t_3;
/* "petsc4py/PETSc/petscis.pxi":188
* cdef Py_ssize_t getbuffer(self, void **p) except -1:
* cdef PetscInt n = 0
* if p != NULL: # <<<<<<<<<<<<<<
* self.acquire()
* p[0] = <void*>self.data
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscis.pxi":192
* p[0] = <void*>self.data
* n = self.size
* elif self.iset != NULL: # <<<<<<<<<<<<<<
* CHKERR( ISGetLocalSize(self.iset, &n) )
* return <Py_ssize_t>(<size_t>n*sizeof(PetscInt))
*/
__pyx_t_1 = ((__pyx_v_self->iset != NULL) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscis.pxi":193
* n = self.size
* elif self.iset != NULL:
* CHKERR( ISGetLocalSize(self.iset, &n) ) # <<<<<<<<<<<<<<
* return <Py_ssize_t>(<size_t>n*sizeof(PetscInt))
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_n))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 193, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":192
* p[0] = <void*>self.data
* n = self.size
* elif self.iset != NULL: # <<<<<<<<<<<<<<
* CHKERR( ISGetLocalSize(self.iset, &n) )
* return <Py_ssize_t>(<size_t>n*sizeof(PetscInt))
*/
}
__pyx_L3:;
/* "petsc4py/PETSc/petscis.pxi":194
* elif self.iset != NULL:
* CHKERR( ISGetLocalSize(self.iset, &n) )
* return <Py_ssize_t>(<size_t>n*sizeof(PetscInt)) # <<<<<<<<<<<<<<
*
* def __getsegcount__(self, Py_ssize_t *lenp):
*/
__pyx_r = ((Py_ssize_t)(((size_t)__pyx_v_n) * (sizeof(PetscInt))));
goto __pyx_L0;
/* "petsc4py/PETSc/petscis.pxi":186
* # buffer interface (legacy)
*
* cdef Py_ssize_t getbuffer(self, void **p) except -1: # <<<<<<<<<<<<<<
* cdef PetscInt n = 0
* if p != NULL:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.getbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1L;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscis.pxi":196
* return <Py_ssize_t>(<size_t>n*sizeof(PetscInt))
*
* def __getsegcount__(self, Py_ssize_t *lenp): # <<<<<<<<<<<<<<
* if lenp != NULL:
* lenp[0] = self.getbuffer(NULL)
*/
/* Python wrapper */
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_13__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_lenp); /*proto*/
static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_13__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_lenp) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getsegcount__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_12__getsegcount__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), ((Py_ssize_t *)__pyx_v_lenp));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_12__getsegcount__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_ssize_t *__pyx_v_lenp) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
Py_ssize_t __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getsegcount__", 0);
/* "petsc4py/PETSc/petscis.pxi":197
*
* def __getsegcount__(self, Py_ssize_t *lenp):
* if lenp != NULL: # <<<<<<<<<<<<<<
* lenp[0] = self.getbuffer(NULL)
* return 1
*/
__pyx_t_1 = ((__pyx_v_lenp != NULL) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscis.pxi":198
* def __getsegcount__(self, Py_ssize_t *lenp):
* if lenp != NULL:
* lenp[0] = self.getbuffer(NULL) # <<<<<<<<<<<<<<
* return 1
*
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->getbuffer(__pyx_v_self, NULL); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(6, 198, __pyx_L1_error)
(__pyx_v_lenp[0]) = __pyx_t_2;
/* "petsc4py/PETSc/petscis.pxi":197
*
* def __getsegcount__(self, Py_ssize_t *lenp):
* if lenp != NULL: # <<<<<<<<<<<<<<
* lenp[0] = self.getbuffer(NULL)
* return 1
*/
}
/* "petsc4py/PETSc/petscis.pxi":199
* if lenp != NULL:
* lenp[0] = self.getbuffer(NULL)
* return 1 # <<<<<<<<<<<<<<
*
* def __getreadbuffer__(self, Py_ssize_t idx, void **p):
*/
__pyx_r = 1;
goto __pyx_L0;
/* "petsc4py/PETSc/petscis.pxi":196
* return <Py_ssize_t>(<size_t>n*sizeof(PetscInt))
*
* def __getsegcount__(self, Py_ssize_t *lenp): # <<<<<<<<<<<<<<
* if lenp != NULL:
* lenp[0] = self.getbuffer(NULL)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__getsegcount__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
/* "petsc4py/PETSc/petscis.pxi":201
* return 1
*
* def __getreadbuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<<
* if idx != 0: raise SystemError(
* "accessing non-existent buffer segment")
*/
/* Python wrapper */
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_15__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /*proto*/
static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_15__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getreadbuffer__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_14__getreadbuffer__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), ((Py_ssize_t)__pyx_v_idx), ((void **)__pyx_v_p));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_14__getreadbuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getreadbuffer__", 0);
/* "petsc4py/PETSc/petscis.pxi":202
*
* def __getreadbuffer__(self, Py_ssize_t idx, void **p):
* if idx != 0: raise SystemError( # <<<<<<<<<<<<<<
* "accessing non-existent buffer segment")
* return self.getbuffer(p)
*/
__pyx_t_1 = ((__pyx_v_idx != 0) != 0);
if (unlikely(__pyx_t_1)) {
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(6, 202, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscis.pxi":204
* if idx != 0: raise SystemError(
* "accessing non-existent buffer segment")
* return self.getbuffer(p) # <<<<<<<<<<<<<<
*
* # NumPy array interface (legacy)
*/
__pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->getbuffer(__pyx_v_self, __pyx_v_p); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1L))) __PYX_ERR(6, 204, __pyx_L1_error)
__pyx_r = __pyx_t_3;
goto __pyx_L0;
/* "petsc4py/PETSc/petscis.pxi":201
* return 1
*
* def __getreadbuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<<
* if idx != 0: raise SystemError(
* "accessing non-existent buffer segment")
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__getreadbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
/* "petsc4py/PETSc/petscis.pxi":209
*
* property __array_interface__:
* def __get__(self): # <<<<<<<<<<<<<<
* cdef PetscInt n = 0
* if self.iset != NULL:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_19__array_interface___1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_19__array_interface___1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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":210
* property __array_interface__:
* def __get__(self):
* cdef PetscInt n = 0 # <<<<<<<<<<<<<<
* if self.iset != NULL:
* CHKERR( ISGetLocalSize(self.iset, &n) )
*/
__pyx_v_n = 0;
/* "petsc4py/PETSc/petscis.pxi":211
* def __get__(self):
* cdef PetscInt n = 0
* if self.iset != NULL: # <<<<<<<<<<<<<<
* CHKERR( ISGetLocalSize(self.iset, &n) )
* cdef object size = toInt(n)
*/
__pyx_t_1 = ((__pyx_v_self->iset != NULL) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscis.pxi":212
* cdef PetscInt n = 0
* if self.iset != NULL:
* CHKERR( ISGetLocalSize(self.iset, &n) ) # <<<<<<<<<<<<<<
* cdef object size = toInt(n)
* cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_n))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(6, 212, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":211
* def __get__(self):
* cdef PetscInt n = 0
* if self.iset != NULL: # <<<<<<<<<<<<<<
* CHKERR( ISGetLocalSize(self.iset, &n) )
* cdef object size = toInt(n)
*/
}
/* "petsc4py/PETSc/petscis.pxi":213
* if self.iset != NULL:
* CHKERR( ISGetLocalSize(self.iset, &n) )
* cdef object size = toInt(n) # <<<<<<<<<<<<<<
* cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT)
* cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize)
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_size = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscis.pxi":214
* CHKERR( ISGetLocalSize(self.iset, &n) )
* cdef object size = toInt(n)
* cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) # <<<<<<<<<<<<<<
* cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize)
* return dict(version=3,
*/
__pyx_t_3 = ((PyObject *)PyArray_DescrFromType(NPY_PETSC_INT)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 214, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscis.pxi":215
* cdef object size = toInt(n)
* cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT)
* cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) # <<<<<<<<<<<<<<
* return dict(version=3,
* data=self,
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_descr), __pyx_n_s_kind); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_descr), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_c_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_typestr = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscis.pxi":216
* cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT)
* cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize)
* return dict(version=3, # <<<<<<<<<<<<<<
* data=self,
* shape=(size,),
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_version, __pyx_int_3) < 0) __PYX_ERR(6, 216, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":217
* cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize)
* return dict(version=3,
* data=self, # <<<<<<<<<<<<<<
* shape=(size,),
* typestr=typestr)
*/
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_data, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(6, 216, __pyx_L1_error)
/* "petsc4py/PETSc/petscis.pxi":218
* return dict(version=3,
* data=self,
* shape=(size,), # <<<<<<<<<<<<<<
* typestr=typestr)
*
*/
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_size);
__Pyx_GIVEREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_size);
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(6, 216, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscis.pxi":219
* data=self,
* shape=(size,),
* typestr=typestr) # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_typestr, __pyx_v_typestr) < 0) __PYX_ERR(6, 216, __pyx_L1_error)
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscis.pxi":209
*
* property __array_interface__:
* def __get__(self): # <<<<<<<<<<<<<<
* cdef PetscInt n = 0
* if self.iset != NULL:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__array_interface__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_size);
__Pyx_XDECREF((PyObject *)__pyx_v_descr);
__Pyx_XDECREF(__pyx_v_typestr);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscvec.pxi":218
* # --------------------------------------------------------------------
*
* 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ref_Vec", 0);
/* "petsc4py/PETSc/petscvec.pxi":219
*
* cdef inline Vec ref_Vec(PetscVec vec):
* cdef Vec ob = <Vec> Vec() # <<<<<<<<<<<<<<
* ob.vec = vec
* PetscINCREF(ob.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ob = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscvec.pxi":220
* cdef inline Vec ref_Vec(PetscVec vec):
* cdef Vec ob = <Vec> Vec()
* ob.vec = vec # <<<<<<<<<<<<<<
* PetscINCREF(ob.obj)
* return ob
*/
__pyx_v_ob->vec = __pyx_v_vec;
/* "petsc4py/PETSc/petscvec.pxi":221
* cdef Vec ob = <Vec> Vec()
* ob.vec = vec
* PetscINCREF(ob.obj) # <<<<<<<<<<<<<<
* return ob
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj));
/* "petsc4py/PETSc/petscvec.pxi":222
* ob.vec = vec
* 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":218
* # --------------------------------------------------------------------
*
* 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":228
* # 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;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("vec_pos", 0);
/* "petsc4py/PETSc/petscvec.pxi":229
*
* cdef Vec vec_pos(Vec self):
* cdef Vec vec = type(self)() # <<<<<<<<<<<<<<
* CHKERR( VecDuplicate(self.vec, &vec.vec) )
* CHKERR( VecCopy(self.vec, vec.vec) )
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(7, 229, __pyx_L1_error)
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscvec.pxi":230
* cdef Vec vec_pos(Vec self):
* cdef Vec vec = type(self)()
* CHKERR( VecDuplicate(self.vec, &vec.vec) ) # <<<<<<<<<<<<<<
* CHKERR( VecCopy(self.vec, vec.vec) )
* return vec
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_self->vec, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 230, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":231
* cdef Vec vec = type(self)()
* CHKERR( VecDuplicate(self.vec, &vec.vec) )
* CHKERR( VecCopy(self.vec, vec.vec) ) # <<<<<<<<<<<<<<
* return vec
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCopy(__pyx_v_self->vec, __pyx_v_vec->vec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 231, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":232
* 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":228
* # 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":234
* 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":235
*
* 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(7, 235, __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":236
* 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(7, 236, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":237
* 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":234
* 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":239
* 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":240
*
* 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(7, 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_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(7, 241, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":242
* 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":239
* 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":246
* # 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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
PetscScalar __pyx_t_9;
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":247
*
* 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":249
* cdef PetscScalar alpha = 1
* cdef Vec vec
* if isinstance(other, Vec): # <<<<<<<<<<<<<<
* alpha = 1; vec = other
* CHKERR( VecAXPY(self.vec, alpha, vec.vec) )
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscvec.pxi":250
* cdef Vec vec
* if isinstance(other, Vec):
* alpha = 1; vec = other # <<<<<<<<<<<<<<
* CHKERR( VecAXPY(self.vec, alpha, vec.vec) )
* elif isinstance(other, tuple) or isinstance(other, list):
*/
__pyx_v_alpha = 1.0;
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(7, 250, __pyx_L1_error)
__pyx_t_3 = __pyx_v_other;
__Pyx_INCREF(__pyx_t_3);
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscvec.pxi":251
* if isinstance(other, Vec):
* alpha = 1; vec = other
* CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) # <<<<<<<<<<<<<<
* elif isinstance(other, tuple) or isinstance(other, list):
* other, vec = other
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_self->vec, __pyx_v_alpha, __pyx_v_vec->vec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 251, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":249
* 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":252
* alpha = 1; vec = other
* CHKERR( VecAXPY(self.vec, alpha, vec.vec) )
* elif isinstance(other, tuple) or isinstance(other, list): # <<<<<<<<<<<<<<
* other, vec = other
* alpha = asScalar(other)
*/
__pyx_t_1 = PyTuple_Check(__pyx_v_other);
__pyx_t_5 = (__pyx_t_1 != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_2 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_5 = PyList_Check(__pyx_v_other);
__pyx_t_1 = (__pyx_t_5 != 0);
__pyx_t_2 = __pyx_t_1;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscvec.pxi":253
* CHKERR( VecAXPY(self.vec, alpha, vec.vec) )
* elif isinstance(other, tuple) or isinstance(other, list):
* other, vec = other # <<<<<<<<<<<<<<
* alpha = asScalar(other)
* CHKERR( VecAXPY(self.vec, alpha, vec.vec) )
*/
if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) {
PyObject* sequence = __pyx_v_other;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(7, 253, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_3 = PyList_GET_ITEM(sequence, 0);
__pyx_t_6 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(7, 253, __pyx_L1_error)
__pyx_t_8 = 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_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(7, 253, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(7, 253, __pyx_L1_error)
__Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
__pyx_t_3 = 0;
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscvec.pxi":254
* elif isinstance(other, tuple) or isinstance(other, list):
* other, vec = other
* alpha = asScalar(other) # <<<<<<<<<<<<<<
* CHKERR( VecAXPY(self.vec, alpha, vec.vec) )
* else:
*/
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_9 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(7, 254, __pyx_L1_error)
__pyx_v_alpha = __pyx_t_9;
/* "petsc4py/PETSc/petscvec.pxi":255
* other, vec = other
* alpha = asScalar(other)
* CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) # <<<<<<<<<<<<<<
* else:
* alpha = asScalar(other)
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_self->vec, __pyx_v_alpha, __pyx_v_vec->vec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 255, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":252
* alpha = 1; vec = other
* CHKERR( VecAXPY(self.vec, alpha, vec.vec) )
* elif isinstance(other, tuple) or isinstance(other, list): # <<<<<<<<<<<<<<
* other, vec = other
* alpha = asScalar(other)
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscvec.pxi":257
* CHKERR( VecAXPY(self.vec, alpha, vec.vec) )
* else:
* alpha = asScalar(other) # <<<<<<<<<<<<<<
* CHKERR( VecShift(self.vec, alpha) )
* return self
*/
/*else*/ {
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_9 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(7, 257, __pyx_L1_error)
__pyx_v_alpha = __pyx_t_9;
/* "petsc4py/PETSc/petscvec.pxi":258
* else:
* alpha = asScalar(other)
* CHKERR( VecShift(self.vec, alpha) ) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecShift(__pyx_v_self->vec, __pyx_v_alpha)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 258, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/petscvec.pxi":259
* 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":246
* # 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_3);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__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":261
* 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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
PetscScalar __pyx_t_9;
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":262
*
* 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":264
* cdef PetscScalar alpha = 1
* cdef Vec vec
* if isinstance(other, Vec): # <<<<<<<<<<<<<<
* alpha = 1; vec = other
* CHKERR( VecAXPY(self.vec, -alpha, vec.vec) )
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscvec.pxi":265
* cdef Vec vec
* if isinstance(other, Vec):
* alpha = 1; vec = other # <<<<<<<<<<<<<<
* CHKERR( VecAXPY(self.vec, -alpha, vec.vec) )
* elif isinstance(other, tuple) or isinstance(other, list):
*/
__pyx_v_alpha = 1.0;
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(7, 265, __pyx_L1_error)
__pyx_t_3 = __pyx_v_other;
__Pyx_INCREF(__pyx_t_3);
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscvec.pxi":266
* if isinstance(other, Vec):
* alpha = 1; vec = other
* CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) # <<<<<<<<<<<<<<
* elif isinstance(other, tuple) or isinstance(other, list):
* other, vec = other
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_self->vec, (-__pyx_v_alpha), __pyx_v_vec->vec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 266, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":264
* 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":267
* alpha = 1; vec = other
* CHKERR( VecAXPY(self.vec, -alpha, vec.vec) )
* elif isinstance(other, tuple) or isinstance(other, list): # <<<<<<<<<<<<<<
* other, vec = other
* alpha = asScalar(other)
*/
__pyx_t_1 = PyTuple_Check(__pyx_v_other);
__pyx_t_5 = (__pyx_t_1 != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_2 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_5 = PyList_Check(__pyx_v_other);
__pyx_t_1 = (__pyx_t_5 != 0);
__pyx_t_2 = __pyx_t_1;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscvec.pxi":268
* CHKERR( VecAXPY(self.vec, -alpha, vec.vec) )
* elif isinstance(other, tuple) or isinstance(other, list):
* other, vec = other # <<<<<<<<<<<<<<
* alpha = asScalar(other)
* CHKERR( VecAXPY(self.vec, -alpha, vec.vec) )
*/
if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) {
PyObject* sequence = __pyx_v_other;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(7, 268, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_3 = PyList_GET_ITEM(sequence, 0);
__pyx_t_6 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(7, 268, __pyx_L1_error)
__pyx_t_8 = 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_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(7, 268, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(7, 268, __pyx_L1_error)
__Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
__pyx_t_3 = 0;
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscvec.pxi":269
* elif isinstance(other, tuple) or isinstance(other, list):
* other, vec = other
* alpha = asScalar(other) # <<<<<<<<<<<<<<
* CHKERR( VecAXPY(self.vec, -alpha, vec.vec) )
* else:
*/
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_9 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(7, 269, __pyx_L1_error)
__pyx_v_alpha = __pyx_t_9;
/* "petsc4py/PETSc/petscvec.pxi":270
* other, vec = other
* alpha = asScalar(other)
* CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) # <<<<<<<<<<<<<<
* else:
* alpha = asScalar(other)
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_self->vec, (-__pyx_v_alpha), __pyx_v_vec->vec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 270, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":267
* alpha = 1; vec = other
* CHKERR( VecAXPY(self.vec, -alpha, vec.vec) )
* elif isinstance(other, tuple) or isinstance(other, list): # <<<<<<<<<<<<<<
* other, vec = other
* alpha = asScalar(other)
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscvec.pxi":272
* CHKERR( VecAXPY(self.vec, -alpha, vec.vec) )
* else:
* alpha = asScalar(other) # <<<<<<<<<<<<<<
* CHKERR( VecShift(self.vec, -alpha) )
* return self
*/
/*else*/ {
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_9 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(7, 272, __pyx_L1_error)
__pyx_v_alpha = __pyx_t_9;
/* "petsc4py/PETSc/petscvec.pxi":273
* else:
* alpha = asScalar(other)
* CHKERR( VecShift(self.vec, -alpha) ) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecShift(__pyx_v_self->vec, (-__pyx_v_alpha))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 273, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/petscvec.pxi":274
* 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":261
* 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_3);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__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":276
* 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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
PetscScalar __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("vec_imul", 0);
/* "petsc4py/PETSc/petscvec.pxi":277
*
* 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":279
* cdef PetscScalar alpha = 1
* cdef Vec vec
* if isinstance(other, Vec): # <<<<<<<<<<<<<<
* vec = other
* CHKERR( VecPointwiseMult(self.vec, self.vec, vec.vec) )
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscvec.pxi":280
* cdef Vec vec
* if isinstance(other, Vec):
* vec = other # <<<<<<<<<<<<<<
* CHKERR( VecPointwiseMult(self.vec, self.vec, vec.vec) )
* else:
*/
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(7, 280, __pyx_L1_error)
__pyx_t_3 = __pyx_v_other;
__Pyx_INCREF(__pyx_t_3);
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscvec.pxi":281
* if isinstance(other, Vec):
* vec = other
* CHKERR( VecPointwiseMult(self.vec, self.vec, vec.vec) ) # <<<<<<<<<<<<<<
* else:
* alpha = asScalar(other)
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseMult(__pyx_v_self->vec, __pyx_v_self->vec, __pyx_v_vec->vec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 281, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":279
* 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":283
* CHKERR( VecPointwiseMult(self.vec, self.vec, vec.vec) )
* else:
* alpha = asScalar(other) # <<<<<<<<<<<<<<
* CHKERR( VecScale(self.vec, alpha) )
* return self
*/
/*else*/ {
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_5 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(7, 283, __pyx_L1_error)
__pyx_v_alpha = __pyx_t_5;
/* "petsc4py/PETSc/petscvec.pxi":284
* else:
* alpha = asScalar(other)
* CHKERR( VecScale(self.vec, alpha) ) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScale(__pyx_v_self->vec, __pyx_v_alpha)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 284, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/petscvec.pxi":285
* 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":276
* 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_3);
__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":287
* 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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
PetscScalar __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("vec_idiv", 0);
/* "petsc4py/PETSc/petscvec.pxi":288
*
* 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":289
* 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":291
* cdef PetscScalar alpha = 1
* cdef Vec vec
* if isinstance(other, Vec): # <<<<<<<<<<<<<<
* vec = other
* CHKERR( VecPointwiseDivide(self.vec, self.vec, vec.vec) )
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscvec.pxi":292
* cdef Vec vec
* if isinstance(other, Vec):
* vec = other # <<<<<<<<<<<<<<
* CHKERR( VecPointwiseDivide(self.vec, self.vec, vec.vec) )
* else:
*/
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(7, 292, __pyx_L1_error)
__pyx_t_3 = __pyx_v_other;
__Pyx_INCREF(__pyx_t_3);
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscvec.pxi":293
* if isinstance(other, Vec):
* vec = other
* CHKERR( VecPointwiseDivide(self.vec, self.vec, vec.vec) ) # <<<<<<<<<<<<<<
* else:
* alpha = asScalar(other)
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseDivide(__pyx_v_self->vec, __pyx_v_self->vec, __pyx_v_vec->vec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 293, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":291
* 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":295
* CHKERR( VecPointwiseDivide(self.vec, self.vec, vec.vec) )
* else:
* alpha = asScalar(other) # <<<<<<<<<<<<<<
* CHKERR( VecScale(self.vec, one/alpha) )
* return self
*/
/*else*/ {
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_5 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(7, 295, __pyx_L1_error)
__pyx_v_alpha = __pyx_t_5;
/* "petsc4py/PETSc/petscvec.pxi":296
* else:
* alpha = asScalar(other)
* CHKERR( VecScale(self.vec, one/alpha) ) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScale(__pyx_v_self->vec, (__pyx_v_one / __pyx_v_alpha))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 296, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/petscvec.pxi":297
* 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":287
* 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_3);
__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":301
* # 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":302
*
* cdef Vec vec_add(Vec self, other):
* return vec_iadd(vec_pos(self), other) # <<<<<<<<<<<<<<
*
* cdef Vec vec_sub(Vec self, other):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_iadd(((struct PyPetscVecObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 302, __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":301
* # 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":304
* 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":305
*
* cdef Vec vec_sub(Vec self, other):
* return vec_isub(vec_pos(self), other) # <<<<<<<<<<<<<<
*
* cdef Vec vec_mul(Vec self, other):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_isub(((struct PyPetscVecObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 305, __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":304
* 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":307
* 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":308
*
* cdef Vec vec_mul(Vec self, other):
* return vec_imul(vec_pos(self), other) # <<<<<<<<<<<<<<
*
* cdef Vec vec_div(Vec self, other):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 308, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_imul(((struct PyPetscVecObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 308, __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":307
* 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":310
* 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":311
*
* cdef Vec vec_div(Vec self, other):
* return vec_idiv(vec_pos(self), other) # <<<<<<<<<<<<<<
*
* # reflected binary operations
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_idiv(((struct PyPetscVecObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 311, __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":310
* 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":315
* # 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":316
*
* cdef Vec vec_radd(Vec self, other):
* return vec_add(self, other) # <<<<<<<<<<<<<<
*
* cdef Vec vec_rsub(Vec self, other):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_add(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 316, __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":315
* # 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":318
* 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":319
*
* 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(7, 319, __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":320
* 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(7, 320, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":321
* 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":318
* 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":323
* 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":324
*
* cdef Vec vec_rmul(Vec self, other):
* return vec_mul(self, other) # <<<<<<<<<<<<<<
*
* cdef Vec vec_rdiv(Vec self, other):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_mul(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 324, __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":323
* 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":326
* 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":327
*
* 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(7, 327, __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":328
* 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(7, 328, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":329
* 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":326
* 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":333
* # --------------------------------------------------------------------
*
* 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;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("Vec_Sizes", 0);
/* "petsc4py/PETSc/petscvec.pxi":335
* cdef inline int Vec_Sizes(object size, object bsize,
* PetscInt *b, PetscInt *n, PetscInt *N) except -1:
* Sys_Sizes(size, bsize, b, n, N) # <<<<<<<<<<<<<<
* return 0
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Sys_Sizes(__pyx_v_size, __pyx_v_bsize, __pyx_v_b, __pyx_v_n, __pyx_v_N); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 335, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":336
* 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":333
* # --------------------------------------------------------------------
*
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscvec.pxi":344
* 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;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
__Pyx_RefNannySetupContext("vecsetvalues_fcn", 0);
/* "petsc4py/PETSc/petscvec.pxi":345
*
* 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":346
* 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":347
* 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":348
* 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":349
* elif blocked: setvalues = VecSetValuesBlocked
* elif local: setvalues = VecSetValuesLocal
* else: setvalues = VecSetValues # <<<<<<<<<<<<<<
* return setvalues
*
*/
/*else*/ {
__pyx_v_setvalues = VecSetValues;
}
__pyx_L3:;
/* "petsc4py/PETSc/petscvec.pxi":350
* 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":344
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscvec.pxi":352
* return setvalues
*
* cdef inline int vecsetvalues(PetscVec V, # <<<<<<<<<<<<<<
* object oi, object ov, object oim,
* int blocked, int local) except -1:
*/
static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_vecsetvalues(Vec __pyx_v_V, PyObject *__pyx_v_oi, PyObject *__pyx_v_ov, PyObject *__pyx_v_oim, int __pyx_v_blocked, int __pyx_v_local) {
PetscInt __pyx_v_bs;
PetscInt __pyx_v_ni;
PetscInt __pyx_v_nv;
PetscInt *__pyx_v_i;
PetscScalar *__pyx_v_v;
CYTHON_UNUSED PyObject *__pyx_v_tmp1 = 0;
CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0;
__pyx_t_8petsc4py_5PETSc_VecSetValuesFcn *__pyx_v_setvalues;
InsertMode __pyx_v_addv;
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
InsertMode __pyx_t_7;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("vecsetvalues", 0);
/* "petsc4py/PETSc/petscvec.pxi":356
* 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":357
* # 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":358
* cdef PetscInt bs=1
* if blocked:
* CHKERR( VecGetBlockSize(V, &bs) ) # <<<<<<<<<<<<<<
* if bs < 1: bs = 1
* # indices and values
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetBlockSize(__pyx_v_V, (&__pyx_v_bs))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 358, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":359
* 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) != 0);
if (__pyx_t_1) {
__pyx_v_bs = 1;
}
/* "petsc4py/PETSc/petscvec.pxi":357
* # block size
* cdef PetscInt bs=1
* if blocked: # <<<<<<<<<<<<<<
* CHKERR( VecGetBlockSize(V, &bs) )
* if bs < 1: bs = 1
*/
}
/* "petsc4py/PETSc/petscvec.pxi":361
* 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":362
* # indices and values
* cdef PetscInt ni=0, nv=0
* cdef PetscInt *i=NULL # <<<<<<<<<<<<<<
* cdef PetscScalar *v=NULL
* cdef object tmp1 = iarray_i(oi, &ni, &i)
*/
__pyx_v_i = NULL;
/* "petsc4py/PETSc/petscvec.pxi":363
* cdef PetscInt ni=0, nv=0
* cdef PetscInt *i=NULL
* cdef PetscScalar *v=NULL # <<<<<<<<<<<<<<
* cdef object tmp1 = iarray_i(oi, &ni, &i)
* cdef object tmp2 = iarray_s(ov, &nv, &v)
*/
__pyx_v_v = NULL;
/* "petsc4py/PETSc/petscvec.pxi":364
* cdef PetscInt *i=NULL
* cdef PetscScalar *v=NULL
* cdef object tmp1 = iarray_i(oi, &ni, &i) # <<<<<<<<<<<<<<
* cdef object tmp2 = iarray_s(ov, &nv, &v)
* if ni*bs != nv: raise ValueError(
*/
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oi, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 364, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_tmp1 = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscvec.pxi":365
* cdef PetscScalar *v=NULL
* cdef object tmp1 = iarray_i(oi, &ni, &i)
* cdef object tmp2 = iarray_s(ov, &nv, &v) # <<<<<<<<<<<<<<
* if ni*bs != nv: raise ValueError(
* "incompatible array sizes: ni=%d, nv=%d, bs=%d" %
*/
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_ov, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_tmp2 = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscvec.pxi":366
* cdef object tmp1 = iarray_i(oi, &ni, &i)
* cdef object tmp2 = iarray_s(ov, &nv, &v)
* if ni*bs != nv: raise ValueError( # <<<<<<<<<<<<<<
* "incompatible array sizes: ni=%d, nv=%d, bs=%d" %
* (toInt(ni), toInt(nv), toInt(bs)) )
*/
__pyx_t_1 = (((__pyx_v_ni * __pyx_v_bs) != __pyx_v_nv) != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/petscvec.pxi":368
* if ni*bs != nv: raise ValueError(
* "incompatible array sizes: ni=%d, nv=%d, bs=%d" %
* (toInt(ni), toInt(nv), toInt(bs)) ) # <<<<<<<<<<<<<<
* # VecSetValuesXXX function and insert mode
* cdef VecSetValuesFcn *setvalues = vecsetvalues_fcn(blocked, local)
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 368, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 368, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 368, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 368, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscvec.pxi":367
* cdef object tmp2 = iarray_s(ov, &nv, &v)
* if ni*bs != nv: raise ValueError(
* "incompatible array sizes: ni=%d, nv=%d, bs=%d" % # <<<<<<<<<<<<<<
* (toInt(ni), toInt(nv), toInt(bs)) )
* # VecSetValuesXXX function and insert mode
*/
__pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_incompatible_array_sizes_ni_d_nv, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscvec.pxi":366
* cdef object tmp1 = iarray_i(oi, &ni, &i)
* cdef object tmp2 = iarray_s(ov, &nv, &v)
* if ni*bs != nv: raise ValueError( # <<<<<<<<<<<<<<
* "incompatible array sizes: ni=%d, nv=%d, bs=%d" %
* (toInt(ni), toInt(nv), toInt(bs)) )
*/
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 366, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__PYX_ERR(7, 366, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscvec.pxi":370
* (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_v_setvalues = __pyx_f_8petsc4py_5PETSc_vecsetvalues_fcn(__pyx_v_blocked, __pyx_v_local);
/* "petsc4py/PETSc/petscvec.pxi":371
* # 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_7 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oim); if (unlikely(__pyx_t_7 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(7, 371, __pyx_L1_error)
__pyx_v_addv = __pyx_t_7;
/* "petsc4py/PETSc/petscvec.pxi":373
* cdef PetscInsertMode addv = insertmode(oim)
* # actual call
* CHKERR( setvalues(V, ni, i, v, addv) ) # <<<<<<<<<<<<<<
* return 0
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_v_setvalues(__pyx_v_V, __pyx_v_ni, __pyx_v_i, __pyx_v_v, __pyx_v_addv)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 373, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":374
* # 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":352
* return setvalues
*
* cdef inline int vecsetvalues(PetscVec V, # <<<<<<<<<<<<<<
* object oi, object ov, object oim,
* int blocked, int local) except -1:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("petsc4py.PETSc.vecsetvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmp1);
__Pyx_XDECREF(__pyx_v_tmp2);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscvec.pxi":376
* 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;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PetscErrorCode __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("vecgetvalues", 0);
__Pyx_INCREF(__pyx_v_values);
/* "petsc4py/PETSc/petscvec.pxi":377
*
* 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":378
* 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":379
* 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":380
* cdef PetscInt *i=NULL
* cdef PetscScalar *v=NULL
* cdef object indices = iarray_i(oindices, &ni, &i) # <<<<<<<<<<<<<<
* if values is None:
* values = empty_s(ni)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oindices, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_indices = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscvec.pxi":381
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscvec.pxi":382
* cdef object indices = iarray_i(oindices, &ni, &i)
* if values is None:
* values = empty_s(ni) # <<<<<<<<<<<<<<
* values.shape = indices.shape
* values = oarray_s(values, &nv, &v)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_s(__pyx_v_ni)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 382, __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":383
* if values is None:
* values = empty_s(ni)
* values.shape = indices.shape # <<<<<<<<<<<<<<
* values = oarray_s(values, &nv, &v)
* if (ni != nv): raise ValueError(
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_indices, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 383, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_values, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(7, 383, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/petscvec.pxi":381
* 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":384
* values = empty_s(ni)
* values.shape = indices.shape
* values = oarray_s(values, &nv, &v) # <<<<<<<<<<<<<<
* if (ni != nv): raise ValueError(
* ("incompatible array sizes: "
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_values, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 384, __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":385
* 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_3 = ((__pyx_v_ni != __pyx_v_nv) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscvec.pxi":387
* if (ni != nv): raise ValueError(
* ("incompatible array sizes: "
* "ni=%d, nv=%d") % (toInt(ni), toInt(nv))) # <<<<<<<<<<<<<<
* CHKERR( VecGetValues(vec, ni, i, v) )
* return values
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
__pyx_t_1 = 0;
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_incompatible_array_sizes_ni_d_nv_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscvec.pxi":385
* 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_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(7, 385, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscvec.pxi":388
* ("incompatible array sizes: "
* "ni=%d, nv=%d") % (toInt(ni), toInt(nv)))
* CHKERR( VecGetValues(vec, ni, i, v) ) # <<<<<<<<<<<<<<
* return values
*
*/
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetValues(__pyx_v_vec, __pyx_v_ni, __pyx_v_i, __pyx_v_v)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 388, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":389
* "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":376
* 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_4);
__Pyx_XDECREF(__pyx_t_5);
__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":393
* # --------------------------------------------------------------------
*
* cdef inline _Vec_buffer vec_getbuffer_r(Vec self): # <<<<<<<<<<<<<<
* cdef _Vec_buffer buf = _Vec_buffer(self)
* buf.readonly = 1
*/
static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_f_8petsc4py_5PETSc_vec_getbuffer_r(struct PyPetscVecObject *__pyx_v_self) {
struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0;
struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("vec_getbuffer_r", 0);
/* "petsc4py/PETSc/petscvec.pxi":394
*
* cdef inline _Vec_buffer vec_getbuffer_r(Vec self):
* cdef _Vec_buffer buf = _Vec_buffer(self) # <<<<<<<<<<<<<<
* buf.readonly = 1
* return buf
*/
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 394, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscvec.pxi":395
* 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":396
* 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":393
* # --------------------------------------------------------------------
*
* cdef inline _Vec_buffer vec_getbuffer_r(Vec self): # <<<<<<<<<<<<<<
* cdef _Vec_buffer buf = _Vec_buffer(self)
* buf.readonly = 1
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.vec_getbuffer_r", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_buf);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscvec.pxi":398
* return buf
*
* cdef inline _Vec_buffer vec_getbuffer_w(Vec self): # <<<<<<<<<<<<<<
* cdef _Vec_buffer buf = _Vec_buffer(self)
* buf.readonly = 0
*/
static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_f_8petsc4py_5PETSc_vec_getbuffer_w(struct PyPetscVecObject *__pyx_v_self) {
struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0;
struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("vec_getbuffer_w", 0);
/* "petsc4py/PETSc/petscvec.pxi":399
*
* cdef inline _Vec_buffer vec_getbuffer_w(Vec self):
* cdef _Vec_buffer buf = _Vec_buffer(self) # <<<<<<<<<<<<<<
* buf.readonly = 0
* return buf
*/
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscvec.pxi":400
* 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":401
* 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":398
* return buf
*
* cdef inline _Vec_buffer vec_getbuffer_w(Vec self): # <<<<<<<<<<<<<<
* cdef _Vec_buffer buf = _Vec_buffer(self)
* buf.readonly = 0
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.vec_getbuffer_w", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_buf);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscvec.pxi":403
* 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":404
*
* cdef inline ndarray vec_getarray_r(Vec self):
* return asarray(vec_getbuffer_r(self)) # <<<<<<<<<<<<<<
*
* cdef inline ndarray vec_getarray_w(Vec self):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_getbuffer_r(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 404, __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":403
* 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":406
* 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":407
*
* cdef inline ndarray vec_getarray_w(Vec self):
* return asarray(vec_getbuffer_w(self)) # <<<<<<<<<<<<<<
*
* cdef inline int vec_setarray(Vec self, object o) except -1:
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_getbuffer_w(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 407, __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":406
* 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":409
* return asarray(vec_getbuffer_w(self))
*
* cdef inline int vec_setarray(Vec self, object o) except -1: # <<<<<<<<<<<<<<
* cdef PetscInt na=0, nv=0, i=0
* cdef PetscScalar *va=NULL, *vv=NULL
*/
static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_vec_setarray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_o) {
PetscInt __pyx_v_na;
PetscInt __pyx_v_nv;
PetscInt __pyx_v_i;
PetscScalar *__pyx_v_va;
PetscScalar *__pyx_v_vv;
PyArrayObject *__pyx_v_ary = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PetscInt __pyx_t_7;
int __pyx_t_8;
int __pyx_t_9;
char const *__pyx_t_10;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
PyObject *__pyx_t_14 = NULL;
PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("vec_setarray", 0);
/* "petsc4py/PETSc/petscvec.pxi":410
*
* 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":411
* 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":412
* cdef PetscInt na=0, nv=0, i=0
* cdef PetscScalar *va=NULL, *vv=NULL
* cdef ndarray ary = iarray_s(o, &na, &va) # <<<<<<<<<<<<<<
* CHKERR( VecGetLocalSize(self.vec, &nv) )
* if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError(
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_o, (&__pyx_v_na), (&__pyx_v_va))); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscvec.pxi":413
* cdef PetscScalar *va=NULL, *vv=NULL
* cdef ndarray ary = iarray_s(o, &na, &va)
* CHKERR( VecGetLocalSize(self.vec, &nv) ) # <<<<<<<<<<<<<<
* if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError(
* "array size %d incompatible with vector local size %d" %
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_nv))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 413, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":414
* 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) != 0);
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) != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L4_bool_binop_done:;
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscvec.pxi":416
* if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError(
* "array size %d incompatible with vector local size %d" %
* (toInt(na), toInt(nv)) ) # <<<<<<<<<<<<<<
* CHKERR( VecGetArray(self.vec, &vv) )
* try:
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
__pyx_t_1 = 0;
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscvec.pxi":415
* CHKERR( VecGetLocalSize(self.vec, &nv) )
* if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError(
* "array size %d incompatible with vector local size %d" % # <<<<<<<<<<<<<<
* (toInt(na), toInt(nv)) )
* CHKERR( VecGetArray(self.vec, &vv) )
*/
__pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_incompatible_with_v, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscvec.pxi":414
* cdef ndarray ary = iarray_s(o, &na, &va)
* CHKERR( VecGetLocalSize(self.vec, &nv) )
* if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError( # <<<<<<<<<<<<<<
* "array size %d incompatible with vector local size %d" %
* (toInt(na), toInt(nv)) )
*/
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 414, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__PYX_ERR(7, 414, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscvec.pxi":417
* "array size %d incompatible with vector local size %d" %
* (toInt(na), toInt(nv)) )
* CHKERR( VecGetArray(self.vec, &vv) ) # <<<<<<<<<<<<<<
* try:
* if PyArray_NDIM(ary) == 0:
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArray(__pyx_v_self->vec, (&__pyx_v_vv))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 417, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":418
* (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":419
* 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) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscvec.pxi":420
* try:
* if PyArray_NDIM(ary) == 0:
* for i from 0 <= i < nv: # <<<<<<<<<<<<<<
* vv[i] = va[0]
* else:
*/
__pyx_t_7 = __pyx_v_nv;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {
/* "petsc4py/PETSc/petscvec.pxi":421
* 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":419
* 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":423
* 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(7, 423, __pyx_L7_error)
}
__pyx_L9:;
}
/* "petsc4py/PETSc/petscvec.pxi":425
* 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(7, 425, __pyx_L1_error)
goto __pyx_L8;
}
__pyx_L7_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
__Pyx_XGOTREF(__pyx_t_11);
__Pyx_XGOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_t_13);
__Pyx_XGOTREF(__pyx_t_14);
__Pyx_XGOTREF(__pyx_t_15);
__Pyx_XGOTREF(__pyx_t_16);
__pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
{
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArray(__pyx_v_self->vec, (&__pyx_v_vv))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 425, __pyx_L13_error)
}
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_14);
__Pyx_XGIVEREF(__pyx_t_15);
__Pyx_XGIVEREF(__pyx_t_16);
__Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
}
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
__pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
__pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
goto __pyx_L1_error;
__pyx_L13_error:;
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_14);
__Pyx_XGIVEREF(__pyx_t_15);
__Pyx_XGIVEREF(__pyx_t_16);
__Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
}
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
goto __pyx_L1_error;
}
__pyx_L8:;
}
/* "petsc4py/PETSc/petscvec.pxi":426
* 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":409
* return asarray(vec_getbuffer_w(self))
*
* cdef inline int vec_setarray(Vec self, object o) except -1: # <<<<<<<<<<<<<<
* cdef PetscInt na=0, nv=0, i=0
* cdef PetscScalar *va=NULL, *vv=NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("petsc4py.PETSc.vec_setarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ary);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscvec.pxi":428
* 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;
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 *);
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":429
*
* 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":430
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscvec.pxi":431
* 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_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 431, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscvec.pxi":430
* 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":432
* 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_2 = PySlice_Check(__pyx_v_i);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscvec.pxi":433
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetSize(__pyx_v_self->vec, (&__pyx_v_N))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 433, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":434
* 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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_indices); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
__pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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(7, 434, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_5 = PyList_GET_ITEM(sequence, 0);
__pyx_t_6 = PyList_GET_ITEM(sequence, 1);
__pyx_t_7 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
#else
__pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
#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(7, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(7, 434, __pyx_L1_error)
__pyx_t_9 = NULL;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(7, 434, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_start = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_stop = __pyx_t_6;
__pyx_t_6 = 0;
__pyx_v_stride = __pyx_t_7;
__pyx_t_7 = 0;
/* "petsc4py/PETSc/petscvec.pxi":435
* 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_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_v_start, __pyx_v_stop, __pyx_v_stride)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_i, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscvec.pxi":432
* 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":436
* 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_3 = __pyx_f_8petsc4py_5PETSc_vecgetvalues(__pyx_v_self->vec, __pyx_v_i, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscvec.pxi":428
* 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_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_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":438
* 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;
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;
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":439
*
* 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":440
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscvec.pxi":441
* cdef PetscInt N=0
* if i is Ellipsis:
* return vec_setarray(self, v) # <<<<<<<<<<<<<<
* if isinstance(i, slice):
* CHKERR( VecGetSize(self.vec, &N) )
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_vec_setarray(__pyx_v_self, __pyx_v_v); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 441, __pyx_L1_error)
__pyx_r = __pyx_t_3;
goto __pyx_L0;
/* "petsc4py/PETSc/petscvec.pxi":440
* 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":442
* 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_2 = PySlice_Check(__pyx_v_i);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscvec.pxi":443
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetSize(__pyx_v_self->vec, (&__pyx_v_N))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 443, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":444
* if isinstance(i, slice):
* CHKERR( VecGetSize(self.vec, &N) )
* start, stop, stride = i.indices(toInt(N)) # <<<<<<<<<<<<<<
* i = arange(start, stop, stride)
* vecsetvalues(self.vec, i, v, None, 0, 0)
*/
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_indices); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
__pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
__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(7, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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 != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(7, 444, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_6 = PyList_GET_ITEM(sequence, 0);
__pyx_t_7 = PyList_GET_ITEM(sequence, 1);
__pyx_t_8 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
#else
__pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 444, __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(7, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
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_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L5_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_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_8);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(7, 444, __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(7, 444, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_start = __pyx_t_6;
__pyx_t_6 = 0;
__pyx_v_stop = __pyx_t_7;
__pyx_t_7 = 0;
__pyx_v_stride = __pyx_t_8;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/petscvec.pxi":445
* 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_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_v_start, __pyx_v_stop, __pyx_v_stride)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 445, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF_SET(__pyx_v_i, __pyx_t_5);
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscvec.pxi":442
* 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":446
* start, stop, stride = i.indices(toInt(N))
* i = arange(start, stop, stride)
* vecsetvalues(self.vec, i, v, None, 0, 0) # <<<<<<<<<<<<<<
* return 0
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_vecsetvalues(__pyx_v_self->vec, __pyx_v_i, __pyx_v_v, Py_None, 0, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 446, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":447
* 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":438
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("petsc4py.PETSc.vec_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":449
* 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;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PetscErrorCode __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)(PyObject *);
int64_t __pyx_t_11;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("vec_get_dlpack_ctx", 0);
/* "petsc4py/PETSc/petscvec.pxi":450
*
* cdef vec_get_dlpack_ctx(Vec self):
* cdef object ctx0 = self.get_attr('__dltensor_ctx__') # <<<<<<<<<<<<<<
* cdef PetscInt n = 0
* cdef int64_t ndim = 1
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 450, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ctx0 = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscvec.pxi":451
* 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":452
* 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":453
* 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":454
* 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":455
* 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":456
* 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":457
* 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":458
* cdef object s2 = None
* cdef PetscInt devId = 0
* cdef PetscMemType mtype = PETSC_MEMTYPE_HOST # <<<<<<<<<<<<<<
* if ctx0 is None: # First time in, create a linear memory view
* s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
*/
__pyx_v_mtype = PETSC_MEMTYPE_HOST;
/* "petsc4py/PETSc/petscvec.pxi":459
* cdef PetscInt devId = 0
* cdef PetscMemType mtype = PETSC_MEMTYPE_HOST
* if ctx0 is None: # First time in, create a linear memory view # <<<<<<<<<<<<<<
* s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
* s2 = oarray_p(empty_p(ndim), NULL, <void**>&strides_arr)
*/
__pyx_t_2 = (__pyx_v_ctx0 == Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscvec.pxi":460
* cdef PetscMemType mtype = PETSC_MEMTYPE_HOST
* if ctx0 is None: # First time in, create a linear memory view
* s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr) # <<<<<<<<<<<<<<
* s2 = oarray_p(empty_p(ndim), NULL, <void**>&strides_arr)
* CHKERR( VecGetLocalSize(self.vec, &n) )
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_shape_arr)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_s1, __pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscvec.pxi":461
* if ctx0 is None: # First time in, create a linear memory view
* s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
* s2 = oarray_p(empty_p(ndim), NULL, <void**>&strides_arr) # <<<<<<<<<<<<<<
* CHKERR( VecGetLocalSize(self.vec, &n) )
* shape_arr[0] = <int64_t>n
*/
__pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_4, NULL, ((void **)(&__pyx_v_strides_arr)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_s2, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscvec.pxi":462
* s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
* s2 = oarray_p(empty_p(ndim), NULL, <void**>&strides_arr)
* CHKERR( VecGetLocalSize(self.vec, &n) ) # <<<<<<<<<<<<<<
* shape_arr[0] = <int64_t>n
* strides_arr[0] = 1
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_n))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 462, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":463
* s2 = oarray_p(empty_p(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":464
* 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":459
* cdef PetscInt devId = 0
* cdef PetscMemType mtype = PETSC_MEMTYPE_HOST
* if ctx0 is None: # First time in, create a linear memory view # <<<<<<<<<<<<<<
* s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
* s2 = oarray_p(empty_p(ndim), NULL, <void**>&strides_arr)
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscvec.pxi":466
* strides_arr[0] = 1
* else:
* (_, _, ndim, s1, s2) = ctx0 # <<<<<<<<<<<<<<
*
* devType_ = { PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA, PETSC_MEMTYPE_HIP : kDLROCM }
*/
/*else*/ {
if ((likely(PyTuple_CheckExact(__pyx_v_ctx0))) || (PyList_CheckExact(__pyx_v_ctx0))) {
PyObject* sequence = __pyx_v_ctx0;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 5)) {
if (size > 5) __Pyx_RaiseTooManyValuesError(5);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(7, 466, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 3);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 4);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_4 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
__pyx_t_7 = PyList_GET_ITEM(sequence, 3);
__pyx_t_8 = PyList_GET_ITEM(sequence, 4);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
#else
{
Py_ssize_t i;
PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
for (i=0; i < 5; i++) {
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(7, 466, __pyx_L1_error)
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
}
#endif
} else {
Py_ssize_t index = -1;
PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
__pyx_t_9 = PyObject_GetIter(__pyx_v_ctx0); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 466, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
for (index=0; index < 5; index++) {
PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 5) < 0) __PYX_ERR(7, 466, __pyx_L1_error)
__pyx_t_10 = NULL;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L5_unpacking_done;
__pyx_L4_unpacking_failed:;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_10 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(7, 466, __pyx_L1_error)
__pyx_L5_unpacking_done:;
}
__pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_6); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 466, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v__ = __pyx_t_1;
__pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v__, __pyx_t_4);
__pyx_t_4 = 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_8);
__pyx_t_8 = 0;
}
__pyx_L3:;
/* "petsc4py/PETSc/petscvec.pxi":468
* (_, _, 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_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 468, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = __Pyx_PyInt_From_PetscMemType(PETSC_MEMTYPE_HOST); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 468, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 468, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (PyDict_SetItem(__pyx_t_8, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(7, 468, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyInt_From_PetscMemType(PETSC_MEMTYPE_CUDA); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 468, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCUDA); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 468, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (PyDict_SetItem(__pyx_t_8, __pyx_t_6, __pyx_t_7) < 0) __PYX_ERR(7, 468, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = __Pyx_PyInt_From_PetscMemType(PETSC_MEMTYPE_HIP); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 468, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLROCM); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 468, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (PyDict_SetItem(__pyx_t_8, __pyx_t_7, __pyx_t_6) < 0) __PYX_ERR(7, 468, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_devType_ = ((PyObject*)__pyx_t_8);
__pyx_t_8 = 0;
/* "petsc4py/PETSc/petscvec.pxi":469
*
* 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetCurrentMemType(__pyx_v_self->vec, (&__pyx_v_mtype))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 469, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":470
* 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_8 = __Pyx_PyInt_From_PetscMemType(__pyx_v_mtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyDict_GetItemDefault(__pyx_v_devType_, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_dtype = __pyx_t_7;
__pyx_t_7 = 0;
/* "petsc4py/PETSc/petscvec.pxi":471
* 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_7 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 471, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 471, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(7, 471, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscvec.pxi":472
* 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetDeviceId(((PetscObject)__pyx_v_self->vec), (&__pyx_v_devId))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 472, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":471
* 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":473
* 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_6 = __Pyx_PyInt_From_PetscInt(__pyx_v_devId); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_v_dtype);
__Pyx_GIVEREF(__pyx_v_dtype);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_dtype);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
__Pyx_INCREF(__pyx_v_s1);
__Pyx_GIVEREF(__pyx_v_s1);
PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_v_s1);
__Pyx_INCREF(__pyx_v_s2);
__Pyx_GIVEREF(__pyx_v_s2);
PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_v_s2);
__pyx_t_6 = 0;
__pyx_t_7 = 0;
__Pyx_DECREF_SET(__pyx_v_ctx0, __pyx_t_8);
__pyx_t_8 = 0;
/* "petsc4py/PETSc/petscvec.pxi":474
* CHKERR( PetscObjectGetDeviceId(<PetscObject>self.vec, &devId) )
* ctx0 = (dtype, devId, ndim, s1, s2)
* self.set_attr('__dltensor_ctx__', ctx0) # <<<<<<<<<<<<<<
* return ctx0
*
*/
__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_v_ctx0); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "petsc4py/PETSc/petscvec.pxi":475
* 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":449
* 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_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("petsc4py.PETSc.vec_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":479
* # --------------------------------------------------------------------
*
* cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1: # <<<<<<<<<<<<<<
* 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;
/* "petsc4py/PETSc/petscvec.pxi":480
*
* cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1:
* 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(7, 480, __pyx_L1_error)
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscvec.pxi":481
* cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1:
* 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(7, 481, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/petscvec.pxi":482
* 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) nogil except -1:
*/
__pyx_r = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscvec.pxi":479
* # --------------------------------------------------------------------
*
* cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1: # <<<<<<<<<<<<<<
* if ro: CHKERR( VecGetArrayRead(v, <const PetscScalar**>a) )
* else: CHKERR( VecGetArray(v, a) )
*/
/* function exit code */
__pyx_L1_error:;
{
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_AddTraceback("petsc4py.PETSc.Vec_AcquireArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
}
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
/* "petsc4py/PETSc/petscvec.pxi":484
* return 0
*
* cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1: # <<<<<<<<<<<<<<
* 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;
/* "petsc4py/PETSc/petscvec.pxi":485
*
* cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1:
* 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(7, 485, __pyx_L1_error)
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscvec.pxi":486
* cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1:
* 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(7, 486, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/petscvec.pxi":487
* 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":484
* return 0
*
* cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1: # <<<<<<<<<<<<<<
* if ro: CHKERR( VecRestoreArrayRead(v, <const PetscScalar**>a) )
* else: CHKERR( VecRestoreArray(v, a) )
*/
/* function exit code */
__pyx_L1_error:;
{
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_AddTraceback("petsc4py.PETSc.Vec_ReleaseArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
}
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
/* "petsc4py/PETSc/petscvec.pxi":497
* 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_readonly,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_readonly);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(7, 497, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
if (values[1]) {
__pyx_v_readonly = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_readonly == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 497, __pyx_L3_error)
} else {
__pyx_v_readonly = ((int)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 497, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(7, 497, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer___cinit__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), __pyx_v_vec, __pyx_v_readonly);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__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;
__Pyx_RefNannyDeclarations
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;
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/petscvec.pxi":498
*
* 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":499
* 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(7, 499, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":500
* 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":501
* 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":502
* 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":503
* self.size = 0
* self.data = NULL
* self.readonly = 1 if readonly else 0 # <<<<<<<<<<<<<<
* self.hasarray = 0
*
*/
if ((__pyx_v_readonly != 0)) {
__pyx_t_3 = 1;
} else {
__pyx_t_3 = 0;
}
__pyx_v_self->readonly = __pyx_t_3;
/* "petsc4py/PETSc/petscvec.pxi":504
* 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":497
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscvec.pxi":506
* 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) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__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) {
__Pyx_RefNannyDeclarations
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;
__Pyx_RefNannySetupContext("__dealloc__", 0);
/* "petsc4py/PETSc/petscvec.pxi":507
*
* def __dealloc__(self):
* if self.hasarray and self.vec != NULL: # <<<<<<<<<<<<<<
* Vec_ReleaseArray(self.vec, &self.data, self.readonly)
* CHKERR( VecDestroy(&self.vec) )
*/
__pyx_t_2 = (__pyx_v_self->hasarray != 0);
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) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscvec.pxi":508
* def __dealloc__(self):
* if self.hasarray and self.vec != NULL:
* Vec_ReleaseArray(self.vec, &self.data, self.readonly) # <<<<<<<<<<<<<<
* CHKERR( VecDestroy(&self.vec) )
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Vec_ReleaseArray(__pyx_v_self->vec, (&__pyx_v_self->data), __pyx_v_self->readonly); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 508, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":507
*
* 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":509
* if self.hasarray and self.vec != NULL:
* Vec_ReleaseArray(self.vec, &self.data, self.readonly)
* CHKERR( VecDestroy(&self.vec) ) # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_self->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 509, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":506
* 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:;
__Pyx_RefNannyFinishContext();
}
/* "petsc4py/PETSc/petscvec.pxi":513
* #
*
* cdef int acquire(self) nogil except -1: # <<<<<<<<<<<<<<
* 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;
/* "petsc4py/PETSc/petscvec.pxi":514
*
* cdef int acquire(self) nogil except -1:
* 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 != 0)) != 0);
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) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscvec.pxi":515
* cdef int acquire(self) nogil except -1:
* if not self.hasarray and self.vec != NULL:
* CHKERR( VecGetLocalSize(self.vec, &self.size) ) # <<<<<<<<<<<<<<
* Vec_AcquireArray(self.vec, &self.data, self.readonly)
* self.hasarray = 1
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_self->size))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 515, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":516
* if not self.hasarray and self.vec != NULL:
* CHKERR( VecGetLocalSize(self.vec, &self.size) )
* Vec_AcquireArray(self.vec, &self.data, self.readonly) # <<<<<<<<<<<<<<
* self.hasarray = 1
* return 0
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_Vec_AcquireArray(__pyx_v_self->vec, (&__pyx_v_self->data), __pyx_v_self->readonly); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(7, 516, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":517
* 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":514
*
* cdef int acquire(self) nogil except -1:
* 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":518
* Vec_AcquireArray(self.vec, &self.data, self.readonly)
* self.hasarray = 1
* return 0 # <<<<<<<<<<<<<<
*
* cdef int release(self) nogil except -1:
*/
__pyx_r = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscvec.pxi":513
* #
*
* cdef int acquire(self) nogil except -1: # <<<<<<<<<<<<<<
* if not self.hasarray and self.vec != NULL:
* CHKERR( VecGetLocalSize(self.vec, &self.size) )
*/
/* function exit code */
__pyx_L1_error:;
{
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename);
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
}
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
/* "petsc4py/PETSc/petscvec.pxi":520
* return 0
*
* cdef int release(self) nogil except -1: # <<<<<<<<<<<<<<
* 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;
/* "petsc4py/PETSc/petscvec.pxi":521
*
* cdef int release(self) nogil except -1:
* if self.hasarray and self.vec != NULL: # <<<<<<<<<<<<<<
* self.size = 0
* Vec_ReleaseArray(self.vec, &self.data, self.readonly)
*/
__pyx_t_2 = (__pyx_v_self->hasarray != 0);
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) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscvec.pxi":522
* cdef int release(self) nogil except -1:
* 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":523
* if self.hasarray and self.vec != NULL:
* self.size = 0
* Vec_ReleaseArray(self.vec, &self.data, self.readonly) # <<<<<<<<<<<<<<
* self.hasarray = 0
* return 0
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Vec_ReleaseArray(__pyx_v_self->vec, (&__pyx_v_self->data), __pyx_v_self->readonly); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 523, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":524
* 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":521
*
* cdef int release(self) nogil except -1:
* if self.hasarray and self.vec != NULL: # <<<<<<<<<<<<<<
* self.size = 0
* Vec_ReleaseArray(self.vec, &self.data, self.readonly)
*/
}
/* "petsc4py/PETSc/petscvec.pxi":525
* 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":520
* return 0
*
* cdef int release(self) nogil except -1: # <<<<<<<<<<<<<<
* if self.hasarray and self.vec != NULL:
* self.size = 0
*/
/* function exit code */
__pyx_L1_error:;
{
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.release", __pyx_clineno, __pyx_lineno, __pyx_filename);
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
}
__pyx_r = -1;
__pyx_L0:;
return __pyx_r;
}
/* "petsc4py/PETSc/petscvec.pxi":529
* # 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":530
*
* 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(7, 530, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":531
* 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(7, 531, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":533
* 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":534
* 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":529
* # 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":536
* 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;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("releasebuffer", 0);
/* "petsc4py/PETSc/petscvec.pxi":537
*
* 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":538
* cdef int releasebuffer(self, Py_buffer *view) except -1:
* PyPetscBuffer_Release(view)
* self.release() # <<<<<<<<<<<<<<
* return 0
*
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 538, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":539
* 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":536
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscvec.pxi":541
* return 0
*
* def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<<
* self.acquirebuffer(view, flags)
*
*/
/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
__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 (__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":542
*
* def __getbuffer__(self, Py_buffer *view, int flags):
* self.acquirebuffer(view, flags) # <<<<<<<<<<<<<<
*
* def __releasebuffer__(self, Py_buffer *view):
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->acquirebuffer(__pyx_v_self, __pyx_v_view, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 542, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":541
* 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":544
* self.acquirebuffer(view, flags)
*
* def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<<
* self.releasebuffer(view)
*
*/
/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view); /*proto*/
static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
__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) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__releasebuffer__", 0);
/* "petsc4py/PETSc/petscvec.pxi":545
*
* def __releasebuffer__(self, Py_buffer *view):
* self.releasebuffer(view) # <<<<<<<<<<<<<<
*
* # 'with' statement (PEP 343)
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->releasebuffer(__pyx_v_self, __pyx_v_view); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 545, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":544
* 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:;
__Pyx_RefNannyFinishContext();
}
/* "petsc4py/PETSc/petscvec.pxi":549
* # '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":550
*
* cdef object enter(self):
* self.acquire() # <<<<<<<<<<<<<<
* return asarray(self)
*
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 550, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":551
* cdef object enter(self):
* self.acquire()
* return asarray(self) # <<<<<<<<<<<<<<
*
* cdef object exit(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 551, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscvec.pxi":549
* # '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":553
* 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":554
*
* cdef object exit(self):
* self.release() # <<<<<<<<<<<<<<
* return None
*
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 554, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":555
* 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":553
* 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":557
* 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_11_Vec_buffer_8__enter__[] = "_Vec_buffer.__enter__(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_9__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_8__enter__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_8__enter__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__enter__", 0);
/* "petsc4py/PETSc/petscvec.pxi":558
*
* def __enter__(self):
* return self.enter() # <<<<<<<<<<<<<<
*
* def __exit__(self, *exc):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->enter(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 558, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscvec.pxi":557
* 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":560
* 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*/
static char __pyx_doc_8petsc4py_5PETSc_11_Vec_buffer_10__exit__[] = "_Vec_buffer.__exit__(self, *exc)";
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;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_exc = __pyx_args;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_10__exit__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), __pyx_v_exc);
/* function exit code */
__Pyx_XDECREF(__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":561
*
* def __exit__(self, *exc):
* return self.exit() # <<<<<<<<<<<<<<
*
* # buffer interface (legacy)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->exit(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 561, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscvec.pxi":560
* 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":565
* # buffer interface (legacy)
*
* cdef Py_ssize_t getbuffer(self, void **p) except -1: # <<<<<<<<<<<<<<
* cdef PetscInt n = 0
* if p != NULL:
*/
static Py_ssize_t __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_getbuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, void **__pyx_v_p) {
PetscInt __pyx_v_n;
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PetscInt __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getbuffer", 0);
/* "petsc4py/PETSc/petscvec.pxi":566
*
* cdef Py_ssize_t getbuffer(self, void **p) except -1:
* cdef PetscInt n = 0 # <<<<<<<<<<<<<<
* if p != NULL:
* self.acquire()
*/
__pyx_v_n = 0;
/* "petsc4py/PETSc/petscvec.pxi":567
* cdef Py_ssize_t getbuffer(self, void **p) except -1:
* cdef PetscInt n = 0
* if p != NULL: # <<<<<<<<<<<<<<
* self.acquire()
* p[0] = <void*>self.data
*/
__pyx_t_1 = ((__pyx_v_p != NULL) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscvec.pxi":568
* cdef PetscInt n = 0
* if p != NULL:
* self.acquire() # <<<<<<<<<<<<<<
* p[0] = <void*>self.data
* n = self.size
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 568, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":569
* if p != NULL:
* self.acquire()
* p[0] = <void*>self.data # <<<<<<<<<<<<<<
* n = self.size
* elif self.vec != NULL:
*/
(__pyx_v_p[0]) = ((void *)__pyx_v_self->data);
/* "petsc4py/PETSc/petscvec.pxi":570
* self.acquire()
* p[0] = <void*>self.data
* n = self.size # <<<<<<<<<<<<<<
* elif self.vec != NULL:
* CHKERR( VecGetLocalSize(self.vec, &n) )
*/
__pyx_t_3 = __pyx_v_self->size;
__pyx_v_n = __pyx_t_3;
/* "petsc4py/PETSc/petscvec.pxi":567
* cdef Py_ssize_t getbuffer(self, void **p) except -1:
* cdef PetscInt n = 0
* if p != NULL: # <<<<<<<<<<<<<<
* self.acquire()
* p[0] = <void*>self.data
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscvec.pxi":571
* p[0] = <void*>self.data
* n = self.size
* elif self.vec != NULL: # <<<<<<<<<<<<<<
* CHKERR( VecGetLocalSize(self.vec, &n) )
* return <Py_ssize_t>(<size_t>n*sizeof(PetscScalar))
*/
__pyx_t_1 = ((__pyx_v_self->vec != NULL) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscvec.pxi":572
* n = self.size
* elif self.vec != NULL:
* CHKERR( VecGetLocalSize(self.vec, &n) ) # <<<<<<<<<<<<<<
* return <Py_ssize_t>(<size_t>n*sizeof(PetscScalar))
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_n))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 572, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":571
* p[0] = <void*>self.data
* n = self.size
* elif self.vec != NULL: # <<<<<<<<<<<<<<
* CHKERR( VecGetLocalSize(self.vec, &n) )
* return <Py_ssize_t>(<size_t>n*sizeof(PetscScalar))
*/
}
__pyx_L3:;
/* "petsc4py/PETSc/petscvec.pxi":573
* elif self.vec != NULL:
* CHKERR( VecGetLocalSize(self.vec, &n) )
* return <Py_ssize_t>(<size_t>n*sizeof(PetscScalar)) # <<<<<<<<<<<<<<
*
* def __getsegcount__(self, Py_ssize_t *lenp):
*/
__pyx_r = ((Py_ssize_t)(((size_t)__pyx_v_n) * (sizeof(PetscScalar))));
goto __pyx_L0;
/* "petsc4py/PETSc/petscvec.pxi":565
* # buffer interface (legacy)
*
* cdef Py_ssize_t getbuffer(self, void **p) except -1: # <<<<<<<<<<<<<<
* cdef PetscInt n = 0
* if p != NULL:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.getbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1L;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscvec.pxi":575
* return <Py_ssize_t>(<size_t>n*sizeof(PetscScalar))
*
* def __getsegcount__(self, Py_ssize_t *lenp): # <<<<<<<<<<<<<<
* if lenp != NULL:
* lenp[0] = self.getbuffer(NULL)
*/
/* Python wrapper */
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_13__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_lenp); /*proto*/
static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_13__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_lenp) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getsegcount__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_12__getsegcount__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), ((Py_ssize_t *)__pyx_v_lenp));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_12__getsegcount__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t *__pyx_v_lenp) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
Py_ssize_t __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getsegcount__", 0);
/* "petsc4py/PETSc/petscvec.pxi":576
*
* def __getsegcount__(self, Py_ssize_t *lenp):
* if lenp != NULL: # <<<<<<<<<<<<<<
* lenp[0] = self.getbuffer(NULL)
* return 1
*/
__pyx_t_1 = ((__pyx_v_lenp != NULL) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscvec.pxi":577
* def __getsegcount__(self, Py_ssize_t *lenp):
* if lenp != NULL:
* lenp[0] = self.getbuffer(NULL) # <<<<<<<<<<<<<<
* return 1
*
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->getbuffer(__pyx_v_self, NULL); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(7, 577, __pyx_L1_error)
(__pyx_v_lenp[0]) = __pyx_t_2;
/* "petsc4py/PETSc/petscvec.pxi":576
*
* def __getsegcount__(self, Py_ssize_t *lenp):
* if lenp != NULL: # <<<<<<<<<<<<<<
* lenp[0] = self.getbuffer(NULL)
* return 1
*/
}
/* "petsc4py/PETSc/petscvec.pxi":578
* if lenp != NULL:
* lenp[0] = self.getbuffer(NULL)
* return 1 # <<<<<<<<<<<<<<
*
* def __getreadbuffer__(self, Py_ssize_t idx, void **p):
*/
__pyx_r = 1;
goto __pyx_L0;
/* "petsc4py/PETSc/petscvec.pxi":575
* return <Py_ssize_t>(<size_t>n*sizeof(PetscScalar))
*
* def __getsegcount__(self, Py_ssize_t *lenp): # <<<<<<<<<<<<<<
* if lenp != NULL:
* lenp[0] = self.getbuffer(NULL)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__getsegcount__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
/* "petsc4py/PETSc/petscvec.pxi":580
* return 1
*
* def __getreadbuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<<
* if idx != 0: raise SystemError(
* "accessing non-existent buffer segment")
*/
/* Python wrapper */
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_15__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /*proto*/
static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_15__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getreadbuffer__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_14__getreadbuffer__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), ((Py_ssize_t)__pyx_v_idx), ((void **)__pyx_v_p));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_14__getreadbuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getreadbuffer__", 0);
/* "petsc4py/PETSc/petscvec.pxi":581
*
* def __getreadbuffer__(self, Py_ssize_t idx, void **p):
* if idx != 0: raise SystemError( # <<<<<<<<<<<<<<
* "accessing non-existent buffer segment")
* return self.getbuffer(p)
*/
__pyx_t_1 = ((__pyx_v_idx != 0) != 0);
if (unlikely(__pyx_t_1)) {
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 581, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(7, 581, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscvec.pxi":583
* if idx != 0: raise SystemError(
* "accessing non-existent buffer segment")
* return self.getbuffer(p) # <<<<<<<<<<<<<<
*
* def __getwritebuffer__(self, Py_ssize_t idx, void **p):
*/
__pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->getbuffer(__pyx_v_self, __pyx_v_p); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1L))) __PYX_ERR(7, 583, __pyx_L1_error)
__pyx_r = __pyx_t_3;
goto __pyx_L0;
/* "petsc4py/PETSc/petscvec.pxi":580
* return 1
*
* def __getreadbuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<<
* if idx != 0: raise SystemError(
* "accessing non-existent buffer segment")
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__getreadbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
/* "petsc4py/PETSc/petscvec.pxi":585
* return self.getbuffer(p)
*
* def __getwritebuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<<
* if idx != 0: raise SystemError(
* "accessing non-existent buffer segment")
*/
/* Python wrapper */
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_17__getwritebuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /*proto*/
static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_17__getwritebuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getwritebuffer__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_16__getwritebuffer__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), ((Py_ssize_t)__pyx_v_idx), ((void **)__pyx_v_p));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
#if PY_MAJOR_VERSION < 3
static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_16__getwritebuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getwritebuffer__", 0);
/* "petsc4py/PETSc/petscvec.pxi":586
*
* def __getwritebuffer__(self, Py_ssize_t idx, void **p):
* if idx != 0: raise SystemError( # <<<<<<<<<<<<<<
* "accessing non-existent buffer segment")
* if self.readonly: raise TypeError(
*/
__pyx_t_1 = ((__pyx_v_idx != 0) != 0);
if (unlikely(__pyx_t_1)) {
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 586, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(7, 586, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscvec.pxi":588
* if idx != 0: raise SystemError(
* "accessing non-existent buffer segment")
* if self.readonly: raise TypeError( # <<<<<<<<<<<<<<
* "Object is not writable.")
* return self.getbuffer(p)
*/
__pyx_t_1 = (__pyx_v_self->readonly != 0);
if (unlikely(__pyx_t_1)) {
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 588, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(7, 588, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscvec.pxi":590
* if self.readonly: raise TypeError(
* "Object is not writable.")
* return self.getbuffer(p) # <<<<<<<<<<<<<<
*
* # NumPy array interface (legacy)
*/
__pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->getbuffer(__pyx_v_self, __pyx_v_p); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1L))) __PYX_ERR(7, 590, __pyx_L1_error)
__pyx_r = __pyx_t_3;
goto __pyx_L0;
/* "petsc4py/PETSc/petscvec.pxi":585
* return self.getbuffer(p)
*
* def __getwritebuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<<
* if idx != 0: raise SystemError(
* "accessing non-existent buffer segment")
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__getwritebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
/* "petsc4py/PETSc/petscvec.pxi":595
*
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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":596
* 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":597
* 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) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscvec.pxi":598
* cdef PetscInt n = 0
* if self.vec != NULL:
* CHKERR( VecGetLocalSize(self.vec, &n) ) # <<<<<<<<<<<<<<
* cdef object size = toInt(n)
* cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_n))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 598, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":597
* 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":599
* if self.vec != NULL:
* CHKERR( VecGetLocalSize(self.vec, &n) )
* cdef object size = toInt(n) # <<<<<<<<<<<<<<
* cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR)
* cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize)
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_size = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscvec.pxi":600
* CHKERR( VecGetLocalSize(self.vec, &n) )
* cdef object size = toInt(n)
* cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR) # <<<<<<<<<<<<<<
* cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize)
* return dict(version=3,
*/
__pyx_t_3 = ((PyObject *)PyArray_DescrFromType(NPY_PETSC_SCALAR)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 600, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscvec.pxi":601
* cdef object size = toInt(n)
* cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR)
* cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) # <<<<<<<<<<<<<<
* return dict(version=3,
* data=self,
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_descr), __pyx_n_s_kind); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_descr), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_c_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 601, __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":602
* cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR)
* cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize)
* return dict(version=3, # <<<<<<<<<<<<<<
* data=self,
* shape=(size,),
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_version, __pyx_int_3) < 0) __PYX_ERR(7, 602, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":603
* cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize)
* return dict(version=3,
* data=self, # <<<<<<<<<<<<<<
* shape=(size,),
* typestr=typestr)
*/
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_data, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(7, 602, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":604
* return dict(version=3,
* data=self,
* shape=(size,), # <<<<<<<<<<<<<<
* typestr=typestr)
*
*/
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_size);
__Pyx_GIVEREF(__pyx_v_size);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_size);
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(7, 602, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscvec.pxi":605
* data=self,
* shape=(size,),
* typestr=typestr) # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_typestr, __pyx_v_typestr) < 0) __PYX_ERR(7, 602, __pyx_L1_error)
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscvec.pxi":595
*
* 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":616
* cdef Vec lvec
*
* def __init__(self, Vec gvec): # <<<<<<<<<<<<<<
* self.gvec = gvec
* self.lvec = Vec()
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_gvec = 0;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gvec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gvec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(7, 616, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_gvec = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 616, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc._Vec_LocalForm.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(7, 616, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm___init__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)__pyx_v_self), __pyx_v_gvec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm___init__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
/* "petsc4py/PETSc/petscvec.pxi":617
*
* def __init__(self, Vec gvec):
* self.gvec = gvec # <<<<<<<<<<<<<<
* self.lvec = Vec()
*
*/
__Pyx_INCREF(((PyObject *)__pyx_v_gvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_gvec));
__Pyx_GOTREF(__pyx_v_self->gvec);
__Pyx_DECREF(((PyObject *)__pyx_v_self->gvec));
__pyx_v_self->gvec = __pyx_v_gvec;
/* "petsc4py/PETSc/petscvec.pxi":618
* def __init__(self, Vec gvec):
* self.gvec = gvec
* self.lvec = Vec() # <<<<<<<<<<<<<<
*
* def __enter__(self):
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 618, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__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":616
* cdef Vec lvec
*
* def __init__(self, Vec gvec): # <<<<<<<<<<<<<<
* self.gvec = gvec
* self.lvec = Vec()
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc._Vec_LocalForm.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscvec.pxi":620
* 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_14_Vec_LocalForm_2__enter__[] = "_Vec_LocalForm.__enter__(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_3__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_2__enter__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_2__enter__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self) {
Vec __pyx_v_gvec;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
Vec __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__enter__", 0);
/* "petsc4py/PETSc/petscvec.pxi":621
*
* 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":622
* def __enter__(self):
* cdef PetscVec gvec = self.gvec.vec
* CHKERR( VecGhostGetLocalForm(gvec, &self.lvec.vec) ) # <<<<<<<<<<<<<<
* return self.lvec
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGhostGetLocalForm(__pyx_v_gvec, (&__pyx_v_self->lvec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 622, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":623
* 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":620
* 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":625
* 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*/
static char __pyx_doc_8petsc4py_5PETSc_14_Vec_LocalForm_4__exit__[] = "_Vec_LocalForm.__exit__(self, *exc)";
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;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_exc = __pyx_args;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_4__exit__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)__pyx_v_self), __pyx_v_exc);
/* function exit code */
__Pyx_XDECREF(__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":626
*
* 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":627
* def __exit__(self, *exc):
* cdef PetscVec gvec = self.gvec.vec
* CHKERR( VecGhostRestoreLocalForm(gvec, &self.lvec.vec) ) # <<<<<<<<<<<<<<
* self.lvec.vec = NULL
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGhostRestoreLocalForm(__pyx_v_gvec, (&__pyx_v_self->lvec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 627, __pyx_L1_error)
/* "petsc4py/PETSc/petscvec.pxi":628
* 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":625
* 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":530
* 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ref_NullSpace", 0);
/* "petsc4py/PETSc/petscmat.pxi":531
*
* cdef inline NullSpace ref_NullSpace(PetscNullSpace nsp):
* cdef NullSpace ob = <NullSpace> NullSpace() # <<<<<<<<<<<<<<
* ob.nsp = nsp
* PetscINCREF(ob.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_NullSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 531, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ob = ((struct PyPetscNullSpaceObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscmat.pxi":532
* cdef inline NullSpace ref_NullSpace(PetscNullSpace nsp):
* cdef NullSpace ob = <NullSpace> NullSpace()
* ob.nsp = nsp # <<<<<<<<<<<<<<
* PetscINCREF(ob.obj)
* return ob
*/
__pyx_v_ob->nsp = __pyx_v_nsp;
/* "petsc4py/PETSc/petscmat.pxi":533
* cdef NullSpace ob = <NullSpace> NullSpace()
* ob.nsp = nsp
* PetscINCREF(ob.obj) # <<<<<<<<<<<<<<
* return ob
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj));
/* "petsc4py/PETSc/petscmat.pxi":534
* ob.nsp = nsp
* 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":530
* 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":536
* return ob
*
* cdef PetscErrorCode NullSpace_Function( # <<<<<<<<<<<<<<
* PetscNullSpace n,
* PetscVec v,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_NullSpace_Function(MatNullSpace __pyx_v_n, Vec __pyx_v_v, CYTHON_UNUSED void *__pyx_v_ctx) {
struct PyPetscNullSpaceObject *__pyx_v_nsp = 0;
struct PyPetscVecObject *__pyx_v_vec = 0;
PyObject *__pyx_v_function = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *(*__pyx_t_6)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("NullSpace_Function", 0);
/* "petsc4py/PETSc/petscmat.pxi":541
* 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(20, 541, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscmat.pxi":542
* ) 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(20, 542, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscmat.pxi":543
* 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(20, 543, __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(20, 543, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
__pyx_t_4 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 543, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 543, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 543, __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(20, 543, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
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(20, 543, __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(20, 543, __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":544
* 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(20, 544, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_nsp));
__Pyx_GIVEREF(((PyObject *)__pyx_v_nsp));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_nsp));
__Pyx_INCREF(((PyObject *)__pyx_v_vec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_vec));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_vec));
__pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 544, __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(20, 544, __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(20, 544, __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, 544, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
} else {
__pyx_t_4 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 544, __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(20, 544, __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":545
* (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":536
* return ob
*
* cdef PetscErrorCode NullSpace_Function( # <<<<<<<<<<<<<<
* PetscNullSpace n,
* PetscVec v,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.NullSpace_Function", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_nsp);
__Pyx_XDECREF((PyObject *)__pyx_v_vec);
__Pyx_XDECREF(__pyx_v_function);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":549
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ref_Mat", 0);
/* "petsc4py/PETSc/petscmat.pxi":550
*
* cdef inline Mat ref_Mat(PetscMat mat):
* cdef Mat ob = <Mat> Mat() # <<<<<<<<<<<<<<
* ob.mat = mat
* PetscINCREF(ob.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 550, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ob = ((struct PyPetscMatObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscmat.pxi":551
* cdef inline Mat ref_Mat(PetscMat mat):
* cdef Mat ob = <Mat> Mat()
* ob.mat = mat # <<<<<<<<<<<<<<
* PetscINCREF(ob.obj)
* return ob
*/
__pyx_v_ob->mat = __pyx_v_mat;
/* "petsc4py/PETSc/petscmat.pxi":552
* cdef Mat ob = <Mat> Mat()
* ob.mat = mat
* PetscINCREF(ob.obj) # <<<<<<<<<<<<<<
* return ob
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj));
/* "petsc4py/PETSc/petscmat.pxi":553
* ob.mat = mat
* 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":549
* # -----------------------------------------------------------------------------
*
* 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":559
* # 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;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mat_pos", 0);
/* "petsc4py/PETSc/petscmat.pxi":560
*
* cdef Mat mat_pos(Mat self):
* cdef Mat mat = type(self)() # <<<<<<<<<<<<<<
* CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &mat.mat) )
* return mat
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 560, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(20, 560, __pyx_L1_error)
__pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscmat.pxi":561
* cdef Mat mat_pos(Mat self):
* cdef Mat mat = type(self)()
* CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &mat.mat) ) # <<<<<<<<<<<<<<
* return mat
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, MAT_COPY_VALUES, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 561, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":562
* 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":559
* # 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":564
* 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":565
*
* 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(20, 565, __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":566
* 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(20, 566, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":567
* 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":564
* 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":571
* # 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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
int __pyx_t_8;
PyObject *(*__pyx_t_9)(PyObject *);
PyObject *__pyx_t_10 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mat_iadd", 0);
/* "petsc4py/PETSc/petscmat.pxi":572
*
* cdef Mat mat_iadd(Mat self, other):
* if isinstance(other, Mat): # <<<<<<<<<<<<<<
* self.axpy(1, other)
* elif isinstance(other, (tuple, list)):
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":573
* 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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_axpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_int_1, __pyx_v_other};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 573, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_int_1, __pyx_v_other};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 573, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
{
__pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_INCREF(__pyx_int_1);
__Pyx_GIVEREF(__pyx_int_1);
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_int_1);
__Pyx_INCREF(__pyx_v_other);
__Pyx_GIVEREF(__pyx_v_other);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_other);
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/petscmat.pxi":572
*
* 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":574
* if isinstance(other, Mat):
* self.axpy(1, other)
* elif isinstance(other, (tuple, list)): # <<<<<<<<<<<<<<
* alpha, mat = other
* self.axpy(alpha, mat)
*/
__pyx_t_1 = PyTuple_Check(__pyx_v_other);
__pyx_t_8 = (__pyx_t_1 != 0);
if (!__pyx_t_8) {
} else {
__pyx_t_2 = __pyx_t_8;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_8 = PyList_Check(__pyx_v_other);
__pyx_t_1 = (__pyx_t_8 != 0);
__pyx_t_2 = __pyx_t_1;
__pyx_L4_bool_binop_done:;
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscmat.pxi":575
* 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(20, 575, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_3 = PyList_GET_ITEM(sequence, 0);
__pyx_t_4 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
#else
__pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 575, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 575, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 575, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_7), 2) < 0) __PYX_ERR(20, 575, __pyx_L1_error)
__pyx_t_9 = 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_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(20, 575, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__pyx_v_alpha = __pyx_t_3;
__pyx_t_3 = 0;
__pyx_v_mat = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":576
* elif isinstance(other, (tuple, list)):
* alpha, mat = other
* self.axpy(alpha, mat) # <<<<<<<<<<<<<<
* elif isinstance(other, Vec):
* self.setDiagonal(other, PETSC_ADD_VALUES)
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_axpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 576, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_7 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_alpha, __pyx_v_mat};
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 576, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_alpha, __pyx_v_mat};
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 576, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else
#endif
{
__pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 576, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__pyx_t_7) {
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
}
__Pyx_INCREF(__pyx_v_alpha);
__Pyx_GIVEREF(__pyx_v_alpha);
PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_alpha);
__Pyx_INCREF(__pyx_v_mat);
__Pyx_GIVEREF(__pyx_v_mat);
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_mat);
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 576, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":574
* 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":577
* alpha, mat = other
* self.axpy(alpha, mat)
* elif isinstance(other, Vec): # <<<<<<<<<<<<<<
* self.setDiagonal(other, PETSC_ADD_VALUES)
* else:
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":578
* self.axpy(alpha, mat)
* elif isinstance(other, Vec):
* self.setDiagonal(other, PETSC_ADD_VALUES) # <<<<<<<<<<<<<<
* else:
* self.shift(other)
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDiagonal); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyInt_From_InsertMode(ADD_VALUES); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_7 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_other, __pyx_t_5};
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 578, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_other, __pyx_t_5};
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 578, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
__pyx_t_10 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(20, 578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
if (__pyx_t_7) {
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL;
}
__Pyx_INCREF(__pyx_v_other);
__Pyx_GIVEREF(__pyx_v_other);
PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_6, __pyx_v_other);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_6, __pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 578, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":577
* 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":580
* self.setDiagonal(other, PETSC_ADD_VALUES)
* else:
* self.shift(other) # <<<<<<<<<<<<<<
* return self
*
*/
/*else*/ {
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shift); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 580, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_10 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_10)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_other);
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 580, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__pyx_L3:;
/* "petsc4py/PETSc/petscmat.pxi":581
* 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":571
* # 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_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_10);
__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":583
* 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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
int __pyx_t_8;
PyObject *(*__pyx_t_9)(PyObject *);
PyObject *__pyx_t_10 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mat_isub", 0);
/* "petsc4py/PETSc/petscmat.pxi":584
*
* cdef Mat mat_isub(Mat self, other):
* if isinstance(other, Mat): # <<<<<<<<<<<<<<
* self.axpy(-1, other)
* elif isinstance(other, (tuple, list)):
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":585
* 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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_axpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 585, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_int_neg_1, __pyx_v_other};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 585, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_int_neg_1, __pyx_v_other};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 585, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
{
__pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 585, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_INCREF(__pyx_int_neg_1);
__Pyx_GIVEREF(__pyx_int_neg_1);
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_int_neg_1);
__Pyx_INCREF(__pyx_v_other);
__Pyx_GIVEREF(__pyx_v_other);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_other);
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 585, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/petscmat.pxi":584
*
* 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":586
* if isinstance(other, Mat):
* self.axpy(-1, other)
* elif isinstance(other, (tuple, list)): # <<<<<<<<<<<<<<
* alpha, mat = other
* self.axpy(-alpha, mat)
*/
__pyx_t_1 = PyTuple_Check(__pyx_v_other);
__pyx_t_8 = (__pyx_t_1 != 0);
if (!__pyx_t_8) {
} else {
__pyx_t_2 = __pyx_t_8;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_8 = PyList_Check(__pyx_v_other);
__pyx_t_1 = (__pyx_t_8 != 0);
__pyx_t_2 = __pyx_t_1;
__pyx_L4_bool_binop_done:;
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscmat.pxi":587
* 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(20, 587, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_3 = PyList_GET_ITEM(sequence, 0);
__pyx_t_4 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
#else
__pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 587, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 587, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 587, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_7), 2) < 0) __PYX_ERR(20, 587, __pyx_L1_error)
__pyx_t_9 = 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_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(20, 587, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__pyx_v_alpha = __pyx_t_3;
__pyx_t_3 = 0;
__pyx_v_mat = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":588
* elif isinstance(other, (tuple, list)):
* alpha, mat = other
* self.axpy(-alpha, mat) # <<<<<<<<<<<<<<
* elif isinstance(other, Vec):
* diag = other.copy()
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_axpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 588, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_7 = PyNumber_Negative(__pyx_v_alpha); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 588, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_5 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_v_mat};
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 588, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_v_mat};
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 588, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
#endif
{
__pyx_t_10 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(20, 588, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_6, __pyx_t_7);
__Pyx_INCREF(__pyx_v_mat);
__Pyx_GIVEREF(__pyx_v_mat);
PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_6, __pyx_v_mat);
__pyx_t_7 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 588, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":586
* 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":589
* alpha, mat = other
* self.axpy(-alpha, mat)
* elif isinstance(other, Vec): # <<<<<<<<<<<<<<
* diag = other.copy()
* diag.scale(-1)
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":590
* self.axpy(-alpha, mat)
* elif isinstance(other, Vec):
* diag = other.copy() # <<<<<<<<<<<<<<
* diag.scale(-1)
* self.setDiagonal(diag, PETSC_ADD_VALUES)
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 590, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_10 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_10)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 590, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_diag = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":591
* elif isinstance(other, Vec):
* diag = other.copy()
* diag.scale(-1) # <<<<<<<<<<<<<<
* self.setDiagonal(diag, PETSC_ADD_VALUES)
* diag.destroy()
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_diag, __pyx_n_s_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 591, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_10 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_10)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_int_neg_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_neg_1);
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 591, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":592
* diag = other.copy()
* diag.scale(-1)
* self.setDiagonal(diag, PETSC_ADD_VALUES) # <<<<<<<<<<<<<<
* diag.destroy()
* else:
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDiagonal); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 592, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_10 = __Pyx_PyInt_From_InsertMode(ADD_VALUES); if (unlikely(!__pyx_t_10)) __PYX_ERR(20, 592, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_7 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_diag, __pyx_t_10};
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 592, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_diag, __pyx_t_10};
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 592, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
} else
#endif
{
__pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 592, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__pyx_t_7) {
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
}
__Pyx_INCREF(__pyx_v_diag);
__Pyx_GIVEREF(__pyx_v_diag);
PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_diag);
__Pyx_GIVEREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_10);
__pyx_t_10 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 592, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":593
* diag.scale(-1)
* self.setDiagonal(diag, PETSC_ADD_VALUES)
* diag.destroy() # <<<<<<<<<<<<<<
* else:
* self.shift(other)
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_diag, __pyx_n_s_destroy); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":589
* alpha, mat = other
* self.axpy(-alpha, mat)
* elif isinstance(other, Vec): # <<<<<<<<<<<<<<
* diag = other.copy()
* diag.scale(-1)
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscmat.pxi":595
* diag.destroy()
* else:
* self.shift(other) # <<<<<<<<<<<<<<
* return self
*
*/
/*else*/ {
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shift); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 595, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_other);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 595, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__pyx_L3:;
/* "petsc4py/PETSc/petscmat.pxi":596
* 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":583
* 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_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_10);
__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":598
* return self
*
* cdef Mat mat_imul(Mat self, other): # <<<<<<<<<<<<<<
* if (isinstance(other, tuple) or
* isinstance(other, list)):
*/
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;
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_t_8;
PyObject *__pyx_t_9 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mat_imul", 0);
/* "petsc4py/PETSc/petscmat.pxi":599
*
* cdef Mat mat_imul(Mat self, other):
* if (isinstance(other, tuple) or # <<<<<<<<<<<<<<
* isinstance(other, list)):
* L, R = other
*/
__pyx_t_2 = PyTuple_Check(__pyx_v_other);
__pyx_t_3 = (__pyx_t_2 != 0);
if (!__pyx_t_3) {
} else {
__pyx_t_1 = __pyx_t_3;
goto __pyx_L4_bool_binop_done;
}
/* "petsc4py/PETSc/petscmat.pxi":600
* cdef Mat mat_imul(Mat self, other):
* if (isinstance(other, tuple) or
* isinstance(other, list)): # <<<<<<<<<<<<<<
* L, R = other
* self.diagonalScale(L, R)
*/
__pyx_t_3 = PyList_Check(__pyx_v_other);
__pyx_t_2 = (__pyx_t_3 != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
/* "petsc4py/PETSc/petscmat.pxi":599
*
* cdef Mat mat_imul(Mat self, other):
* if (isinstance(other, tuple) or # <<<<<<<<<<<<<<
* isinstance(other, list)):
* L, R = other
*/
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscmat.pxi":601
* if (isinstance(other, tuple) or
* isinstance(other, 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(20, 601, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
#else
__pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 601, __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(20, 601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_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_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(20, 601, __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(20, 601, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__pyx_v_L = __pyx_t_4;
__pyx_t_4 = 0;
__pyx_v_R = __pyx_t_5;
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscmat.pxi":602
* isinstance(other, list)):
* L, R = other
* self.diagonalScale(L, R) # <<<<<<<<<<<<<<
* else:
* self.scale(other)
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_diagonalScale); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = NULL;
__pyx_t_8 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_8 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_L, __pyx_v_R};
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 602, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_L, __pyx_v_R};
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 602, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
__pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
if (__pyx_t_6) {
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
}
__Pyx_INCREF(__pyx_v_L);
__Pyx_GIVEREF(__pyx_v_L);
PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_L);
__Pyx_INCREF(__pyx_v_R);
__Pyx_GIVEREF(__pyx_v_R);
PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_R);
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscmat.pxi":599
*
* cdef Mat mat_imul(Mat self, other):
* if (isinstance(other, tuple) or # <<<<<<<<<<<<<<
* isinstance(other, list)):
* L, R = other
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscmat.pxi":604
* self.diagonalScale(L, R)
* else:
* self.scale(other) # <<<<<<<<<<<<<<
* return self
*
*/
/*else*/ {
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_9 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other);
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__pyx_L3:;
/* "petsc4py/PETSc/petscmat.pxi":605
* 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":598
* return self
*
* cdef Mat mat_imul(Mat self, other): # <<<<<<<<<<<<<<
* if (isinstance(other, tuple) or
* isinstance(other, list)):
*/
/* 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_9);
__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":607
* 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;
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_t_8;
PyObject *__pyx_t_9 = NULL;
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":608
*
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (!__pyx_t_3) {
} else {
__pyx_t_1 = __pyx_t_3;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_3 = PyList_Check(__pyx_v_other);
__pyx_t_2 = (__pyx_t_3 != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":609
* 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(20, 609, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
#else
__pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 609, __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(20, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_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_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(20, 609, __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(20, 609, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__pyx_v_L = __pyx_t_4;
__pyx_t_4 = 0;
__pyx_v_R = __pyx_t_5;
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscmat.pxi":610
* if isinstance(other, (tuple, list)):
* L, R = other
* if isinstance(L, Vec): # <<<<<<<<<<<<<<
* L = L.copy()
* L.reciprocal()
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_L, __pyx_ptype_8petsc4py_5PETSc_Vec);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscmat.pxi":611
* L, R = other
* if isinstance(L, Vec):
* L = L.copy() # <<<<<<<<<<<<<<
* L.reciprocal()
* if isinstance(R, Vec):
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_L, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 611, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 611, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_L, __pyx_t_5);
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscmat.pxi":612
* if isinstance(L, Vec):
* L = L.copy()
* L.reciprocal() # <<<<<<<<<<<<<<
* if isinstance(R, Vec):
* R = R.copy()
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_L, __pyx_n_s_reciprocal); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 612, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 612, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscmat.pxi":610
* if isinstance(other, (tuple, list)):
* L, R = other
* if isinstance(L, Vec): # <<<<<<<<<<<<<<
* L = L.copy()
* L.reciprocal()
*/
}
/* "petsc4py/PETSc/petscmat.pxi":613
* L = L.copy()
* L.reciprocal()
* if isinstance(R, Vec): # <<<<<<<<<<<<<<
* R = R.copy()
* R.reciprocal()
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_R, __pyx_ptype_8petsc4py_5PETSc_Vec);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":614
* L.reciprocal()
* if isinstance(R, Vec):
* R = R.copy() # <<<<<<<<<<<<<<
* R.reciprocal()
* self.diagonalScale(L, R)
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_R, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 614, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 614, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_R, __pyx_t_5);
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscmat.pxi":615
* if isinstance(R, Vec):
* R = R.copy()
* R.reciprocal() # <<<<<<<<<<<<<<
* self.diagonalScale(L, R)
* else:
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_R, __pyx_n_s_reciprocal); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscmat.pxi":613
* L = L.copy()
* L.reciprocal()
* if isinstance(R, Vec): # <<<<<<<<<<<<<<
* R = R.copy()
* R.reciprocal()
*/
}
/* "petsc4py/PETSc/petscmat.pxi":616
* R = R.copy()
* R.reciprocal()
* self.diagonalScale(L, R) # <<<<<<<<<<<<<<
* else:
* other = 1/other
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_diagonalScale); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = NULL;
__pyx_t_8 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_8 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_L, __pyx_v_R};
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 616, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_L, __pyx_v_R};
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 616, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
__pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
if (__pyx_t_6) {
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
}
__Pyx_INCREF(__pyx_v_L);
__Pyx_GIVEREF(__pyx_v_L);
PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_L);
__Pyx_INCREF(__pyx_v_R);
__Pyx_GIVEREF(__pyx_v_R);
PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_R);
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscmat.pxi":608
*
* 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":618
* self.diagonalScale(L, R)
* else:
* other = 1/other # <<<<<<<<<<<<<<
* self.scale(other)
* return self
*/
/*else*/ {
__pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_int_1, __pyx_v_other); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 618, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF_SET(__pyx_v_other, __pyx_t_5);
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscmat.pxi":619
* else:
* other = 1/other
* self.scale(other) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_9 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other);
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__pyx_L3:;
/* "petsc4py/PETSc/petscmat.pxi":620
* 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":607
* 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_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_9);
__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":624
* # 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":625
*
* 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(20, 625, __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(20, 625, __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":624
* # 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":627
* 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":628
*
* cdef Mat mat_sub(Mat self, other):
* return mat_isub(mat_pos(self), other) # <<<<<<<<<<<<<<
*
* cdef Mat mat_mul(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(20, 628, __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(20, 628, __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":627
* 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":630
* return mat_isub(mat_pos(self), other)
*
* cdef Mat mat_mul(Mat self, other): # <<<<<<<<<<<<<<
* if isinstance(other, Mat):
* return self.matMult(other)
*/
static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_mul(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mat_mul", 0);
/* "petsc4py/PETSc/petscmat.pxi":631
*
* cdef Mat mat_mul(Mat self, other):
* if isinstance(other, Mat): # <<<<<<<<<<<<<<
* return self.matMult(other)
* else:
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":632
* cdef Mat mat_mul(Mat self, other):
* if isinstance(other, Mat):
* return self.matMult(other) # <<<<<<<<<<<<<<
* else:
* return mat_imul(mat_pos(self), other)
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_matMult); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 632, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 632, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(20, 632, __pyx_L1_error)
__pyx_r = ((struct PyPetscMatObject *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscmat.pxi":631
*
* cdef Mat mat_mul(Mat self, other):
* if isinstance(other, Mat): # <<<<<<<<<<<<<<
* return self.matMult(other)
* else:
*/
}
/* "petsc4py/PETSc/petscmat.pxi":634
* return self.matMult(other)
* else:
* return mat_imul(mat_pos(self), other) # <<<<<<<<<<<<<<
*
* cdef Vec mat_mul_vec(Mat self, Vec other):
*/
/*else*/ {
__Pyx_XDECREF(((PyObject *)__pyx_r));
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_pos(__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 634, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_imul(((struct PyPetscMatObject *)__pyx_t_3), __pyx_v_other)); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 634, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = ((struct PyPetscMatObject *)__pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":630
* return mat_isub(mat_pos(self), other)
*
* cdef Mat mat_mul(Mat self, other): # <<<<<<<<<<<<<<
* if isinstance(other, Mat):
* return self.matMult(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_mul", __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":636
* return mat_imul(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;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mat_mul_vec", 0);
/* "petsc4py/PETSc/petscmat.pxi":637
*
* cdef Vec mat_mul_vec(Mat self, Vec other):
* cdef Vec result = self.createVecLeft() # <<<<<<<<<<<<<<
* self.mult(other, result)
* return result
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_createVecLeft); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 637, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 637, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(20, 637, __pyx_L1_error)
__pyx_v_result = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscmat.pxi":638
* cdef Vec mat_mul_vec(Mat self, Vec other):
* cdef Vec result = self.createVecLeft()
* self.mult(other, result) # <<<<<<<<<<<<<<
* return result
*
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mult); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 638, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
__pyx_t_4 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
__pyx_t_4 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_other), ((PyObject *)__pyx_v_result)};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 638, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_other), ((PyObject *)__pyx_v_result)};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 638, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
__pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 638, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__pyx_t_3) {
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
}
__Pyx_INCREF(((PyObject *)__pyx_v_other));
__Pyx_GIVEREF(((PyObject *)__pyx_v_other));
PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_other));
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__Pyx_GIVEREF(((PyObject *)__pyx_v_result));
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_result));
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 638, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/petscmat.pxi":639
* cdef Vec result = self.createVecLeft()
* self.mult(other, result)
* return result # <<<<<<<<<<<<<<
*
* cdef Mat mat_div(Mat self, other):
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = __pyx_v_result;
goto __pyx_L0;
/* "petsc4py/PETSc/petscmat.pxi":636
* return mat_imul(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_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.mat_mul_vec", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":641
* return result
*
* cdef Mat mat_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":642
*
* cdef Mat mat_div(Mat self, other):
* return mat_idiv(mat_pos(self), other) # <<<<<<<<<<<<<<
*
* # reflected binary operations
*/
__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(20, 642, __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(20, 642, __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":641
* return result
*
* 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":646
* # 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":647
*
* 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(20, 647, __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":646
* # 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":649
* 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;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mat_rsub", 0);
/* "petsc4py/PETSc/petscmat.pxi":650
*
* 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(20, 650, __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":651
* cdef Mat mat_rsub(Mat self, other):
* cdef Mat mat = <Mat> mat_sub(self, other)
* mat.scale(-1) # <<<<<<<<<<<<<<
* return mat
*
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mat), __pyx_n_s_scale); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
}
}
__pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_int_neg_1) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_int_neg_1);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/petscmat.pxi":652
* 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":649
* 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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.mat_rsub", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_mat);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":654
* 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":655
*
* 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 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_mul(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 655, __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":654
* 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":657
* return mat_mul(self, other)
*
* cdef Mat mat_rdiv(Mat self, other): # <<<<<<<<<<<<<<
* <void>self; <void>other; # unused
* raise NotImplementedError
*/
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":658
*
* cdef Mat mat_rdiv(Mat self, other):
* <void>self; <void>other; # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
*
*/
((void)__pyx_v_self);
((void)__pyx_v_other);
/* "petsc4py/PETSc/petscmat.pxi":659
* cdef Mat mat_rdiv(Mat self, other):
* <void>self; <void>other; # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
*
* # -----------------------------------------------------------------------------
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(20, 659, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":657
* return mat_mul(self, other)
*
* cdef Mat mat_rdiv(Mat self, other): # <<<<<<<<<<<<<<
* <void>self; <void>other; # unused
* raise NotImplementedError
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.mat_rdiv", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":663
* # -----------------------------------------------------------------------------
*
* 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;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
MatStructure __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("matstructure", 0);
/* "petsc4py/PETSc/petscmat.pxi":665
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_r = DIFFERENT_NONZERO_PATTERN;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":666
* 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_2 = (__pyx_v_structure == Py_False);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_r = DIFFERENT_NONZERO_PATTERN;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":667
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_r = SAME_NONZERO_PATTERN;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":668
* elif structure is False: return MAT_DIFFERENT_NONZERO_PATTERN
* elif structure is True: return MAT_SAME_NONZERO_PATTERN
* else: return structure # <<<<<<<<<<<<<<
*
* cdef inline PetscMatAssemblyType assemblytype(object assembly) \
*/
/*else*/ {
__pyx_t_3 = ((MatStructure)__Pyx_PyInt_As_MatStructure(__pyx_v_structure)); if (unlikely(PyErr_Occurred())) __PYX_ERR(20, 668, __pyx_L1_error)
__pyx_r = __pyx_t_3;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":663
* # -----------------------------------------------------------------------------
*
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":670
* else: return structure
*
* 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;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
MatAssemblyType __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("assemblytype", 0);
/* "petsc4py/PETSc/petscmat.pxi":672
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_r = MAT_FINAL_ASSEMBLY;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":673
* 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_2 = (__pyx_v_assembly == Py_False);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_r = MAT_FINAL_ASSEMBLY;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":674
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_r = MAT_FLUSH_ASSEMBLY;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":675
* 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_3 = ((MatAssemblyType)__Pyx_PyInt_As_MatAssemblyType(__pyx_v_assembly)); if (unlikely(PyErr_Occurred())) __PYX_ERR(20, 675, __pyx_L1_error)
__pyx_r = __pyx_t_3;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":670
* else: return structure
*
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":677
* 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;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
MatInfoType __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("infotype", 0);
/* "petsc4py/PETSc/petscmat.pxi":679
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_r = MAT_GLOBAL_SUM;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":680
* except <PetscMatInfoType>(-1):
* if info is None: return MAT_GLOBAL_SUM
* else: return info # <<<<<<<<<<<<<<
*
* # -----------------------------------------------------------------------------
*/
/*else*/ {
__pyx_t_3 = ((MatInfoType)__Pyx_PyInt_As_MatInfoType(__pyx_v_info)); if (unlikely(PyErr_Occurred())) __PYX_ERR(20, 680, __pyx_L1_error)
__pyx_r = __pyx_t_3;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":677
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":684
* # -----------------------------------------------------------------------------
*
* 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":692
* # 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":693
* 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(20, 693, __pyx_L3_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
#else
__pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 693, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 693, __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(20, 693, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
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(20, 693, __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(20, 693, __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":692
* # 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":694
* try:
* rsize , csize = size
* except (TypeError, ValueError): # <<<<<<<<<<<<<<
* rsize = csize = size
* # unpack row and column block sizes
*/
__pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
if (__pyx_t_8) {
__Pyx_AddTraceback("petsc4py.PETSc.Mat_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(20, 694, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_6);
/* "petsc4py/PETSc/petscmat.pxi":695
* 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;
__pyx_L5_except_error:;
/* "petsc4py/PETSc/petscmat.pxi":692
* # unpack row and column sizes
* cdef object rsize, csize
* try: # <<<<<<<<<<<<<<
* rsize , csize = size
* except (TypeError, ValueError):
*/
__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":698
* # 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":699
* 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(20, 699, __pyx_L13_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_6 = PyList_GET_ITEM(sequence, 0);
__pyx_t_4 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
#else
__pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 699, __pyx_L13_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 699, __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(20, 699, __pyx_L13_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
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(20, 699, __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(20, 699, __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":698
* # 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":700
* try:
* rbsize , cbsize = bsize
* except (TypeError, ValueError): # <<<<<<<<<<<<<<
* rbsize = cbsize = bsize
* # split row and column sizes
*/
__pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
if (__pyx_t_8) {
__Pyx_AddTraceback("petsc4py.PETSc.Mat_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(20, 700, __pyx_L15_except_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_5);
/* "petsc4py/PETSc/petscmat.pxi":701
* 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;
__pyx_L15_except_error:;
/* "petsc4py/PETSc/petscmat.pxi":698
* # unpack row and column block sizes
* cdef object rbsize, cbsize
* try: # <<<<<<<<<<<<<<
* rbsize , cbsize = bsize
* except (TypeError, ValueError):
*/
__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":703
* 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(20, 703, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":704
* # 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(20, 704, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":705
* 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":684
* # -----------------------------------------------------------------------------
*
* 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":707
* 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;
__Pyx_RefNannyDeclarations
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;
__Pyx_RefNannySetupContext("Mat_Create", 0);
/* "petsc4py/PETSc/petscmat.pxi":715
* ) 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(PyErr_Occurred())) __PYX_ERR(20, 715, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/petscmat.pxi":717
* 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":718
* # 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(20, 718, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":719
* 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) != 0);
if (__pyx_t_3) {
__pyx_v_rbs = 1;
}
/* "petsc4py/PETSc/petscmat.pxi":720
* 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) != 0);
if (__pyx_t_3) {
__pyx_v_cbs = __pyx_v_rbs;
}
/* "petsc4py/PETSc/petscmat.pxi":721
* 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(20, 721, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":722
* 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(20, 722, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":724
* 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":725
* # 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(20, 725, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":726
* 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(20, 726, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":727
* 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(20, 727, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":728
* 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(20, 728, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":729
* 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":730
* 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":707
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":732
* return PETSC_SUCCESS
*
* cdef inline PetscErrorCode Mat_AllocAIJ_NNZ( PetscMat A, object NNZ) except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<<
* #
* cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE, aijis=PETSC_FALSE
*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_NNZ(Mat __pyx_v_A, PyObject *__pyx_v_NNZ) {
PetscBool __pyx_v_aij;
PetscBool __pyx_v_baij;
PetscBool __pyx_v_sbaij;
PetscBool __pyx_v_aijis;
PetscInt __pyx_v_m;
PetscInt __pyx_v_bs;
PyObject *__pyx_v_od_nnz = 0;
PyObject *__pyx_v_oo_nnz = 0;
PetscInt __pyx_v_d_nz;
PetscInt __pyx_v_d_n;
PetscInt *__pyx_v_d_nnz;
PetscInt __pyx_v_o_nz;
PetscInt __pyx_v_o_n;
PetscInt *__pyx_v_o_nnz;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *(*__pyx_t_10)(PyObject *);
int __pyx_t_11;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("Mat_AllocAIJ_NNZ", 0);
/* "petsc4py/PETSc/petscmat.pxi":734
* 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":735
* #
* 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(20, 735, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":737
* 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":738
* # 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(20, 738, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":739
* 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) != 0);
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) != 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":740
* 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(20, 740, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":741
* 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())) {
if (unlikely(!((__pyx_v_bs > 0) != 0))) {
PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_block_size_not_set);
__PYX_ERR(20, 741, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscmat.pxi":739
* 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":744
* # 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":745
* 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(20, 745, __pyx_L6_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
#else
__pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 745, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 745, __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(20, 745, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
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(20, 745, __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(20, 745, __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":744
* # 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":746
* 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_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
if (__pyx_t_11) {
__Pyx_AddTraceback("petsc4py.PETSc.Mat_AllocAIJ_NNZ", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(20, 746, __pyx_L8_except_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_9);
/* "petsc4py/PETSc/petscmat.pxi":747
* 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;
__pyx_L8_except_error:;
/* "petsc4py/PETSc/petscmat.pxi":744
* # unpack NNZ argument
* cdef object od_nnz, oo_nnz
* try: # <<<<<<<<<<<<<<
* od_nnz, oo_nnz = NNZ
* except (TypeError, ValueError):
*/
__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":749
* 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":750
* # 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscmat.pxi":751
* 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(20, 751, __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":752
* 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_3 = ((__pyx_v_d_n == 0) != 0);
if (__pyx_t_3) {
__pyx_v_d_nnz = NULL;
goto __pyx_L17;
}
/* "petsc4py/PETSc/petscmat.pxi":753
* 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_3 = ((__pyx_v_d_n == 1) != 0);
if (__pyx_t_3) {
__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":750
* # 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":754
* 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":755
* 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_3 = (__pyx_v_oo_nnz != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":756
* 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(20, 756, __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":757
* 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) != 0);
if (__pyx_t_2) {
__pyx_v_o_nnz = NULL;
goto __pyx_L19;
}
/* "petsc4py/PETSc/petscmat.pxi":758
* 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) != 0);
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":755
* 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":759
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":760
* 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) != 0);
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) != 0);
__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":761
* 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) != 0);
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) != 0);
__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":759
* 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":763
* 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) != 0);
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) != 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L28_bool_binop_done:;
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/petscmat.pxi":765
* if d_n > 1 and d_n*bs != m: raise ValueError(
* "size(d_nnz) is %d, expected %d" %
* (toInt(d_n), toInt(m//bs)) ) # <<<<<<<<<<<<<<
* if o_n > 1 and o_n*bs != m: raise ValueError(
* "size(o_nnz) is %d, expected %d" %
*/
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_d_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 765, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m / __pyx_v_bs)); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 765, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 765, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
__pyx_t_9 = 0;
__pyx_t_7 = 0;
/* "petsc4py/PETSc/petscmat.pxi":764
* # check array sizes
* if d_n > 1 and d_n*bs != m: raise ValueError(
* "size(d_nnz) is %d, expected %d" % # <<<<<<<<<<<<<<
* (toInt(d_n), toInt(m//bs)) )
* if o_n > 1 and o_n*bs != m: raise ValueError(
*/
__pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_size_d_nnz_is_d_expected_d, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 764, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "petsc4py/PETSc/petscmat.pxi":763
* if o_n > 1 and o_n*bs > m: m = o_n*bs
* # check array sizes
* if d_n > 1 and d_n*bs != m: raise ValueError( # <<<<<<<<<<<<<<
* "size(d_nnz) is %d, expected %d" %
* (toInt(d_n), toInt(m//bs)) )
*/
__pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 763, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(20, 763, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":766
* "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) != 0);
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) != 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L31_bool_binop_done:;
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/petscmat.pxi":768
* if o_n > 1 and o_n*bs != m: raise ValueError(
* "size(o_nnz) is %d, expected %d" %
* (toInt(o_n), toInt(m//bs)) ) # <<<<<<<<<<<<<<
* # preallocate
* if aij == PETSC_TRUE:
*/
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_o_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m / __pyx_v_bs)); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
__pyx_t_8 = 0;
__pyx_t_7 = 0;
/* "petsc4py/PETSc/petscmat.pxi":767
* (toInt(d_n), toInt(m//bs)) )
* if o_n > 1 and o_n*bs != m: raise ValueError(
* "size(o_nnz) is %d, expected %d" % # <<<<<<<<<<<<<<
* (toInt(o_n), toInt(m//bs)) )
* # preallocate
*/
__pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_size_o_nnz_is_d_expected_d, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 767, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
/* "petsc4py/PETSc/petscmat.pxi":766
* "size(d_nnz) is %d, expected %d" %
* (toInt(d_n), toInt(m//bs)) )
* if o_n > 1 and o_n*bs != m: raise ValueError( # <<<<<<<<<<<<<<
* "size(o_nnz) is %d, expected %d" %
* (toInt(o_n), toInt(m//bs)) )
*/
__pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 766, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__PYX_ERR(20, 766, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":770
* (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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":771
* # 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(20, 771, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":772
* 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(20, 772, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":770
* (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":773
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":774
* 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(20, 774, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":775
* 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(20, 775, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":773
* 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":776
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":777
* 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(20, 777, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":778
* 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(20, 778, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":776
* 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":779
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":780
* 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(20, 780, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":779
* 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":781
* 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":732
* 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":783
* return PETSC_SUCCESS
*
* cdef inline PetscErrorCode Mat_AllocAIJ_CSR(PetscMat A, object CSR) except PETSC_ERR_PYTHON: # <<<<<<<<<<<<<<
* #
* cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE, aijis=PETSC_FALSE
*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_CSR(Mat __pyx_v_A, PyObject *__pyx_v_CSR) {
PetscBool __pyx_v_aij;
PetscBool __pyx_v_baij;
PetscBool __pyx_v_sbaij;
PetscBool __pyx_v_aijis;
PetscInt __pyx_v_m;
PetscInt __pyx_v_bs;
PyObject *__pyx_v_oi = 0;
PyObject *__pyx_v_oj = 0;
PyObject *__pyx_v_ov = 0;
PetscInt __pyx_v_ni;
PetscInt *__pyx_v_i;
PetscInt __pyx_v_nj;
PetscInt *__pyx_v_j;
PetscInt __pyx_v_nv;
PetscScalar *__pyx_v_v;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *(*__pyx_t_11)(PyObject *);
int __pyx_t_12;
PyObject *__pyx_t_13 = NULL;
PyObject *__pyx_t_14 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("Mat_AllocAIJ_CSR", 0);
/* "petsc4py/PETSc/petscmat.pxi":785
* 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":786
* #
* 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(20, 786, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":788
* 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":789
* # 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(20, 789, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":790
* 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) != 0);
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) != 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":791
* 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(20, 791, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":792
* 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())) {
if (unlikely(!((__pyx_v_bs > 0) != 0))) {
PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_block_size_not_set);
__PYX_ERR(20, 792, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscmat.pxi":790
* 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":795
* # 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":796
* 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(20, 796, __pyx_L6_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
__pyx_t_9 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
#else
__pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 796, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 796, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 796, __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(20, 796, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
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(20, 796, __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(20, 796, __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":795
* # 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":797
* try:
* oi, oj, ov = CSR
* except (TypeError, ValueError): # <<<<<<<<<<<<<<
* oi, oj = CSR; ov = None
* # rows, cols, and values
*/
__pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
if (__pyx_t_12) {
__Pyx_AddTraceback("petsc4py.PETSc.Mat_AllocAIJ_CSR", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7) < 0) __PYX_ERR(20, 797, __pyx_L8_except_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_7);
/* "petsc4py/PETSc/petscmat.pxi":798
* 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(20, 798, __pyx_L8_except_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_10 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_13 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_10 = PyList_GET_ITEM(sequence, 0);
__pyx_t_13 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(__pyx_t_13);
#else
__pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(20, 798, __pyx_L8_except_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(20, 798, __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(20, 798, __pyx_L8_except_error)
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_11 = Py_TYPE(__pyx_t_14)->tp_iternext;
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(20, 798, __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(20, 798, __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;
__pyx_L8_except_error:;
/* "petsc4py/PETSc/petscmat.pxi":795
* # unpack CSR argument
* cdef object oi, oj, ov
* try: # <<<<<<<<<<<<<<
* oi, oj, ov = CSR
* except (TypeError, ValueError):
*/
__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":800
* 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":801
* # 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":802
* 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":803
* 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":804
* 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(20, 804, __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":805
* 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(20, 805, __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":806
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscmat.pxi":807
* 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(20, 807, __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":806
* 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":808
* 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_3 = ((__pyx_v_m == PETSC_DECIDE) != 0);
if (__pyx_t_3) {
__pyx_v_m = ((__pyx_v_ni - 1) * __pyx_v_bs);
}
/* "petsc4py/PETSc/petscmat.pxi":810
* 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_3 = ((((__pyx_v_ni - 1) * __pyx_v_bs) != __pyx_v_m) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscmat.pxi":812
* if ((ni-1)*bs != m):
* raise ValueError("size(I) is %d, expected %d" %
* (toInt(ni), toInt(m//bs+1)) ) # <<<<<<<<<<<<<<
* if (i[0] != 0):
* raise ValueError("I[0] is %d, expected %d" %
*/
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 812, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(((__pyx_v_m / __pyx_v_bs) + 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 812, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 812, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
__pyx_t_7 = 0;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/petscmat.pxi":811
* # check array sizes
* if ((ni-1)*bs != m):
* raise ValueError("size(I) is %d, expected %d" % # <<<<<<<<<<<<<<
* (toInt(ni), toInt(m//bs+1)) )
* if (i[0] != 0):
*/
__pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_size_I_is_d_expected_d, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 811, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 811, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__PYX_ERR(20, 811, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":810
* 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":813
* 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_3 = (((__pyx_v_i[0]) != 0) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscmat.pxi":815
* if (i[0] != 0):
* raise ValueError("I[0] is %d, expected %d" %
* (toInt(i[0]), toInt(0)) ) # <<<<<<<<<<<<<<
* if (i[ni-1] != nj):
* raise ValueError("size(J) is %d, expected %d" %
*/
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[0])); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 815, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 815, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 815, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
__pyx_t_9 = 0;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/petscmat.pxi":814
* (toInt(ni), toInt(m//bs+1)) )
* if (i[0] != 0):
* raise ValueError("I[0] is %d, expected %d" % # <<<<<<<<<<<<<<
* (toInt(i[0]), toInt(0)) )
* if (i[ni-1] != nj):
*/
__pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_I_0_is_d_expected_d, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 814, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 814, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_Raise(__pyx_t_7, 0, 0, 0);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__PYX_ERR(20, 814, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":813
* 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":816
* 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_3 = (((__pyx_v_i[(__pyx_v_ni - 1)]) != __pyx_v_nj) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscmat.pxi":818
* if (i[ni-1] != nj):
* raise ValueError("size(J) is %d, expected %d" %
* (toInt(nj), toInt(i[ni-1])) ) # <<<<<<<<<<<<<<
* if v != NULL and (nj*bs*bs != nv):
* raise ValueError("size(V) is %d, expected %d" %
*/
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 818, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[(__pyx_v_ni - 1)])); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 818, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 818, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
__pyx_t_7 = 0;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/petscmat.pxi":817
* (toInt(i[0]), toInt(0)) )
* if (i[ni-1] != nj):
* raise ValueError("size(J) is %d, expected %d" % # <<<<<<<<<<<<<<
* (toInt(nj), toInt(i[ni-1])) )
* if v != NULL and (nj*bs*bs != nv):
*/
__pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_size_J_is_d_expected_d, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 817, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 817, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__PYX_ERR(20, 817, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":816
* 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":819
* 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_2 = ((__pyx_v_v != NULL) != 0);
if (__pyx_t_2) {
} else {
__pyx_t_3 = __pyx_t_2;
goto __pyx_L24_bool_binop_done;
}
__pyx_t_2 = ((((__pyx_v_nj * __pyx_v_bs) * __pyx_v_bs) != __pyx_v_nv) != 0);
__pyx_t_3 = __pyx_t_2;
__pyx_L24_bool_binop_done:;
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscmat.pxi":821
* if v != NULL and (nj*bs*bs != nv):
* raise ValueError("size(V) is %d, expected %d" %
* (toInt(nv), toInt(nj*bs*bs)) ) # <<<<<<<<<<<<<<
* # preallocate
* if aij == PETSC_TRUE:
*/
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 821, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(((__pyx_v_nj * __pyx_v_bs) * __pyx_v_bs)); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 821, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 821, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
__pyx_t_9 = 0;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/petscmat.pxi":820
* (toInt(nj), toInt(i[ni-1])) )
* if v != NULL and (nj*bs*bs != nv):
* raise ValueError("size(V) is %d, expected %d" % # <<<<<<<<<<<<<<
* (toInt(nv), toInt(nj*bs*bs)) )
* # preallocate
*/
__pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_size_V_is_d_expected_d, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 820, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 820, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_Raise(__pyx_t_7, 0, 0, 0);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__PYX_ERR(20, 820, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":819
* 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":823
* (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_3 = ((__pyx_v_aij == PETSC_TRUE) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscmat.pxi":824
* # 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(20, 824, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":825
* 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(20, 825, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":823
* (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":826
* 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_3 = ((__pyx_v_baij == PETSC_TRUE) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscmat.pxi":827
* 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(20, 827, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":828
* 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(20, 828, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":826
* 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":829
* 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_3 = ((__pyx_v_sbaij == PETSC_TRUE) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscmat.pxi":830
* 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(20, 830, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":831
* 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(20, 831, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":829
* 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":832
* 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":783
* 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":834
* 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;
__Pyx_RefNannyDeclarations
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;
__Pyx_RefNannySetupContext("Mat_AllocAIJ", 0);
/* "petsc4py/PETSc/petscmat.pxi":835
*
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":836
* 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_3 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_CSR(__pyx_v_A, __pyx_v_CSR); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 836, __pyx_L1_error)
__pyx_r = __pyx_t_3;
goto __pyx_L0;
/* "petsc4py/PETSc/petscmat.pxi":835
*
* 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":837
* 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_2 = (__pyx_v_NNZ != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscmat.pxi":838
* return Mat_AllocAIJ_CSR(A, CSR)
* if NNZ is not None:
* return Mat_AllocAIJ_NNZ(A, NNZ) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_NNZ(__pyx_v_A, __pyx_v_NNZ); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 838, __pyx_L1_error)
__pyx_r = __pyx_t_3;
goto __pyx_L0;
/* "petsc4py/PETSc/petscmat.pxi":837
* 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":839
* 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":834
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":841
* 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;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
int __pyx_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":842
*
* 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":843
* 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(20, 843, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":844
* 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(20, 844, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":845
* 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":846
* 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":847
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscmat.pxi":848
* 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_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ofarray_s(__pyx_v_array, (&__pyx_v_size), (&__pyx_v_data))); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 848, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_array, __pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":849
* 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_3 = (((__pyx_v_m * __pyx_v_N) != __pyx_v_size) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscmat.pxi":851
* 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_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 851, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 851, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 851, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m * __pyx_v_N)); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 851, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 851, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
__pyx_t_4 = 0;
__pyx_t_5 = 0;
__pyx_t_6 = 0;
__pyx_t_7 = 0;
/* "petsc4py/PETSc/petscmat.pxi":850
* 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_7 = __Pyx_PyString_Format(__pyx_kp_s_size_array_is_d_expected_dx_d_d, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 850, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "petsc4py/PETSc/petscmat.pxi":849
* 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_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 849, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(20, 849, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":847
* 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":852
* "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(20, 852, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":853
* (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(20, 853, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":854
* 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":841
* 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_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.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":863
* 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;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
__Pyx_RefNannySetupContext("matsetvalues_fcn", 0);
/* "petsc4py/PETSc/petscmat.pxi":864
*
* 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":865
* 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":866
* 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":867
* 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":868
* elif blocked: setvalues = MatSetValuesBlocked
* elif local: setvalues = MatSetValuesLocal
* else: setvalues = MatSetValues # <<<<<<<<<<<<<<
* return setvalues
*
*/
/*else*/ {
__pyx_v_setvalues = MatSetValues;
}
__pyx_L3:;
/* "petsc4py/PETSc/petscmat.pxi":869
* 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":863
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":871
* 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;
InsertMode __pyx_t_7;
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":875
* 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":876
* # 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(20, 876, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":877
* 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) != 0);
if (__pyx_t_1) {
__pyx_v_rbs = 1;
}
/* "petsc4py/PETSc/petscmat.pxi":878
* 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) != 0);
if (__pyx_t_1) {
__pyx_v_cbs = 1;
}
/* "petsc4py/PETSc/petscmat.pxi":880
* 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":881
* # 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":882
* 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":883
* 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":884
* 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(20, 884, __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":885
* 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(20, 885, __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":886
* 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(20, 886, __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":887
* 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) != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/petscmat.pxi":889
* if ni*nj*rbs*cbs != nv: raise ValueError(
* "incompatible array sizes: ni=%d, nj=%d, nv=%d" %
* (toInt(ni), toInt(nj), toInt(nv)) ) # <<<<<<<<<<<<<<
* # MatSetValuesXXX function and insert mode
* cdef MatSetValuesFcn *setvalues = matsetvalues_fcn(blocked, local)
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 889, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 889, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 889, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 889, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscmat.pxi":888
* ov = iarray_s(ov, &nv, &v)
* if ni*nj*rbs*cbs != nv: raise ValueError(
* "incompatible array sizes: ni=%d, nj=%d, nv=%d" % # <<<<<<<<<<<<<<
* (toInt(ni), toInt(nj), toInt(nv)) )
* # MatSetValuesXXX function and insert mode
*/
__pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_incompatible_array_sizes_ni_d_nj, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 888, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscmat.pxi":887
* oj = iarray_i(oj, &nj, &j)
* ov = iarray_s(ov, &nv, &v)
* if ni*nj*rbs*cbs != nv: raise ValueError( # <<<<<<<<<<<<<<
* "incompatible array sizes: ni=%d, nj=%d, nv=%d" %
* (toInt(ni), toInt(nj), toInt(nv)) )
*/
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 887, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__PYX_ERR(20, 887, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":891
* (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_v_setvalues = __pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(__pyx_v_blocked, __pyx_v_local);
/* "petsc4py/PETSc/petscmat.pxi":892
* # 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_7 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oaddv); if (unlikely(__pyx_t_7 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(20, 892, __pyx_L1_error)
__pyx_v_addv = __pyx_t_7;
/* "petsc4py/PETSc/petscmat.pxi":894
* cdef PetscInsertMode addv = insertmode(oaddv)
* # actual call
* CHKERR( setvalues(A, ni, i, nj, j, v, addv) ) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__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(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 894, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":895
* # 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":871
* return setvalues
*
* cdef inline PetscErrorCode matsetvalues(PetscMat A, # <<<<<<<<<<<<<<
* object oi, object oj, object ov,
* object oaddv, int blocked, int local) except PETSC_ERR_PYTHON:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("petsc4py.PETSc.matsetvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_oi);
__Pyx_XDECREF(__pyx_v_oj);
__Pyx_XDECREF(__pyx_v_ov);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":897
* return PETSC_SUCCESS
*
* cdef inline PetscErrorCode matsetvalues_rcv(PetscMat A, # <<<<<<<<<<<<<<
* object oi, object oj, object ov,
* object oaddv,
*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_matsetvalues_rcv(Mat __pyx_v_A, PyObject *__pyx_v_oi, PyObject *__pyx_v_oj, PyObject *__pyx_v_ov, PyObject *__pyx_v_oaddv, int __pyx_v_blocked, int __pyx_v_local) {
PetscInt __pyx_v_rbs;
PetscInt __pyx_v_cbs;
PetscInt __pyx_v_ni;
PetscInt *__pyx_v_i;
PetscInt __pyx_v_nj;
PetscInt *__pyx_v_j;
PetscInt __pyx_v_nv;
PetscScalar *__pyx_v_v;
PyArrayObject *__pyx_v_ai = 0;
PyArrayObject *__pyx_v_aj = 0;
PyArrayObject *__pyx_v_av = 0;
Py_ssize_t __pyx_v_nm;
Py_ssize_t __pyx_v_si;
Py_ssize_t __pyx_v_sj;
Py_ssize_t __pyx_v_sv;
__pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_v_setvalues;
InsertMode __pyx_v_addv;
Py_ssize_t __pyx_v_k;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
InsertMode __pyx_t_8;
Py_ssize_t __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("matsetvalues_rcv", 0);
/* "petsc4py/PETSc/petscmat.pxi":902
* 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":903
* # 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(20, 903, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":904
* 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) != 0);
if (__pyx_t_1) {
__pyx_v_rbs = 1;
}
/* "petsc4py/PETSc/petscmat.pxi":905
* 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) != 0);
if (__pyx_t_1) {
__pyx_v_cbs = 1;
}
/* "petsc4py/PETSc/petscmat.pxi":907
* 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":908
* # 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":909
* 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":910
* 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":911
* 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(20, 911, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_ai = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscmat.pxi":912
* 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(20, 912, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_aj = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscmat.pxi":913
* 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(20, 913, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_av = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscmat.pxi":915
* 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) != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/petscmat.pxi":917
* if PyArray_NDIM(ai) != 2: raise ValueError(
* ("row indices must have two dimensions: "
* "rows.ndim=%d") % (PyArray_NDIM(ai)) ) # <<<<<<<<<<<<<<
* elif not PyArray_ISCONTIGUOUS(ai): raise ValueError(
* "expecting a C-contiguous array")
*/
__pyx_t_3 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_ai)); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_row_indices_must_have_two_dimens, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/petscmat.pxi":915
* cdef ndarray av = iarray_s(ov, &nv, &v)
* # check various dimensions
* if PyArray_NDIM(ai) != 2: raise ValueError( # <<<<<<<<<<<<<<
* ("row indices must have two dimensions: "
* "rows.ndim=%d") % (PyArray_NDIM(ai)) )
*/
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 915, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(20, 915, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":918
* ("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) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 918, __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(20, 918, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":920
* 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) != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/petscmat.pxi":922
* if PyArray_NDIM(aj) != 2: raise ValueError(
* ("column indices must have two dimensions: "
* "cols.ndim=%d") % (PyArray_NDIM(aj)) ) # <<<<<<<<<<<<<<
* elif not PyArray_ISCONTIGUOUS(aj): raise ValueError(
* "expecting a C-contiguous array")
*/
__pyx_t_3 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_aj)); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 922, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_column_indices_must_have_two_dim, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 922, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/petscmat.pxi":920
* elif not PyArray_ISCONTIGUOUS(ai): raise ValueError(
* "expecting a C-contiguous array")
* if PyArray_NDIM(aj) != 2: raise ValueError( # <<<<<<<<<<<<<<
* ("column indices must have two dimensions: "
* "cols.ndim=%d") % (PyArray_NDIM(aj)) )
*/
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 920, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(20, 920, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":923
* ("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) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 923, __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(20, 923, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":925
* 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) != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/petscmat.pxi":927
* if PyArray_NDIM(av) < 2: raise ValueError(
* ("values must have two or more dimensions: "
* "vals.ndim=%d") % (PyArray_NDIM(av)) ) # <<<<<<<<<<<<<<
* elif not PyArray_ISCONTIGUOUS(av): raise ValueError(
* "expecting a C-contiguous array")
*/
__pyx_t_3 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_av)); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 927, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_values_must_have_two_or_more_dim, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 927, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/petscmat.pxi":925
* elif not PyArray_ISCONTIGUOUS(aj): raise ValueError(
* "expecting a C-contiguous array")
* if PyArray_NDIM(av) < 2: raise ValueError( # <<<<<<<<<<<<<<
* ("values must have two or more dimensions: "
* "vals.ndim=%d") % (PyArray_NDIM(av)) )
*/
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 925, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(20, 925, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":928
* ("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) != 0)) != 0);
if (unlikely(__pyx_t_1)) {
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 928, __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(20, 928, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":931
* "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":932
* # 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_SIZE(av) // PyArray_DIM(av, 0)
*/
__pyx_v_si = PyArray_DIM(__pyx_v_ai, 1);
/* "petsc4py/PETSc/petscmat.pxi":933
* 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_SIZE(av) // PyArray_DIM(av, 0)
* if ((nm != PyArray_DIM(aj, 0)) or
*/
__pyx_v_sj = PyArray_DIM(__pyx_v_aj, 1);
/* "petsc4py/PETSc/petscmat.pxi":934
* cdef Py_ssize_t si = PyArray_DIM(ai, 1)
* cdef Py_ssize_t sj = PyArray_DIM(aj, 1)
* cdef Py_ssize_t sv = PyArray_SIZE(av) // PyArray_DIM(av, 0) # <<<<<<<<<<<<<<
* if ((nm != PyArray_DIM(aj, 0)) or
* (nm != PyArray_DIM(av, 0)) or
*/
__pyx_v_sv = (PyArray_SIZE(__pyx_v_av) / PyArray_DIM(__pyx_v_av, 0));
/* "petsc4py/PETSc/petscmat.pxi":935
* cdef Py_ssize_t sj = PyArray_DIM(aj, 1)
* cdef Py_ssize_t sv = PyArray_SIZE(av) // PyArray_DIM(av, 0)
* if ((nm != PyArray_DIM(aj, 0)) or # <<<<<<<<<<<<<<
* (nm != PyArray_DIM(av, 0)) or
* (si*rbs * sj*cbs != sv)): raise ValueError(
*/
__pyx_t_5 = ((__pyx_v_nm != PyArray_DIM(__pyx_v_aj, 0)) != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_1 = __pyx_t_5;
goto __pyx_L10_bool_binop_done;
}
/* "petsc4py/PETSc/petscmat.pxi":936
* cdef Py_ssize_t sv = PyArray_SIZE(av) // PyArray_DIM(av, 0)
* if ((nm != PyArray_DIM(aj, 0)) or
* (nm != PyArray_DIM(av, 0)) or # <<<<<<<<<<<<<<
* (si*rbs * sj*cbs != sv)): raise ValueError(
* ("input arrays have incompatible shapes: "
*/
__pyx_t_5 = ((__pyx_v_nm != PyArray_DIM(__pyx_v_av, 0)) != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_1 = __pyx_t_5;
goto __pyx_L10_bool_binop_done;
}
/* "petsc4py/PETSc/petscmat.pxi":937
* if ((nm != PyArray_DIM(aj, 0)) or
* (nm != PyArray_DIM(av, 0)) or
* (si*rbs * sj*cbs != sv)): raise ValueError( # <<<<<<<<<<<<<<
* ("input arrays have incompatible shapes: "
* "rows.shape=%s, cols.shape=%s, vals.shape=%s") %
*/
__pyx_t_5 = (((((__pyx_v_si * __pyx_v_rbs) * __pyx_v_sj) * __pyx_v_cbs) != __pyx_v_sv) != 0);
__pyx_t_1 = __pyx_t_5;
__pyx_L10_bool_binop_done:;
/* "petsc4py/PETSc/petscmat.pxi":935
* cdef Py_ssize_t sj = PyArray_DIM(aj, 1)
* cdef Py_ssize_t sv = PyArray_SIZE(av) // PyArray_DIM(av, 0)
* 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":940
* ("input arrays have incompatible shapes: "
* "rows.shape=%s, cols.shape=%s, vals.shape=%s") %
* (ai.shape, aj.shape, av.shape)) # <<<<<<<<<<<<<<
* # MatSetValuesXXX function and insert mode
* cdef MatSetValuesFcn *setvalues = \
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ai), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 940, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_aj), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 940, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_av), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 940, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 940, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscmat.pxi":939
* (si*rbs * sj*cbs != sv)): raise ValueError(
* ("input arrays have incompatible shapes: "
* "rows.shape=%s, cols.shape=%s, vals.shape=%s") % # <<<<<<<<<<<<<<
* (ai.shape, aj.shape, av.shape))
* # MatSetValuesXXX function and insert mode
*/
__pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_input_arrays_have_incompatible_s, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 939, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "petsc4py/PETSc/petscmat.pxi":937
* if ((nm != PyArray_DIM(aj, 0)) or
* (nm != PyArray_DIM(av, 0)) or
* (si*rbs * sj*cbs != sv)): raise ValueError( # <<<<<<<<<<<<<<
* ("input arrays have incompatible shapes: "
* "rows.shape=%s, cols.shape=%s, vals.shape=%s") %
*/
__pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 937, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_Raise(__pyx_t_7, 0, 0, 0);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__PYX_ERR(20, 937, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":935
* cdef Py_ssize_t sj = PyArray_DIM(aj, 1)
* cdef Py_ssize_t sv = PyArray_SIZE(av) // PyArray_DIM(av, 0)
* if ((nm != PyArray_DIM(aj, 0)) or # <<<<<<<<<<<<<<
* (nm != PyArray_DIM(av, 0)) or
* (si*rbs * sj*cbs != sv)): raise ValueError(
*/
}
/* "petsc4py/PETSc/petscmat.pxi":943
* # MatSetValuesXXX function and insert mode
* cdef MatSetValuesFcn *setvalues = \
* matsetvalues_fcn(blocked, local) # <<<<<<<<<<<<<<
* cdef PetscInsertMode addv = insertmode(oaddv)
* # actual calls
*/
__pyx_v_setvalues = __pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(__pyx_v_blocked, __pyx_v_local);
/* "petsc4py/PETSc/petscmat.pxi":944
* cdef MatSetValuesFcn *setvalues = \
* matsetvalues_fcn(blocked, local)
* cdef PetscInsertMode addv = insertmode(oaddv) # <<<<<<<<<<<<<<
* # actual calls
* cdef Py_ssize_t k=0
*/
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oaddv); if (unlikely(__pyx_t_8 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(20, 944, __pyx_L1_error)
__pyx_v_addv = __pyx_t_8;
/* "petsc4py/PETSc/petscmat.pxi":946
* 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":947
* # actual calls
* cdef Py_ssize_t k=0
* for k from 0 <= k < nm: # <<<<<<<<<<<<<<
* CHKERR( setvalues(A,
* <PetscInt>si, &i[k*si],
*/
__pyx_t_9 = __pyx_v_nm;
for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_9; __pyx_v_k++) {
/* "petsc4py/PETSc/petscmat.pxi":948
* 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_f_8petsc4py_5PETSc_CHKERR(__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(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 948, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":952
* <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":897
* return PETSC_SUCCESS
*
* cdef inline PetscErrorCode matsetvalues_rcv(PetscMat A, # <<<<<<<<<<<<<<
* object oi, object oj, object ov,
* object oaddv,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.matsetvalues_rcv", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ai);
__Pyx_XDECREF((PyObject *)__pyx_v_aj);
__Pyx_XDECREF((PyObject *)__pyx_v_av);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":954
* return PETSC_SUCCESS
*
* cdef inline PetscErrorCode matsetvalues_ijv(PetscMat A, # <<<<<<<<<<<<<<
* object oi, object oj, object ov,
* object oaddv,
*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(Mat __pyx_v_A, PyObject *__pyx_v_oi, PyObject *__pyx_v_oj, PyObject *__pyx_v_ov, PyObject *__pyx_v_oaddv, PyObject *__pyx_v_om, int __pyx_v_blocked, int __pyx_v_local) {
PetscInt __pyx_v_rbs;
PetscInt __pyx_v_cbs;
PetscInt __pyx_v_ni;
PetscInt *__pyx_v_i;
PetscInt __pyx_v_nj;
PetscInt *__pyx_v_j;
PetscInt __pyx_v_nv;
PetscScalar *__pyx_v_v;
PetscInt __pyx_v_nm;
PetscInt *__pyx_v_m;
PetscInt __pyx_v_rs;
PetscInt __pyx_v_re;
__pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_v_setvalues;
InsertMode __pyx_v_addv;
PetscInt __pyx_v_k;
PetscInt __pyx_v_l;
PetscInt __pyx_v_irow;
PetscInt __pyx_v_ncol;
PetscInt *__pyx_v_icol;
PetscScalar *__pyx_v_sval;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
InsertMode __pyx_t_7;
PetscInt __pyx_t_8;
PetscInt __pyx_t_9;
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":960
* 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":961
* # 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(20, 961, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":962
* 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) != 0);
if (__pyx_t_1) {
__pyx_v_rbs = 1;
}
/* "petsc4py/PETSc/petscmat.pxi":963
* 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) != 0);
if (__pyx_t_1) {
__pyx_v_cbs = 1;
}
/* "petsc4py/PETSc/petscmat.pxi":965
* 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":966
* # 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":967
* 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":968
* 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":969
* 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(20, 969, __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":970
* 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(20, 970, __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":971
* 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(20, 971, __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":973
* 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":974
* # 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":975
* 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);
__pyx_t_4 = (__pyx_t_1 != 0);
if (__pyx_t_4) {
/* "petsc4py/PETSc/petscmat.pxi":976
* 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(20, 976, __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":975
* 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":978
* om = iarray_i(om, &nm, &m)
* else:
* if not local: # <<<<<<<<<<<<<<
* CHKERR( MatGetOwnershipRange(A, &rs, &re) )
* rs //= rbs; re //= rbs
*/
/*else*/ {
__pyx_t_4 = ((!(__pyx_v_local != 0)) != 0);
if (__pyx_t_4) {
/* "petsc4py/PETSc/petscmat.pxi":979
* 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(20, 979, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":980
* 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":978
* om = iarray_i(om, &nm, &m)
* else:
* if not local: # <<<<<<<<<<<<<<
* CHKERR( MatGetOwnershipRange(A, &rs, &re) )
* rs //= rbs; re //= rbs
*/
}
/* "petsc4py/PETSc/petscmat.pxi":981
* 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":983
* 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_4 = (((__pyx_v_ni - 1) != __pyx_v_nm) != 0);
if (unlikely(__pyx_t_4)) {
/* "petsc4py/PETSc/petscmat.pxi":985
* if (ni-1 != nm): raise ValueError(
* "size(I) is %d, expected %d" %
* (toInt(ni), toInt(nm+1)) ) # <<<<<<<<<<<<<<
* if (i[0] != 0):raise ValueError(
* "I[0] is %d, expected %d" %
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 985, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_nm + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 985, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 985, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscmat.pxi":984
* # 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_PyString_Format(__pyx_kp_s_size_I_is_d_expected_d, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 984, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscmat.pxi":983
* 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_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 983, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__PYX_ERR(20, 983, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":986
* "size(I) is %d, expected %d" %
* (toInt(ni), toInt(nm+1)) )
* if (i[0] != 0):raise ValueError( # <<<<<<<<<<<<<<
* "I[0] is %d, expected %d" %
* (toInt(i[0]), 0) )
*/
__pyx_t_4 = (((__pyx_v_i[0]) != 0) != 0);
if (unlikely(__pyx_t_4)) {
/* "petsc4py/PETSc/petscmat.pxi":988
* 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_6 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 988, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 988, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
__Pyx_INCREF(__pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscmat.pxi":987
* (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_PyString_Format(__pyx_kp_s_I_0_is_d_expected_d, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 987, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscmat.pxi":986
* "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_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 986, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(20, 986, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":989
* "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_4 = (((__pyx_v_i[(__pyx_v_ni - 1)]) != __pyx_v_nj) != 0);
if (unlikely(__pyx_t_4)) {
/* "petsc4py/PETSc/petscmat.pxi":991
* 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(20, 991, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[(__pyx_v_ni - 1)])); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 991, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 991, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
__pyx_t_5 = 0;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscmat.pxi":990
* (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_6 = __Pyx_PyString_Format(__pyx_kp_s_size_J_is_d_expected_d, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 990, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/petscmat.pxi":989
* "I[0] is %d, expected %d" %
* (toInt(i[0]), 0) )
* if (i[ni-1] != nj): raise ValueError( # <<<<<<<<<<<<<<
* "size(J) is %d, expected %d" %
* (toInt(nj), toInt(i[ni-1])) )
*/
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 989, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(20, 989, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":992
* "size(J) is %d, expected %d" %
* (toInt(nj), toInt(i[ni-1])) )
* if (nj*rbs*cbs != nv): raise ValueError( # <<<<<<<<<<<<<<
* "size(V) is %d, expected %d" %
* (toInt(nv), toInt(nj*rbs*cbs)) )
*/
__pyx_t_4 = ((((__pyx_v_nj * __pyx_v_rbs) * __pyx_v_cbs) != __pyx_v_nv) != 0);
if (unlikely(__pyx_t_4)) {
/* "petsc4py/PETSc/petscmat.pxi":994
* if (nj*rbs*cbs != nv): raise ValueError(
* "size(V) is %d, expected %d" %
* (toInt(nv), toInt(nj*rbs*cbs)) ) # <<<<<<<<<<<<<<
* # MatSetValuesXXX function and insert mode
* cdef MatSetValuesFcn *setvalues = \
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 994, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(((__pyx_v_nj * __pyx_v_rbs) * __pyx_v_cbs)); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 994, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 994, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
__pyx_t_3 = 0;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscmat.pxi":993
* (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_PyString_Format(__pyx_kp_s_size_V_is_d_expected_d, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 993, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscmat.pxi":992
* "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_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 992, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(20, 992, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":997
* # MatSetValuesXXX function and insert mode
* cdef MatSetValuesFcn *setvalues = \
* matsetvalues_fcn(blocked, local) # <<<<<<<<<<<<<<
* cdef PetscInsertMode addv = insertmode(oaddv)
* # actual call
*/
__pyx_v_setvalues = __pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(__pyx_v_blocked, __pyx_v_local);
/* "petsc4py/PETSc/petscmat.pxi":998
* cdef MatSetValuesFcn *setvalues = \
* matsetvalues_fcn(blocked, local)
* cdef PetscInsertMode addv = insertmode(oaddv) # <<<<<<<<<<<<<<
* # actual call
* cdef PetscInt k=0, l=0
*/
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oaddv); if (unlikely(__pyx_t_7 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(20, 998, __pyx_L1_error)
__pyx_v_addv = __pyx_t_7;
/* "petsc4py/PETSc/petscmat.pxi":1000
* cdef PetscInsertMode addv = insertmode(oaddv)
* # actual call
* cdef PetscInt k=0, l=0 # <<<<<<<<<<<<<<
* cdef PetscInt irow=0, ncol=0, *icol=NULL
* cdef PetscScalar *sval=NULL
*/
__pyx_v_k = 0;
__pyx_v_l = 0;
/* "petsc4py/PETSc/petscmat.pxi":1001
* # actual call
* cdef PetscInt k=0, l=0
* cdef PetscInt irow=0, ncol=0, *icol=NULL # <<<<<<<<<<<<<<
* cdef PetscScalar *sval=NULL
* for k from 0 <= k < nm:
*/
__pyx_v_irow = 0;
__pyx_v_ncol = 0;
__pyx_v_icol = NULL;
/* "petsc4py/PETSc/petscmat.pxi":1002
* cdef PetscInt k=0, l=0
* cdef PetscInt irow=0, ncol=0, *icol=NULL
* cdef PetscScalar *sval=NULL # <<<<<<<<<<<<<<
* for k from 0 <= k < nm:
* irow = m[k] if m!=NULL else rs+k
*/
__pyx_v_sval = NULL;
/* "petsc4py/PETSc/petscmat.pxi":1003
* cdef PetscInt irow=0, ncol=0, *icol=NULL
* cdef PetscScalar *sval=NULL
* for k from 0 <= k < nm: # <<<<<<<<<<<<<<
* irow = m[k] if m!=NULL else rs+k
* ncol = i[k+1] - i[k]
*/
__pyx_t_8 = __pyx_v_nm;
for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_8; __pyx_v_k++) {
/* "petsc4py/PETSc/petscmat.pxi":1004
* 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]
*/
if (((__pyx_v_m != NULL) != 0)) {
__pyx_t_9 = (__pyx_v_m[__pyx_v_k]);
} else {
__pyx_t_9 = (__pyx_v_rs + __pyx_v_k);
}
__pyx_v_irow = __pyx_t_9;
/* "petsc4py/PETSc/petscmat.pxi":1005
* 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":1006
* 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":1007
* ncol = i[k+1] - i[k]
* icol = j + i[k]
* if blocked: # <<<<<<<<<<<<<<
* sval = v + i[k]*rbs*cbs
* for l from 0 <= l < ncol:
*/
__pyx_t_4 = (__pyx_v_blocked != 0);
if (__pyx_t_4) {
/* "petsc4py/PETSc/petscmat.pxi":1008
* icol = j + i[k]
* if blocked:
* sval = v + i[k]*rbs*cbs # <<<<<<<<<<<<<<
* for l from 0 <= l < ncol:
* CHKERR( setvalues(A, 1, &irow, 1, &icol[l],
*/
__pyx_v_sval = (__pyx_v_v + (((__pyx_v_i[__pyx_v_k]) * __pyx_v_rbs) * __pyx_v_cbs));
/* "petsc4py/PETSc/petscmat.pxi":1009
* if blocked:
* sval = v + i[k]*rbs*cbs
* for l from 0 <= l < ncol: # <<<<<<<<<<<<<<
* CHKERR( setvalues(A, 1, &irow, 1, &icol[l],
* &sval[l*rbs*cbs], addv) )
*/
__pyx_t_9 = __pyx_v_ncol;
for (__pyx_v_l = 0; __pyx_v_l < __pyx_t_9; __pyx_v_l++) {
/* "petsc4py/PETSc/petscmat.pxi":1010
* sval = v + i[k]*rbs*cbs
* for l from 0 <= l < ncol:
* CHKERR( setvalues(A, 1, &irow, 1, &icol[l], # <<<<<<<<<<<<<<
* &sval[l*rbs*cbs], addv) )
* else:
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_v_setvalues(__pyx_v_A, 1, (&__pyx_v_irow), 1, (&(__pyx_v_icol[__pyx_v_l])), (&(__pyx_v_sval[((__pyx_v_l * __pyx_v_rbs) * __pyx_v_cbs)])), __pyx_v_addv)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 1010, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":1007
* ncol = i[k+1] - i[k]
* icol = j + i[k]
* if blocked: # <<<<<<<<<<<<<<
* sval = v + i[k]*rbs*cbs
* for l from 0 <= l < ncol:
*/
goto __pyx_L14;
}
/* "petsc4py/PETSc/petscmat.pxi":1013
* &sval[l*rbs*cbs], addv) )
* else:
* sval = v + i[k] # <<<<<<<<<<<<<<
* CHKERR( setvalues(A, 1, &irow, ncol, icol, sval, addv) )
* return PETSC_SUCCESS
*/
/*else*/ {
__pyx_v_sval = (__pyx_v_v + (__pyx_v_i[__pyx_v_k]));
/* "petsc4py/PETSc/petscmat.pxi":1014
* else:
* sval = v + i[k]
* CHKERR( setvalues(A, 1, &irow, ncol, icol, sval, addv) ) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_v_setvalues(__pyx_v_A, 1, (&__pyx_v_irow), __pyx_v_ncol, __pyx_v_icol, __pyx_v_sval, __pyx_v_addv)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 1014, __pyx_L1_error)
}
__pyx_L14:;
}
/* "petsc4py/PETSc/petscmat.pxi":1015
* sval = v + i[k]
* CHKERR( setvalues(A, 1, &irow, ncol, icol, sval, addv) )
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef inline PetscErrorCode matsetvalues_csr(PetscMat A,
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscmat.pxi":954
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__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":1017
* 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;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("matsetvalues_csr", 0);
/* "petsc4py/PETSc/petscmat.pxi":1021
* 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(20, 1021, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1022
* 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":1017
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":1024
* 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;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
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("matgetvalues", 0);
__Pyx_INCREF(__pyx_v_values);
/* "petsc4py/PETSc/petscmat.pxi":1026
* 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":1027
* 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":1028
* 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":1029
* 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(20, 1029, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_rows = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1030
* 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(20, 1030, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_cols = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1031
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscmat.pxi":1032
* 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(20, 1032, __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":1033
* if values is None:
* values = empty_s(ni*nj)
* values.shape = rows.shape + cols.shape # <<<<<<<<<<<<<<
* values = oarray_s(values, &nv, &v)
* if (ni*nj != nv): raise ValueError(
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rows), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1033, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cols), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1033, __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(20, 1033, __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 (__Pyx_PyObject_SetAttrStr(__pyx_v_values, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(20, 1033, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1031
* 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":1034
* 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_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_values, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 1034, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF_SET(__pyx_v_values, __pyx_t_5);
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1035
* 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_3 = (((__pyx_v_ni * __pyx_v_nj) != __pyx_v_nv) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscmat.pxi":1037
* 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_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 1037, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1037, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1037, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 1037, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1);
__pyx_t_5 = 0;
__pyx_t_4 = 0;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1036
* values = oarray_s(values, &nv, &v)
* if (ni*nj != nv): raise ValueError(
* "incompatible array sizes: ni=%d, nj=%d, nv=%d" % # <<<<<<<<<<<<<<
* (toInt(ni), toInt(nj), toInt(nv)))
* CHKERR( MatGetValues(mat, ni, i, nj, j, v) )
*/
__pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_incompatible_array_sizes_ni_d_nj, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1036, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1035
* 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_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 1035, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__PYX_ERR(20, 1035, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":1038
* "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_7 = __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_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 1038, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1039
* (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":1024
* 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_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__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":1046
* 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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
MatFactorShiftType __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("matfactorshifttype", 0);
/* "petsc4py/PETSc/petscmat.pxi":1048
* 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 = PyString_Check(__pyx_v_st);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":1049
* 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_2 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_none, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(20, 1049, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = MAT_SHIFT_NONE;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":1050
* 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_2 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_nonzero, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(20, 1050, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = MAT_SHIFT_NONZERO;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":1051
* 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_2 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_positive_definite, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(20, 1051, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = MAT_SHIFT_POSITIVE_DEFINITE;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":1052
* 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_2 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_inblocks, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(20, 1052, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = MAT_SHIFT_INBLOCKS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":1053
* 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_2 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_na, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(20, 1053, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = MAT_SHIFT_NONZERO;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":1054
* 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_2 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_pd, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(20, 1054, __pyx_L1_error)
if (likely(__pyx_t_2)) {
__pyx_r = MAT_SHIFT_POSITIVE_DEFINITE;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":1055
* 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 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_shift_type_s, __pyx_v_st); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1055, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1055, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(20, 1055, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":1048
* 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":1056
* 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_5 = ((MatFactorShiftType)__Pyx_PyInt_As_MatFactorShiftType(__pyx_v_st)); if (unlikely(PyErr_Occurred())) __PYX_ERR(20, 1056, __pyx_L1_error)
__pyx_r = __pyx_t_5;
goto __pyx_L0;
/* "petsc4py/PETSc/petscmat.pxi":1046
* 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_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":1058
* 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;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PetscReal __pyx_t_5;
PetscInt __pyx_t_6;
int __pyx_t_7;
MatFactorShiftType __pyx_t_8;
PyObject *__pyx_t_9 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("matfactorinfo", 0);
/* "petsc4py/PETSc/petscmat.pxi":1060
* 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(20, 1060, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1061
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscmat.pxi":1062
* 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 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_opts); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1062, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_options = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1064
* cdef dict options = dict(opts)
* #
* cdef fill = options.pop('fill', None) # <<<<<<<<<<<<<<
* if fill is not None:
* info.fill = asReal(fill)
*/
__pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_fill, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1064, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_fill = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1065
* #
* cdef fill = options.pop('fill', None)
* if fill is not None: # <<<<<<<<<<<<<<
* info.fill = asReal(fill)
* #
*/
__pyx_t_3 = (__pyx_v_fill != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":1066
* cdef fill = options.pop('fill', None)
* if fill is not None:
* info.fill = asReal(fill) # <<<<<<<<<<<<<<
* #
* cdef zeropivot = options.pop('zeropivot', None)
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(20, 1066, __pyx_L1_error)
__pyx_v_info->fill = __pyx_t_5;
/* "petsc4py/PETSc/petscmat.pxi":1065
* #
* cdef fill = options.pop('fill', None)
* if fill is not None: # <<<<<<<<<<<<<<
* info.fill = asReal(fill)
* #
*/
}
/* "petsc4py/PETSc/petscmat.pxi":1068
* info.fill = asReal(fill)
* #
* cdef zeropivot = options.pop('zeropivot', None) # <<<<<<<<<<<<<<
* if zeropivot is not None:
* info.zeropivot = asReal(zeropivot)
*/
__pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_zeropivot, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1068, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_zeropivot = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1069
* #
* cdef zeropivot = options.pop('zeropivot', None)
* if zeropivot is not None: # <<<<<<<<<<<<<<
* info.zeropivot = asReal(zeropivot)
* #
*/
__pyx_t_2 = (__pyx_v_zeropivot != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscmat.pxi":1070
* cdef zeropivot = options.pop('zeropivot', None)
* if zeropivot is not None:
* info.zeropivot = asReal(zeropivot) # <<<<<<<<<<<<<<
* #
* cdef levels = options.pop('levels', None)
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zeropivot); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(20, 1070, __pyx_L1_error)
__pyx_v_info->zeropivot = __pyx_t_5;
/* "petsc4py/PETSc/petscmat.pxi":1069
* #
* cdef zeropivot = options.pop('zeropivot', None)
* if zeropivot is not None: # <<<<<<<<<<<<<<
* info.zeropivot = asReal(zeropivot)
* #
*/
}
/* "petsc4py/PETSc/petscmat.pxi":1072
* info.zeropivot = asReal(zeropivot)
* #
* cdef levels = options.pop('levels', None) # <<<<<<<<<<<<<<
* if levels is not None:
* info.levels = <PetscReal>asInt(levels)
*/
__pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_levels, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1072, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_levels = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1073
* #
* 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_3 = (__pyx_v_levels != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":1074
* 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_6 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_levels); if (unlikely(__pyx_t_6 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(20, 1074, __pyx_L1_error)
__pyx_v_info->levels = ((PetscReal)__pyx_t_6);
/* "petsc4py/PETSc/petscmat.pxi":1073
* #
* 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":1075
* 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_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_diagonal_fill, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1075, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_diagonal_fill = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1076
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscmat.pxi":1077
* 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_3 = __Pyx_PyObject_IsTrue(__pyx_v_diagonal_fill); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(20, 1077, __pyx_L1_error)
__pyx_v_info->diagonal_fill = ((PetscReal)__pyx_t_3);
/* "petsc4py/PETSc/petscmat.pxi":1076
* 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":1079
* info.diagonal_fill = <PetscReal>(<bint>diagonal_fill)
* #
* cdef dt = options.pop('dt', None) # <<<<<<<<<<<<<<
* if dt is not None:
* info.dt = asReal(dt)
*/
__pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_dt, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1079, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_dt = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1080
* #
* cdef dt = options.pop('dt', None)
* if dt is not None: # <<<<<<<<<<<<<<
* info.dt = asReal(dt)
* cdef dtcol = options.pop('dtcol', None)
*/
__pyx_t_3 = (__pyx_v_dt != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":1081
* cdef dt = options.pop('dt', None)
* if dt is not None:
* info.dt = asReal(dt) # <<<<<<<<<<<<<<
* cdef dtcol = options.pop('dtcol', None)
* if dtcol is not None:
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_dt); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(20, 1081, __pyx_L1_error)
__pyx_v_info->dt = __pyx_t_5;
/* "petsc4py/PETSc/petscmat.pxi":1080
* #
* cdef dt = options.pop('dt', None)
* if dt is not None: # <<<<<<<<<<<<<<
* info.dt = asReal(dt)
* cdef dtcol = options.pop('dtcol', None)
*/
}
/* "petsc4py/PETSc/petscmat.pxi":1082
* if dt is not None:
* info.dt = asReal(dt)
* cdef dtcol = options.pop('dtcol', None) # <<<<<<<<<<<<<<
* if dtcol is not None:
* info.dtcol = asReal(dtcol)
*/
__pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_dtcol, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1082, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_dtcol = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1083
* info.dt = asReal(dt)
* cdef dtcol = options.pop('dtcol', None)
* if dtcol is not None: # <<<<<<<<<<<<<<
* info.dtcol = asReal(dtcol)
* cdef dtcount = options.pop('dtcount', None)
*/
__pyx_t_2 = (__pyx_v_dtcol != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscmat.pxi":1084
* cdef dtcol = options.pop('dtcol', None)
* if dtcol is not None:
* info.dtcol = asReal(dtcol) # <<<<<<<<<<<<<<
* cdef dtcount = options.pop('dtcount', None)
* if dtcount is not None:
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_dtcol); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(20, 1084, __pyx_L1_error)
__pyx_v_info->dtcol = __pyx_t_5;
/* "petsc4py/PETSc/petscmat.pxi":1083
* info.dt = asReal(dt)
* cdef dtcol = options.pop('dtcol', None)
* if dtcol is not None: # <<<<<<<<<<<<<<
* info.dtcol = asReal(dtcol)
* cdef dtcount = options.pop('dtcount', None)
*/
}
/* "petsc4py/PETSc/petscmat.pxi":1085
* if dtcol is not None:
* info.dtcol = asReal(dtcol)
* cdef dtcount = options.pop('dtcount', None) # <<<<<<<<<<<<<<
* if dtcount is not None:
* info.dtcount = <PetscReal>asInt(dtcount)
*/
__pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_dtcount, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1085, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_dtcount = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1086
* info.dtcol = asReal(dtcol)
* cdef dtcount = options.pop('dtcount', None)
* if dtcount is not None: # <<<<<<<<<<<<<<
* info.dtcount = <PetscReal>asInt(dtcount)
* if ((dt is not None) or
*/
__pyx_t_3 = (__pyx_v_dtcount != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":1087
* cdef dtcount = options.pop('dtcount', None)
* if dtcount is not None:
* info.dtcount = <PetscReal>asInt(dtcount) # <<<<<<<<<<<<<<
* if ((dt is not None) or
* (dtcol is not None) or
*/
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dtcount); if (unlikely(__pyx_t_6 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(20, 1087, __pyx_L1_error)
__pyx_v_info->dtcount = ((PetscReal)__pyx_t_6);
/* "petsc4py/PETSc/petscmat.pxi":1086
* info.dtcol = asReal(dtcol)
* cdef dtcount = options.pop('dtcount', None)
* if dtcount is not None: # <<<<<<<<<<<<<<
* info.dtcount = <PetscReal>asInt(dtcount)
* if ((dt is not None) or
*/
}
/* "petsc4py/PETSc/petscmat.pxi":1088
* if dtcount is not None:
* info.dtcount = <PetscReal>asInt(dtcount)
* if ((dt is not None) or # <<<<<<<<<<<<<<
* (dtcol is not None) or
* (dtcount is not None)):
*/
__pyx_t_3 = (__pyx_v_dt != Py_None);
__pyx_t_7 = (__pyx_t_3 != 0);
if (!__pyx_t_7) {
} else {
__pyx_t_2 = __pyx_t_7;
goto __pyx_L12_bool_binop_done;
}
/* "petsc4py/PETSc/petscmat.pxi":1089
* info.dtcount = <PetscReal>asInt(dtcount)
* if ((dt is not None) or
* (dtcol is not None) or # <<<<<<<<<<<<<<
* (dtcount is not None)):
* info.usedt = <PetscReal>PETSC_TRUE
*/
__pyx_t_7 = (__pyx_v_dtcol != Py_None);
__pyx_t_3 = (__pyx_t_7 != 0);
if (!__pyx_t_3) {
} else {
__pyx_t_2 = __pyx_t_3;
goto __pyx_L12_bool_binop_done;
}
/* "petsc4py/PETSc/petscmat.pxi":1090
* if ((dt is not None) or
* (dtcol is not None) or
* (dtcount is not None)): # <<<<<<<<<<<<<<
* info.usedt = <PetscReal>PETSC_TRUE
* #
*/
__pyx_t_3 = (__pyx_v_dtcount != Py_None);
__pyx_t_7 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_7;
__pyx_L12_bool_binop_done:;
/* "petsc4py/PETSc/petscmat.pxi":1088
* if dtcount is not None:
* info.dtcount = <PetscReal>asInt(dtcount)
* if ((dt is not None) or # <<<<<<<<<<<<<<
* (dtcol is not None) or
* (dtcount is not None)):
*/
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":1091
* (dtcol is not None) or
* (dtcount is not None)):
* info.usedt = <PetscReal>PETSC_TRUE # <<<<<<<<<<<<<<
* #
* cdef shifttype = options.pop('shifttype', None)
*/
__pyx_v_info->usedt = ((PetscReal)PETSC_TRUE);
/* "petsc4py/PETSc/petscmat.pxi":1088
* if dtcount is not None:
* info.dtcount = <PetscReal>asInt(dtcount)
* if ((dt is not None) or # <<<<<<<<<<<<<<
* (dtcol is not None) or
* (dtcount is not None)):
*/
}
/* "petsc4py/PETSc/petscmat.pxi":1093
* info.usedt = <PetscReal>PETSC_TRUE
* #
* cdef shifttype = options.pop('shifttype', None) # <<<<<<<<<<<<<<
* if shifttype is not None:
* info.shifttype = <PetscReal>matfactorshifttype(shifttype)
*/
__pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_shifttype, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1093, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_shifttype = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1094
* #
* 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);
__pyx_t_7 = (__pyx_t_2 != 0);
if (__pyx_t_7) {
/* "petsc4py/PETSc/petscmat.pxi":1095
* 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(20, 1095, __pyx_L1_error)
__pyx_v_info->shifttype = ((PetscReal)__pyx_t_8);
/* "petsc4py/PETSc/petscmat.pxi":1094
* #
* 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":1096
* 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_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_shiftamount, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1096, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_shiftamount = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1097
* info.shifttype = <PetscReal>matfactorshifttype(shifttype)
* cdef shiftamount = options.pop('shiftamount', None)
* if shiftamount is not None: # <<<<<<<<<<<<<<
* info.shiftamount = asReal(shiftamount)
* #
*/
__pyx_t_7 = (__pyx_v_shiftamount != Py_None);
__pyx_t_2 = (__pyx_t_7 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscmat.pxi":1098
* cdef shiftamount = options.pop('shiftamount', None)
* if shiftamount is not None:
* info.shiftamount = asReal(shiftamount) # <<<<<<<<<<<<<<
* #
* if options:
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_shiftamount); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(20, 1098, __pyx_L1_error)
__pyx_v_info->shiftamount = __pyx_t_5;
/* "petsc4py/PETSc/petscmat.pxi":1097
* info.shifttype = <PetscReal>matfactorshifttype(shifttype)
* cdef shiftamount = options.pop('shiftamount', None)
* if shiftamount is not None: # <<<<<<<<<<<<<<
* info.shiftamount = asReal(shiftamount)
* #
*/
}
/* "petsc4py/PETSc/petscmat.pxi":1100
* 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(20, 1100, __pyx_L1_error)
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/petscmat.pxi":1102
* if options:
* raise ValueError("unknown options: %s"
* % list(options.keys())) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_4 = __Pyx_PyDict_Keys(__pyx_v_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_9 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 1102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_unknown_options_s, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1101
* #
* if options:
* raise ValueError("unknown options: %s" # <<<<<<<<<<<<<<
* % list(options.keys()))
* return PETSC_SUCCESS
*/
__pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 1101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__PYX_ERR(20, 1101, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1100
* info.shiftamount = asReal(shiftamount)
* #
* if options: # <<<<<<<<<<<<<<
* raise ValueError("unknown options: %s"
* % list(options.keys()))
*/
}
/* "petsc4py/PETSc/petscmat.pxi":1103
* raise ValueError("unknown options: %s"
* % list(options.keys()))
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* # -----------------------------------------------------------------------------
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscmat.pxi":1058
* 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_4);
__Pyx_XDECREF(__pyx_t_9);
__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":1107
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_t_6;
PetscErrorCode __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":1108
*
* 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":1109
* 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(20, 1109, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_2 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 1109, __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(20, 1109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
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(20, 1109, __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(20, 1109, __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":1110
* 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);
__pyx_t_6 = (__pyx_t_5 != 0);
if (__pyx_t_6) {
/* "petsc4py/PETSc/petscmat.pxi":1111
* 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_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, (&__pyx_v_M), NULL)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 1111, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1112
* if isinstance(rows, slice):
* CHKERR( MatGetSize(self.mat, &M, NULL) )
* start, stop, stride = rows.indices(toInt(M)) # <<<<<<<<<<<<<<
* rows = arange(start, stop, stride)
* if isinstance(cols, slice):
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rows, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1112, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1112, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
}
}
__pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 1112, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
PyObject* sequence = __pyx_t_2;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(20, 1112, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
__pyx_t_8 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_8);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1112, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1112, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 1112, __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(20, 1112, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = Py_TYPE(__pyx_t_9)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_3 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
index = 2; __pyx_t_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(20, 1112, __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(20, 1112, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__pyx_v_start = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_stop = __pyx_t_3;
__pyx_t_3 = 0;
__pyx_v_stride = __pyx_t_8;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1113
* 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(20, 1113, __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":1110
* 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":1114
* 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_6 = PySlice_Check(__pyx_v_cols);
__pyx_t_5 = (__pyx_t_6 != 0);
if (__pyx_t_5) {
/* "petsc4py/PETSc/petscmat.pxi":1115
* 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_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, NULL, (&__pyx_v_N))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 1115, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1116
* 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_PyObject_GetAttrStr(__pyx_v_cols, __pyx_n_s_indices); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 1116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
if (likely(__pyx_t_1)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_8, function);
}
}
__pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3);
__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(20, 1116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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(20, 1116, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_8 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
__pyx_t_1 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
#else
__pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 1116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 1116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = Py_TYPE(__pyx_t_9)->tp_iternext;
index = 0; __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 = 1; __pyx_t_3 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
index = 2; __pyx_t_1 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_9), 3) < 0) __PYX_ERR(20, 1116, __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(20, 1116, __pyx_L1_error)
__pyx_L10_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_8);
__pyx_t_8 = 0;
__Pyx_XDECREF_SET(__pyx_v_stop, __pyx_t_3);
__pyx_t_3 = 0;
__Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1117
* 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(20, 1117, __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":1114
* 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":1118
* 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(20, 1118, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscmat.pxi":1107
* # -----------------------------------------------------------------------------
*
* 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":1121
*
*
* 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;
int __pyx_t_6;
PetscErrorCode __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":1122
*
* 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":1123
* 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(20, 1123, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_2 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 1123, __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(20, 1123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
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(20, 1123, __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(20, 1123, __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":1124
* 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);
__pyx_t_6 = (__pyx_t_5 != 0);
if (__pyx_t_6) {
/* "petsc4py/PETSc/petscmat.pxi":1125
* 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_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, (&__pyx_v_M), NULL)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 1125, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1126
* if isinstance(rows, slice):
* CHKERR( MatGetSize(self.mat, &M, NULL) )
* start, stop, stride = rows.indices(toInt(M)) # <<<<<<<<<<<<<<
* rows = arange(start, stop, stride)
* if isinstance(cols, slice):
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rows, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
}
}
__pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 1126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
PyObject* sequence = __pyx_t_2;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(20, 1126, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
__pyx_t_8 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_8);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 1126, __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(20, 1126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = Py_TYPE(__pyx_t_9)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_3 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
index = 2; __pyx_t_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(20, 1126, __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(20, 1126, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__pyx_v_start = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_stop = __pyx_t_3;
__pyx_t_3 = 0;
__pyx_v_stride = __pyx_t_8;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1127
* 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(20, 1127, __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":1124
* 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":1128
* 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_6 = PySlice_Check(__pyx_v_cols);
__pyx_t_5 = (__pyx_t_6 != 0);
if (__pyx_t_5) {
/* "petsc4py/PETSc/petscmat.pxi":1129
* 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_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, NULL, (&__pyx_v_N))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 1129, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1130
* 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_PyObject_GetAttrStr(__pyx_v_cols, __pyx_n_s_indices); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 1130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
if (likely(__pyx_t_1)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_8, function);
}
}
__pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3);
__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(20, 1130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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(20, 1130, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_8 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
__pyx_t_1 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_1);
#else
__pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 1130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 1130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = Py_TYPE(__pyx_t_9)->tp_iternext;
index = 0; __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 = 1; __pyx_t_3 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
index = 2; __pyx_t_1 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_9), 3) < 0) __PYX_ERR(20, 1130, __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(20, 1130, __pyx_L1_error)
__pyx_L10_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_8);
__pyx_t_8 = 0;
__Pyx_XDECREF_SET(__pyx_v_stop, __pyx_t_3);
__pyx_t_3 = 0;
__Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1131
* 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(20, 1131, __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":1128
* 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":1132
* 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_7 = __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_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 1132, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1133
* 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":1121
*
*
* 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":1141
* cdef PetscMatStencil stencil
* property i:
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.stencil.i = asInt(value)
* property j:
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1i_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1i_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1i___set__(((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1i___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/petscmat.pxi":1142
* property i:
* def __set__(self, value):
* self.stencil.i = asInt(value) # <<<<<<<<<<<<<<
* property j:
* def __set__(self, value):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(20, 1142, __pyx_L1_error)
__pyx_v_self->stencil.i = __pyx_t_1;
/* "petsc4py/PETSc/petscmat.pxi":1141
* cdef PetscMatStencil stencil
* property i:
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.stencil.i = asInt(value)
* property j:
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc._Mat_Stencil.i.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":1144
* self.stencil.i = asInt(value)
* property j:
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.stencil.j = asInt(value)
* property k:
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1j_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1j_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1j___set__(((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1j___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/petscmat.pxi":1145
* property j:
* def __set__(self, value):
* self.stencil.j = asInt(value) # <<<<<<<<<<<<<<
* property k:
* def __set__(self, value):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(20, 1145, __pyx_L1_error)
__pyx_v_self->stencil.j = __pyx_t_1;
/* "petsc4py/PETSc/petscmat.pxi":1144
* self.stencil.i = asInt(value)
* property j:
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.stencil.j = asInt(value)
* property k:
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc._Mat_Stencil.j.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":1147
* self.stencil.j = asInt(value)
* property k:
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.stencil.k = asInt(value)
* property c:
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1k_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1k_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1k___set__(((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1k___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/petscmat.pxi":1148
* property k:
* def __set__(self, value):
* self.stencil.k = asInt(value) # <<<<<<<<<<<<<<
* property c:
* def __set__(self, value):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(20, 1148, __pyx_L1_error)
__pyx_v_self->stencil.k = __pyx_t_1;
/* "petsc4py/PETSc/petscmat.pxi":1147
* self.stencil.j = asInt(value)
* property k:
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.stencil.k = asInt(value)
* property c:
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc._Mat_Stencil.k.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":1150
* self.stencil.k = asInt(value)
* property c:
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.stencil.c = asInt(value)
* property index:
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1c_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1c_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1c___set__(((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1c___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/petscmat.pxi":1151
* property c:
* def __set__(self, value):
* self.stencil.c = asInt(value) # <<<<<<<<<<<<<<
* property index:
* def __set__(self, value):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(20, 1151, __pyx_L1_error)
__pyx_v_self->stencil.c = __pyx_t_1;
/* "petsc4py/PETSc/petscmat.pxi":1150
* self.stencil.k = asInt(value)
* property c:
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.stencil.c = asInt(value)
* property index:
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc._Mat_Stencil.c.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":1153
* self.stencil.c = asInt(value)
* property index:
* def __set__(self, value): # <<<<<<<<<<<<<<
* cdef PetscMatStencil *s = &self.stencil
* s.k = s.j = s.i = 0
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_5index_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_5index_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_5index___set__(((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_5index___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value) {
MatStencil *__pyx_v_s;
int __pyx_r;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/petscmat.pxi":1154
* property index:
* def __set__(self, value):
* cdef PetscMatStencil *s = &self.stencil # <<<<<<<<<<<<<<
* s.k = s.j = s.i = 0
* asDims(value, &s.i, &s.j, &s.k)
*/
__pyx_v_s = (&__pyx_v_self->stencil);
/* "petsc4py/PETSc/petscmat.pxi":1155
* def __set__(self, value):
* cdef PetscMatStencil *s = &self.stencil
* s.k = s.j = s.i = 0 # <<<<<<<<<<<<<<
* asDims(value, &s.i, &s.j, &s.k)
* property field:
*/
__pyx_v_s->k = 0;
__pyx_v_s->j = 0;
__pyx_v_s->i = 0;
/* "petsc4py/PETSc/petscmat.pxi":1156
* cdef PetscMatStencil *s = &self.stencil
* s.k = s.j = s.i = 0
* asDims(value, &s.i, &s.j, &s.k) # <<<<<<<<<<<<<<
* property field:
* def __set__(self, value):
*/
__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(20, 1156, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1153
* self.stencil.c = asInt(value)
* property index:
* def __set__(self, value): # <<<<<<<<<<<<<<
* cdef PetscMatStencil *s = &self.stencil
* s.k = s.j = s.i = 0
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc._Mat_Stencil.index.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":1158
* asDims(value, &s.i, &s.j, &s.k)
* property field:
* def __set__(self, value): # <<<<<<<<<<<<<<
* cdef PetscMatStencil *s = &self.stencil
* s.c = asInt(value)
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_5field_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_5field_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_5field___set__(((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_5field___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value) {
MatStencil *__pyx_v_s;
int __pyx_r;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/petscmat.pxi":1159
* property field:
* def __set__(self, value):
* cdef PetscMatStencil *s = &self.stencil # <<<<<<<<<<<<<<
* s.c = asInt(value)
*
*/
__pyx_v_s = (&__pyx_v_self->stencil);
/* "petsc4py/PETSc/petscmat.pxi":1160
* def __set__(self, value):
* cdef PetscMatStencil *s = &self.stencil
* s.c = asInt(value) # <<<<<<<<<<<<<<
*
* cdef matsetvaluestencil(PetscMat A,
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(20, 1160, __pyx_L1_error)
__pyx_v_s->c = __pyx_t_1;
/* "petsc4py/PETSc/petscmat.pxi":1158
* asDims(value, &s.i, &s.j, &s.k)
* property field:
* def __set__(self, value): # <<<<<<<<<<<<<<
* 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._Mat_Stencil.field.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":1162
* s.c = asInt(value)
*
* cdef matsetvaluestencil(PetscMat A, # <<<<<<<<<<<<<<
* _Mat_Stencil r, _Mat_Stencil c, object value,
* PetscInsertMode im, int blocked):
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_matsetvaluestencil(Mat __pyx_v_A, struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_r, struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_c, PyObject *__pyx_v_value, InsertMode __pyx_v_im, int __pyx_v_blocked) {
PetscInt __pyx_v_rbs;
PetscInt __pyx_v_cbs;
PetscInt __pyx_v_nv;
PetscScalar *__pyx_v_v;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("matsetvaluestencil", 0);
__Pyx_INCREF(__pyx_v_value);
/* "petsc4py/PETSc/petscmat.pxi":1166
* 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":1167
* # 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(20, 1167, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":1168
* 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) != 0);
if (__pyx_t_1) {
__pyx_v_rbs = 1;
}
/* "petsc4py/PETSc/petscmat.pxi":1169
* 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) != 0);
if (__pyx_t_1) {
__pyx_v_cbs = 1;
}
/* "petsc4py/PETSc/petscmat.pxi":1171
* 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":1172
* # 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":1173
* 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(20, 1173, __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":1174
* 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) != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/petscmat.pxi":1175
* value = iarray_s(value, &nv, &v)
* if rbs*cbs != nv: raise ValueError(
* "incompatible array sizes: nv=%d" % toInt(nv) ) # <<<<<<<<<<<<<<
* if blocked:
* CHKERR( MatSetValuesBlockedStencil(A,
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyString_FormatSafe(__pyx_kp_s_incompatible_array_sizes_nv_d, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1174
* cdef PetscScalar *v = NULL
* value = iarray_s(value, &nv, &v)
* if rbs*cbs != nv: raise ValueError( # <<<<<<<<<<<<<<
* "incompatible array sizes: nv=%d" % toInt(nv) )
* if blocked:
*/
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1174, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(20, 1174, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscmat.pxi":1176
* 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":1177
* "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(20, 1177, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1176
* 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":1182
* v, im) )
* else:
* CHKERR( MatSetValuesStencil(A, # <<<<<<<<<<<<<<
* 1, &r.stencil,
* 1, &c.stencil,
*/
/*else*/ {
/* "petsc4py/PETSc/petscmat.pxi":1185
* 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(20, 1182, __pyx_L1_error)
}
__pyx_L7:;
/* "petsc4py/PETSc/petscmat.pxi":1186
* 1, &c.stencil,
* v, im) )
* return 0 # <<<<<<<<<<<<<<
*
* cdef mat_get_dlpack_ctx(Mat self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_int_0);
__pyx_r = __pyx_int_0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscmat.pxi":1162
* s.c = asInt(value)
*
* cdef matsetvaluestencil(PetscMat A, # <<<<<<<<<<<<<<
* _Mat_Stencil r, _Mat_Stencil c, object value,
* PetscInsertMode im, int blocked):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("petsc4py.PETSc.matsetvaluestencil", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_value);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscmat.pxi":1188
* return 0
*
* cdef mat_get_dlpack_ctx(Mat self): # <<<<<<<<<<<<<<
* if 'dense' not in self.getType():
* raise NotImplementedError("Not for type {}".format(self.getType()))
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_mat_get_dlpack_ctx(struct PyPetscMatObject *__pyx_v_self) {
PyObject *__pyx_v_ctx0 = 0;
PetscInt __pyx_v_n;
PetscInt __pyx_v_m;
PetscInt __pyx_v_lda;
int64_t __pyx_v_ndim;
int64_t *__pyx_v_shape_arr;
int64_t *__pyx_v_strides_arr;
PyObject *__pyx_v_s1 = 0;
PyObject *__pyx_v_s2 = 0;
PetscInt __pyx_v_devId;
PetscMemType __pyx_v_mtype;
CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
PyObject *__pyx_v_devType_ = NULL;
PyObject *__pyx_v_dtype = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PetscErrorCode __pyx_t_8;
PyObject *__pyx_t_9 = NULL;
PyObject *(*__pyx_t_10)(PyObject *);
int64_t __pyx_t_11;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mat_get_dlpack_ctx", 0);
/* "petsc4py/PETSc/petscmat.pxi":1189
*
* cdef mat_get_dlpack_ctx(Mat self):
* if 'dense' not in self.getType(): # <<<<<<<<<<<<<<
* raise NotImplementedError("Not for type {}".format(self.getType()))
* cdef object ctx0 = self.get_attr('__dltensor_ctx__')
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getType); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 1189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_dense, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(20, 1189, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = (__pyx_t_4 != 0);
if (unlikely(__pyx_t_5)) {
/* "petsc4py/PETSc/petscmat.pxi":1190
* cdef mat_get_dlpack_ctx(Mat self):
* if 'dense' not in self.getType():
* raise NotImplementedError("Not for type {}".format(self.getType())) # <<<<<<<<<<<<<<
* cdef object ctx0 = self.get_attr('__dltensor_ctx__')
* cdef PetscInt n = 0, m = 0, lda = 0
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Not_for_type, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 1190, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getType); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 1190, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
__pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1190, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1190, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 1190, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__PYX_ERR(20, 1190, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1189
*
* 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":1191
* if 'dense' not in self.getType():
* raise NotImplementedError("Not for type {}".format(self.getType()))
* cdef object ctx0 = self.get_attr('__dltensor_ctx__') # <<<<<<<<<<<<<<
* cdef PetscInt n = 0, m = 0, lda = 0
* cdef int64_t ndim = 2
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 1191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_ctx0 = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1192
* 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":1193
* 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":1194
* 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":1195
* 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":1196
* 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":1197
* 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":1198
* 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":1199
* cdef object s2 = None
* cdef PetscInt devId = 0
* cdef PetscMemType mtype = PETSC_MEMTYPE_HOST # <<<<<<<<<<<<<<
* if ctx0 is None: # First time in, create a linear memory view
* s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
*/
__pyx_v_mtype = PETSC_MEMTYPE_HOST;
/* "petsc4py/PETSc/petscmat.pxi":1200
* cdef PetscInt devId = 0
* cdef PetscMemType mtype = PETSC_MEMTYPE_HOST
* if ctx0 is None: # First time in, create a linear memory view # <<<<<<<<<<<<<<
* s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
* s2 = oarray_p(empty_p(ndim), NULL, <void**>&strides_arr)
*/
__pyx_t_5 = (__pyx_v_ctx0 == Py_None);
__pyx_t_4 = (__pyx_t_5 != 0);
if (__pyx_t_4) {
/* "petsc4py/PETSc/petscmat.pxi":1201
* cdef PetscMemType mtype = PETSC_MEMTYPE_HOST
* if ctx0 is None: # First time in, create a linear memory view
* s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr) # <<<<<<<<<<<<<<
* s2 = oarray_p(empty_p(ndim), NULL, <void**>&strides_arr)
* CHKERR( MatGetSize(self.mat, NULL, &n) )
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 1201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_shape_arr)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_s1, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1202
* if ctx0 is None: # First time in, create a linear memory view
* s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
* s2 = oarray_p(empty_p(ndim), NULL, <void**>&strides_arr) # <<<<<<<<<<<<<<
* CHKERR( MatGetSize(self.mat, NULL, &n) )
* CHKERR( MatGetLocalSize(self.mat, &m, NULL) )
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 1202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_strides_arr)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 1202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_s2, __pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1203
* s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
* s2 = oarray_p(empty_p(ndim), NULL, <void**>&strides_arr)
* CHKERR( MatGetSize(self.mat, NULL, &n) ) # <<<<<<<<<<<<<<
* CHKERR( MatGetLocalSize(self.mat, &m, NULL) )
* CHKERR( MatDenseGetLDA(self.mat, &lda) )
*/
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, NULL, (&__pyx_v_n))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 1203, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1204
* s2 = oarray_p(empty_p(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_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_self->mat, (&__pyx_v_m), NULL)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 1204, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1205
* 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_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetLDA(__pyx_v_self->mat, (&__pyx_v_lda))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 1205, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1206
* 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":1207
* 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":1208
* 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":1209
* 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":1200
* cdef PetscInt devId = 0
* cdef PetscMemType mtype = PETSC_MEMTYPE_HOST
* if ctx0 is None: # First time in, create a linear memory view # <<<<<<<<<<<<<<
* s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
* s2 = oarray_p(empty_p(ndim), NULL, <void**>&strides_arr)
*/
goto __pyx_L4;
}
/* "petsc4py/PETSc/petscmat.pxi":1211
* strides_arr[1] = <int64_t>lda
* else:
* (_, _, ndim, s1, s2) = ctx0 # <<<<<<<<<<<<<<
*
* devType_ = { PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA }
*/
/*else*/ {
if ((likely(PyTuple_CheckExact(__pyx_v_ctx0))) || (PyList_CheckExact(__pyx_v_ctx0))) {
PyObject* sequence = __pyx_v_ctx0;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 5)) {
if (size > 5) __Pyx_RaiseTooManyValuesError(5);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(20, 1211, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 4);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_3 = PyList_GET_ITEM(sequence, 2);
__pyx_t_6 = PyList_GET_ITEM(sequence, 3);
__pyx_t_7 = PyList_GET_ITEM(sequence, 4);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
#else
{
Py_ssize_t i;
PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_1,&__pyx_t_3,&__pyx_t_6,&__pyx_t_7};
for (i=0; i < 5; i++) {
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(20, 1211, __pyx_L1_error)
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
}
#endif
} else {
Py_ssize_t index = -1;
PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_1,&__pyx_t_3,&__pyx_t_6,&__pyx_t_7};
__pyx_t_9 = PyObject_GetIter(__pyx_v_ctx0); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 1211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
for (index=0; index < 5; index++) {
PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 5) < 0) __PYX_ERR(20, 1211, __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(20, 1211, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(20, 1211, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v__ = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v__, __pyx_t_1);
__pyx_t_1 = 0;
__pyx_v_ndim = __pyx_t_11;
__Pyx_DECREF_SET(__pyx_v_s1, __pyx_t_6);
__pyx_t_6 = 0;
__Pyx_DECREF_SET(__pyx_v_s2, __pyx_t_7);
__pyx_t_7 = 0;
}
__pyx_L4:;
/* "petsc4py/PETSc/petscmat.pxi":1213
* (_, _, ndim, s1, s2) = ctx0
*
* devType_ = { PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA } # <<<<<<<<<<<<<<
* CHKERR( MatGetCurrentMemType(self.mat, &mtype) )
* dtype = devType_.get(mtype, kDLCPU)
*/
__pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = __Pyx_PyInt_From_PetscMemType(PETSC_MEMTYPE_HOST); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_7, __pyx_t_6, __pyx_t_3) < 0) __PYX_ERR(20, 1213, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyInt_From_PetscMemType(PETSC_MEMTYPE_CUDA); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCUDA); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 1213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (PyDict_SetItem(__pyx_t_7, __pyx_t_3, __pyx_t_6) < 0) __PYX_ERR(20, 1213, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_devType_ = ((PyObject*)__pyx_t_7);
__pyx_t_7 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1214
*
* devType_ = { PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA }
* CHKERR( MatGetCurrentMemType(self.mat, &mtype) ) # <<<<<<<<<<<<<<
* dtype = devType_.get(mtype, kDLCPU)
* if dtype != kDLCPU:
*/
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetCurrentMemType(__pyx_v_self->mat, (&__pyx_v_mtype))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 1214, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1215
* devType_ = { PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA }
* CHKERR( MatGetCurrentMemType(self.mat, &mtype) )
* dtype = devType_.get(mtype, kDLCPU) # <<<<<<<<<<<<<<
* if dtype != kDLCPU:
* CHKERR( PetscObjectGetDeviceId(<PetscObject>self.mat, &devId) )
*/
__pyx_t_7 = __Pyx_PyInt_From_PetscMemType(__pyx_v_mtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 1215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 1215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_devType_, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_dtype = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1216
* 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_3 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 1216, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(20, 1216, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
/* "petsc4py/PETSc/petscmat.pxi":1217
* 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_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetDeviceId(((PetscObject)__pyx_v_self->mat), (&__pyx_v_devId))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 1217, __pyx_L1_error)
/* "petsc4py/PETSc/petscmat.pxi":1216
* 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":1218
* 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_6 = __Pyx_PyInt_From_PetscInt(__pyx_v_devId); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 1218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 1218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 1218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_dtype);
__Pyx_GIVEREF(__pyx_v_dtype);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_dtype);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
__Pyx_INCREF(__pyx_v_s1);
__Pyx_GIVEREF(__pyx_v_s1);
PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_s1);
__Pyx_INCREF(__pyx_v_s2);
__Pyx_GIVEREF(__pyx_v_s2);
PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_v_s2);
__pyx_t_6 = 0;
__pyx_t_3 = 0;
__Pyx_DECREF_SET(__pyx_v_ctx0, __pyx_t_7);
__pyx_t_7 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1219
* CHKERR( PetscObjectGetDeviceId(<PetscObject>self.mat, &devId) )
* ctx0 = (dtype, devId, ndim, s1, s2)
* self.set_attr('__dltensor_ctx__', ctx0) # <<<<<<<<<<<<<<
* return ctx0
*
*/
__pyx_t_7 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__"), __pyx_v_ctx0); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 1219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "petsc4py/PETSc/petscmat.pxi":1220
* 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":1188
* return 0
*
* cdef mat_get_dlpack_ctx(Mat self): # <<<<<<<<<<<<<<
* if 'dense' not in self.getType():
* raise NotImplementedError("Not for type {}".format(self.getType()))
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("petsc4py.PETSc.mat_get_dlpack_ctx", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_ctx0);
__Pyx_XDECREF(__pyx_v_s1);
__Pyx_XDECREF(__pyx_v_s2);
__Pyx_XDECREF(__pyx_v__);
__Pyx_XDECREF(__pyx_v_devType_);
__Pyx_XDECREF(__pyx_v_dtype);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscpc.pxi":362
* # --------------------------------------------------------------------
*
* cdef inline PC ref_PC(PetscPC pc): # <<<<<<<<<<<<<<
* cdef PC ob = <PC> 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ref_PC", 0);
/* "petsc4py/PETSc/petscpc.pxi":363
*
* cdef inline PC ref_PC(PetscPC pc):
* cdef PC ob = <PC> PC() # <<<<<<<<<<<<<<
* ob.pc = pc
* PetscINCREF(ob.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 363, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ob = ((struct PyPetscPCObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscpc.pxi":364
* cdef inline PC ref_PC(PetscPC pc):
* cdef PC ob = <PC> PC()
* ob.pc = pc # <<<<<<<<<<<<<<
* PetscINCREF(ob.obj)
* return ob
*/
__pyx_v_ob->pc = __pyx_v_pc;
/* "petsc4py/PETSc/petscpc.pxi":365
* cdef PC ob = <PC> PC()
* ob.pc = pc
* PetscINCREF(ob.obj) # <<<<<<<<<<<<<<
* return ob
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj));
/* "petsc4py/PETSc/petscpc.pxi":366
* ob.pc = pc
* PetscINCREF(ob.obj)
* return ob # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode PCPatch_ComputeOperator(
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_v_ob));
__pyx_r = __pyx_v_ob;
goto __pyx_L0;
/* "petsc4py/PETSc/petscpc.pxi":362
* # --------------------------------------------------------------------
*
* cdef inline PC ref_PC(PetscPC pc): # <<<<<<<<<<<<<<
* cdef PC ob = <PC> PC()
* ob.pc = pc
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.ref_PC", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ob);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscpc.pxi":368
* return ob
*
* cdef PetscErrorCode PCPatch_ComputeOperator( # <<<<<<<<<<<<<<
* PetscPC pc,
* PetscInt point,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperator(PC __pyx_v_pc, PetscInt __pyx_v_point, Vec __pyx_v_vec, Mat __pyx_v_mat, IS __pyx_v_cells, CYTHON_UNUSED PetscInt __pyx_v_ndof, PetscInt const *__pyx_v_dofmap, PetscInt const *__pyx_v_dofmapWithAll, void *__pyx_v_ctx) {
struct PyPetscVecObject *__pyx_v_Vec = 0;
struct PyPetscMatObject *__pyx_v_Mat = 0;
struct PyPetscPCObject *__pyx_v_Pc = 0;
struct PyPetscISObject *__pyx_v_Is = 0;
PyObject *__pyx_v_context = 0;
PyObject *__pyx_v_op = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
__Pyx_memviewslice __pyx_v_pydofs = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_pydofsWithAll = { 0, 0, { 0 }, { 0 }, { 0 } };
PyArrayObject *__pyx_v_dofsall = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
struct __pyx_array_obj *__pyx_t_9 = NULL;
__Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("PCPatch_ComputeOperator", 0);
/* "petsc4py/PETSc/petscpc.pxi":378
* const PetscInt *dofmapWithAll,
* void *ctx) except PETSC_ERR_PYTHON with gil:
* cdef Vec Vec = ref_Vec(vec) # <<<<<<<<<<<<<<
* cdef Mat Mat = ref_Mat(mat)
* cdef PC Pc = ref_PC(pc)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":379
* void *ctx) except PETSC_ERR_PYTHON with gil:
* cdef Vec Vec = ref_Vec(vec)
* cdef Mat Mat = ref_Mat(mat) # <<<<<<<<<<<<<<
* cdef PC Pc = ref_PC(pc)
* cdef IS Is = ref_IS(cells)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 379, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Mat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":380
* cdef Vec Vec = ref_Vec(vec)
* cdef Mat Mat = ref_Mat(mat)
* cdef PC Pc = ref_PC(pc) # <<<<<<<<<<<<<<
* cdef IS Is = ref_IS(cells)
* cdef object context = Pc.get_attr("__patch_compute_operator__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_PC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":381
* cdef Mat Mat = ref_Mat(mat)
* cdef PC Pc = ref_PC(pc)
* cdef IS Is = ref_IS(cells) # <<<<<<<<<<<<<<
* cdef object context = Pc.get_attr("__patch_compute_operator__")
* if context is None and ctx != NULL: context = <object>ctx
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_cells)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 381, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":382
* cdef PC Pc = ref_PC(pc)
* cdef IS Is = ref_IS(cells)
* cdef object context = Pc.get_attr("__patch_compute_operator__") # <<<<<<<<<<<<<<
* if context is None and ctx != NULL: context = <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(8, 382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":383
* cdef IS Is = ref_IS(cells)
* cdef object context = Pc.get_attr("__patch_compute_operator__")
* if context is None and ctx != NULL: context = <object>ctx # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (op, args, kargs) = context
*/
__pyx_t_3 = (__pyx_v_context == Py_None);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
__pyx_t_1 = ((PyObject *)__pyx_v_ctx);
__Pyx_INCREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1);
__pyx_t_1 = 0;
}
/* "petsc4py/PETSc/petscpc.pxi":384
* cdef object context = Pc.get_attr("__patch_compute_operator__")
* if context is None and ctx != NULL: context = <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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(8, 384, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscpc.pxi":385
* 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(8, 385, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 385, __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(8, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(8, 385, __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(8, 385, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_op = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscpc.pxi":386
* 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(8, 386, __pyx_L1_error)
}
__pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_9 = __pyx_array_new(__pyx_t_6, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_5), (char *) "c", (char *) __pyx_v_dofmap);
if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(8, 386, __pyx_L1_error)
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
__pyx_v_pydofs = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
/* "petsc4py/PETSc/petscpc.pxi":388
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscpc.pxi":389
* 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(8, 389, __pyx_L1_error)
}
__pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 389, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 389, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_9 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_6), (char *) "c", (char *) __pyx_v_dofmapWithAll);
if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 389, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(8, 389, __pyx_L1_error)
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
__pyx_v_pydofsWithAll = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
/* "petsc4py/PETSc/petscpc.pxi":390
* if dofmapWithAll != NULL:
* pydofsWithAll = <PetscInt[:ndof]>dofmapWithAll
* dofsall = asarray(pydofsWithAll) # <<<<<<<<<<<<<<
* else:
* dofsall = None
*/
__pyx_t_6 = __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_6)) __PYX_ERR(8, 390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_dofsall = ((PyArrayObject *)__pyx_t_5);
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscpc.pxi":388
* 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":392
* dofsall = asarray(pydofsWithAll)
* else:
* dofsall = None # <<<<<<<<<<<<<<
* op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs)
* return PETSC_SUCCESS
*/
/*else*/ {
__Pyx_INCREF(Py_None);
__pyx_v_dofsall = ((PyArrayObject *)Py_None);
}
__pyx_L10:;
/* "petsc4py/PETSc/petscpc.pxi":393
* else:
* dofsall = None
* op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_point); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __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_6)) __PYX_ERR(8, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Pc));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Pc));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Pc));
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_Vec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Vec));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_Vec));
__Pyx_INCREF(((PyObject *)__pyx_v_Mat));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Mat));
PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_Mat));
__Pyx_INCREF(((PyObject *)__pyx_v_Is));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Is));
PyTuple_SET_ITEM(__pyx_t_6, 4, ((PyObject *)__pyx_v_Is));
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_dofsall));
__Pyx_GIVEREF(((PyObject *)__pyx_v_dofsall));
PyTuple_SET_ITEM(__pyx_t_6, 6, ((PyObject *)__pyx_v_dofsall));
__pyx_t_5 = 0;
__pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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(8, 393, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
__pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscpc.pxi":394
* dofsall = None
* op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode PCPatch_ComputeFunction(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscpc.pxi":368
* return ob
*
* cdef PetscErrorCode PCPatch_ComputeOperator( # <<<<<<<<<<<<<<
* PetscPC pc,
* PetscInt point,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(((PyObject *)__pyx_t_9));
__PYX_XDEC_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_XDEC_MEMVIEW(&__pyx_v_pydofs, 1);
__PYX_XDEC_MEMVIEW(&__pyx_v_pydofsWithAll, 1);
__Pyx_XDECREF((PyObject *)__pyx_v_dofsall);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscpc.pxi":396
* return PETSC_SUCCESS
*
* cdef PetscErrorCode PCPatch_ComputeFunction( # <<<<<<<<<<<<<<
* PetscPC pc,
* PetscInt point,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunction(PC __pyx_v_pc, PetscInt __pyx_v_point, Vec __pyx_v_vec, Vec __pyx_v_out, IS __pyx_v_cells, CYTHON_UNUSED PetscInt __pyx_v_ndof, PetscInt const *__pyx_v_dofmap, PetscInt const *__pyx_v_dofmapWithAll, void *__pyx_v_ctx) {
struct PyPetscVecObject *__pyx_v_Out = 0;
struct PyPetscVecObject *__pyx_v_Vec = 0;
struct PyPetscPCObject *__pyx_v_Pc = 0;
struct PyPetscISObject *__pyx_v_Is = 0;
PyObject *__pyx_v_context = 0;
PyObject *__pyx_v_op = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
__Pyx_memviewslice __pyx_v_pydofs = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_pydofsWithAll = { 0, 0, { 0 }, { 0 }, { 0 } };
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
struct __pyx_array_obj *__pyx_t_9 = NULL;
__Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("PCPatch_ComputeFunction", 0);
/* "petsc4py/PETSc/petscpc.pxi":406
* const PetscInt *dofmapWithAll,
* void *ctx) except PETSC_ERR_PYTHON with gil:
* cdef Vec Out = ref_Vec(out) # <<<<<<<<<<<<<<
* cdef Vec Vec = ref_Vec(vec)
* cdef PC Pc = ref_PC(pc)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_out)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Out = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":407
* void *ctx) except PETSC_ERR_PYTHON with gil:
* cdef Vec Out = ref_Vec(out)
* cdef Vec Vec = ref_Vec(vec) # <<<<<<<<<<<<<<
* cdef PC Pc = ref_PC(pc)
* cdef IS Is = ref_IS(cells)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":408
* cdef Vec Out = ref_Vec(out)
* cdef Vec Vec = ref_Vec(vec)
* cdef PC Pc = ref_PC(pc) # <<<<<<<<<<<<<<
* cdef IS Is = ref_IS(cells)
* cdef object context = Pc.get_attr("__patch_compute_function__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_PC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 408, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":409
* cdef Vec Vec = ref_Vec(vec)
* cdef PC Pc = ref_PC(pc)
* cdef IS Is = ref_IS(cells) # <<<<<<<<<<<<<<
* cdef object context = Pc.get_attr("__patch_compute_function__")
* if context is None and ctx != NULL: context = <object>ctx
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_cells)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":410
* cdef PC Pc = ref_PC(pc)
* cdef IS Is = ref_IS(cells)
* cdef object context = Pc.get_attr("__patch_compute_function__") # <<<<<<<<<<<<<<
* if context is None and ctx != NULL: context = <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(8, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":411
* cdef IS Is = ref_IS(cells)
* cdef object context = Pc.get_attr("__patch_compute_function__")
* if context is None and ctx != NULL: context = <object>ctx # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (op, args, kargs) = context
*/
__pyx_t_3 = (__pyx_v_context == Py_None);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
__pyx_t_1 = ((PyObject *)__pyx_v_ctx);
__Pyx_INCREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1);
__pyx_t_1 = 0;
}
/* "petsc4py/PETSc/petscpc.pxi":412
* cdef object context = Pc.get_attr("__patch_compute_function__")
* if context is None and ctx != NULL: context = <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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(8, 412, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscpc.pxi":413
* 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(8, 413, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 413, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 413, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 413, __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(8, 413, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(8, 413, __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(8, 413, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_op = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscpc.pxi":414
* 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(8, 414, __pyx_L1_error)
}
__pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 414, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 414, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_9 = __pyx_array_new(__pyx_t_6, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_5), (char *) "c", (char *) __pyx_v_dofmap);
if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 414, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(8, 414, __pyx_L1_error)
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
__pyx_v_pydofs = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
/* "petsc4py/PETSc/petscpc.pxi":415
* (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(8, 415, __pyx_L1_error)
}
__pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_9 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_6), (char *) "c", (char *) __pyx_v_dofmapWithAll);
if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(8, 415, __pyx_L1_error)
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
__pyx_v_pydofsWithAll = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
/* "petsc4py/PETSc/petscpc.pxi":416
* 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_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_point); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__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(8, 416, __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(8, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__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(8, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_Pc));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Pc));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Pc));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Vec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Vec));
PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Vec));
__Pyx_INCREF(((PyObject *)__pyx_v_Out));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Out));
PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_Out));
__Pyx_INCREF(((PyObject *)__pyx_v_Is));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Is));
PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_Is));
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_t_7);
__pyx_t_6 = 0;
__pyx_t_1 = 0;
__pyx_t_7 = 0;
__pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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(8, 416, __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(8, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
} else {
__pyx_t_7 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
}
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscpc.pxi":417
* 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":396
* return PETSC_SUCCESS
*
* cdef PetscErrorCode PCPatch_ComputeFunction( # <<<<<<<<<<<<<<
* PetscPC pc,
* PetscInt point,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(((PyObject *)__pyx_t_9));
__PYX_XDEC_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_XDEC_MEMVIEW(&__pyx_v_pydofs, 1);
__PYX_XDEC_MEMVIEW(&__pyx_v_pydofsWithAll, 1);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscpc.pxi":419
* return PETSC_SUCCESS
*
* cdef PetscErrorCode PCPatch_ComputeOperatorInteriorFacets( # <<<<<<<<<<<<<<
* PetscPC pc,
* PetscInt point,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperatorInteriorFacets(PC __pyx_v_pc, PetscInt __pyx_v_point, Vec __pyx_v_vec, Mat __pyx_v_mat, IS __pyx_v_facets, CYTHON_UNUSED PetscInt __pyx_v_ndof, PetscInt const *__pyx_v_dofmap, PetscInt const *__pyx_v_dofmapWithAll, void *__pyx_v_ctx) {
struct PyPetscVecObject *__pyx_v_Vec = 0;
struct PyPetscMatObject *__pyx_v_Mat = 0;
struct PyPetscPCObject *__pyx_v_Pc = 0;
struct PyPetscISObject *__pyx_v_Is = 0;
PyObject *__pyx_v_context = 0;
PyObject *__pyx_v_op = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
__Pyx_memviewslice __pyx_v_pydofs = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_pydofsWithAll = { 0, 0, { 0 }, { 0 }, { 0 } };
PyArrayObject *__pyx_v_dofsall = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
struct __pyx_array_obj *__pyx_t_9 = NULL;
__Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("PCPatch_ComputeOperatorInteriorFacets", 0);
/* "petsc4py/PETSc/petscpc.pxi":429
* const PetscInt *dofmapWithAll,
* void *ctx) except PETSC_ERR_PYTHON with gil:
* cdef Vec Vec = ref_Vec(vec) # <<<<<<<<<<<<<<
* cdef Mat Mat = ref_Mat(mat)
* cdef PC Pc = ref_PC(pc)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":430
* void *ctx) except PETSC_ERR_PYTHON with gil:
* cdef Vec Vec = ref_Vec(vec)
* cdef Mat Mat = ref_Mat(mat) # <<<<<<<<<<<<<<
* cdef PC Pc = ref_PC(pc)
* cdef IS Is = ref_IS(facets)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 430, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Mat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":431
* cdef Vec Vec = ref_Vec(vec)
* cdef Mat Mat = ref_Mat(mat)
* cdef PC Pc = ref_PC(pc) # <<<<<<<<<<<<<<
* cdef IS Is = ref_IS(facets)
* cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_PC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 431, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":432
* cdef Mat Mat = ref_Mat(mat)
* cdef PC Pc = ref_PC(pc)
* cdef IS Is = ref_IS(facets) # <<<<<<<<<<<<<<
* cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__")
* if context is None and ctx != NULL: context = <object>ctx
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_facets)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":433
* cdef PC Pc = ref_PC(pc)
* cdef IS Is = ref_IS(facets)
* cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__") # <<<<<<<<<<<<<<
* if context is None and ctx != NULL: context = <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(8, 433, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":434
* cdef IS Is = ref_IS(facets)
* cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__")
* if context is None and ctx != NULL: context = <object>ctx # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (op, args, kargs) = context
*/
__pyx_t_3 = (__pyx_v_context == Py_None);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
__pyx_t_1 = ((PyObject *)__pyx_v_ctx);
__Pyx_INCREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1);
__pyx_t_1 = 0;
}
/* "petsc4py/PETSc/petscpc.pxi":435
* cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__")
* if context is None and ctx != NULL: context = <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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(8, 435, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscpc.pxi":436
* 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(8, 436, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 436, __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(8, 436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(8, 436, __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(8, 436, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_op = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscpc.pxi":437
* 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(8, 437, __pyx_L1_error)
}
__pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_9 = __pyx_array_new(__pyx_t_6, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_5), (char *) "c", (char *) __pyx_v_dofmap);
if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(8, 437, __pyx_L1_error)
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
__pyx_v_pydofs = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
/* "petsc4py/PETSc/petscpc.pxi":439
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscpc.pxi":440
* 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(8, 440, __pyx_L1_error)
}
__pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 440, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 440, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_9 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_6), (char *) "c", (char *) __pyx_v_dofmapWithAll);
if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 440, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(8, 440, __pyx_L1_error)
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
__pyx_v_pydofsWithAll = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
/* "petsc4py/PETSc/petscpc.pxi":441
* if dofmapWithAll != NULL:
* pydofsWithAll = <PetscInt[:ndof]>dofmapWithAll
* dofsall = asarray(pydofsWithAll) # <<<<<<<<<<<<<<
* else:
* dofsall = None
*/
__pyx_t_6 = __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_6)) __PYX_ERR(8, 441, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 441, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_dofsall = ((PyArrayObject *)__pyx_t_5);
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscpc.pxi":439
* 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":443
* dofsall = asarray(pydofsWithAll)
* else:
* dofsall = None # <<<<<<<<<<<<<<
* op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs)
* return PETSC_SUCCESS
*/
/*else*/ {
__Pyx_INCREF(Py_None);
__pyx_v_dofsall = ((PyArrayObject *)Py_None);
}
__pyx_L10:;
/* "petsc4py/PETSc/petscpc.pxi":444
* else:
* dofsall = None
* op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_point); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __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_6)) __PYX_ERR(8, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Pc));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Pc));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Pc));
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_Vec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Vec));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_Vec));
__Pyx_INCREF(((PyObject *)__pyx_v_Mat));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Mat));
PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_Mat));
__Pyx_INCREF(((PyObject *)__pyx_v_Is));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Is));
PyTuple_SET_ITEM(__pyx_t_6, 4, ((PyObject *)__pyx_v_Is));
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_dofsall));
__Pyx_GIVEREF(((PyObject *)__pyx_v_dofsall));
PyTuple_SET_ITEM(__pyx_t_6, 6, ((PyObject *)__pyx_v_dofsall));
__pyx_t_5 = 0;
__pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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(8, 444, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
__pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscpc.pxi":445
* dofsall = None
* op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode PCPatch_ComputeFunctionInteriorFacets(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscpc.pxi":419
* return PETSC_SUCCESS
*
* cdef PetscErrorCode PCPatch_ComputeOperatorInteriorFacets( # <<<<<<<<<<<<<<
* PetscPC pc,
* PetscInt point,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(((PyObject *)__pyx_t_9));
__PYX_XDEC_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_XDEC_MEMVIEW(&__pyx_v_pydofs, 1);
__PYX_XDEC_MEMVIEW(&__pyx_v_pydofsWithAll, 1);
__Pyx_XDECREF((PyObject *)__pyx_v_dofsall);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscpc.pxi":447
* return PETSC_SUCCESS
*
* cdef PetscErrorCode PCPatch_ComputeFunctionInteriorFacets( # <<<<<<<<<<<<<<
* PetscPC pc,
* PetscInt point,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunctionInteriorFacets(PC __pyx_v_pc, PetscInt __pyx_v_point, Vec __pyx_v_vec, Vec __pyx_v_out, IS __pyx_v_facets, CYTHON_UNUSED PetscInt __pyx_v_ndof, PetscInt const *__pyx_v_dofmap, PetscInt const *__pyx_v_dofmapWithAll, void *__pyx_v_ctx) {
struct PyPetscVecObject *__pyx_v_Out = 0;
struct PyPetscVecObject *__pyx_v_Vec = 0;
struct PyPetscPCObject *__pyx_v_Pc = 0;
struct PyPetscISObject *__pyx_v_Is = 0;
PyObject *__pyx_v_context = 0;
PyObject *__pyx_v_op = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
__Pyx_memviewslice __pyx_v_pydofs = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_pydofsWithAll = { 0, 0, { 0 }, { 0 }, { 0 } };
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
struct __pyx_array_obj *__pyx_t_9 = NULL;
__Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("PCPatch_ComputeFunctionInteriorFacets", 0);
/* "petsc4py/PETSc/petscpc.pxi":457
* const PetscInt *dofmapWithAll,
* void *ctx) except PETSC_ERR_PYTHON with gil:
* cdef Vec Out = ref_Vec(out) # <<<<<<<<<<<<<<
* cdef Vec Vec = ref_Vec(vec)
* cdef PC Pc = ref_PC(pc)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_out)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 457, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Out = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":458
* void *ctx) except PETSC_ERR_PYTHON with gil:
* cdef Vec Out = ref_Vec(out)
* cdef Vec Vec = ref_Vec(vec) # <<<<<<<<<<<<<<
* cdef PC Pc = ref_PC(pc)
* cdef IS Is = ref_IS(facets)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":459
* cdef Vec Out = ref_Vec(out)
* cdef Vec Vec = ref_Vec(vec)
* cdef PC Pc = ref_PC(pc) # <<<<<<<<<<<<<<
* cdef IS Is = ref_IS(facets)
* cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_PC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 459, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":460
* cdef Vec Vec = ref_Vec(vec)
* cdef PC Pc = ref_PC(pc)
* cdef IS Is = ref_IS(facets) # <<<<<<<<<<<<<<
* cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__")
* if context is None and ctx != NULL: context = <object>ctx
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_facets)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":461
* cdef PC Pc = ref_PC(pc)
* cdef IS Is = ref_IS(facets)
* cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__") # <<<<<<<<<<<<<<
* if context is None and ctx != NULL: context = <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(8, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":462
* cdef IS Is = ref_IS(facets)
* cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__")
* if context is None and ctx != NULL: context = <object>ctx # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (op, args, kargs) = context
*/
__pyx_t_3 = (__pyx_v_context == Py_None);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
__pyx_t_1 = ((PyObject *)__pyx_v_ctx);
__Pyx_INCREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1);
__pyx_t_1 = 0;
}
/* "petsc4py/PETSc/petscpc.pxi":463
* cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__")
* if context is None and ctx != NULL: context = <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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(8, 463, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscpc.pxi":464
* 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(8, 464, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 464, __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(8, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(8, 464, __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(8, 464, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_op = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscpc.pxi":465
* 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(8, 465, __pyx_L1_error)
}
__pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 465, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 465, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_9 = __pyx_array_new(__pyx_t_6, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_5), (char *) "c", (char *) __pyx_v_dofmap);
if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 465, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(8, 465, __pyx_L1_error)
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
__pyx_v_pydofs = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
/* "petsc4py/PETSc/petscpc.pxi":466
* (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(8, 466, __pyx_L1_error)
}
__pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 466, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 466, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_9 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_6), (char *) "c", (char *) __pyx_v_dofmapWithAll);
if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 466, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(8, 466, __pyx_L1_error)
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
__pyx_v_pydofsWithAll = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
/* "petsc4py/PETSc/petscpc.pxi":467
* 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_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_point); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__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(8, 467, __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(8, 467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__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(8, 467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_Pc));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Pc));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Pc));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Vec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Vec));
PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Vec));
__Pyx_INCREF(((PyObject *)__pyx_v_Out));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Out));
PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_Out));
__Pyx_INCREF(((PyObject *)__pyx_v_Is));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Is));
PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_Is));
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_t_7);
__pyx_t_6 = 0;
__pyx_t_1 = 0;
__pyx_t_7 = 0;
__pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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(8, 467, __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(8, 467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
} else {
__pyx_t_7 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
}
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscpc.pxi":468
* 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":447
* return PETSC_SUCCESS
*
* cdef PetscErrorCode PCPatch_ComputeFunctionInteriorFacets( # <<<<<<<<<<<<<<
* PetscPC pc,
* PetscInt point,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(((PyObject *)__pyx_t_9));
__PYX_XDEC_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_XDEC_MEMVIEW(&__pyx_v_pydofs, 1);
__PYX_XDEC_MEMVIEW(&__pyx_v_pydofsWithAll, 1);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscpc.pxi":470
* return PETSC_SUCCESS
*
* cdef PetscErrorCode PCPatch_UserConstructOperator( # <<<<<<<<<<<<<<
* PetscPC pc,
* PetscInt *n,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCPatch_UserConstructOperator(PC __pyx_v_pc, PetscInt *__pyx_v_n, IS **__pyx_v_userIS, IS *__pyx_v_userIterationSet, void *__pyx_v_ctx) {
struct PyPetscPCObject *__pyx_v_Pc = 0;
PetscInt __pyx_v_i;
PyObject *__pyx_v_context = 0;
PyObject *__pyx_v_op = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PyObject *__pyx_v_patches = NULL;
PyObject *__pyx_v_iterationSet = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
Py_ssize_t __pyx_t_9;
PetscErrorCode __pyx_t_10;
PetscInt __pyx_t_11;
PetscInt __pyx_t_12;
PetscInt __pyx_t_13;
IS __pyx_t_14;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("PCPatch_UserConstructOperator", 0);
/* "petsc4py/PETSc/petscpc.pxi":476
* PetscIS *userIterationSet,
* void *ctx) except PETSC_ERR_PYTHON with gil:
* cdef PC Pc = ref_PC(pc) # <<<<<<<<<<<<<<
* cdef PetscInt i
* cdef object context = Pc.get_attr("__patch_construction_operator__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_PC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 476, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":478
* cdef PC Pc = ref_PC(pc)
* cdef PetscInt i
* cdef object context = Pc.get_attr("__patch_construction_operator__") # <<<<<<<<<<<<<<
* if context is None and ctx != NULL: context = <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(8, 478, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":479
* cdef PetscInt i
* cdef object context = Pc.get_attr("__patch_construction_operator__")
* if context is None and ctx != NULL: context = <object>ctx # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (op, args, kargs) = context
*/
__pyx_t_3 = (__pyx_v_context == Py_None);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
__pyx_t_1 = ((PyObject *)__pyx_v_ctx);
__Pyx_INCREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1);
__pyx_t_1 = 0;
}
/* "petsc4py/PETSc/petscpc.pxi":480
* cdef object context = Pc.get_attr("__patch_construction_operator__")
* if context is None and ctx != NULL: context = <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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(8, 480, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscpc.pxi":481
* 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] = 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(8, 481, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 481, __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(8, 481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(8, 481, __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(8, 481, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_op = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscpc.pxi":482
* assert context is not None and type(context) is tuple
* (op, args, kargs) = context
* (patches, iterationSet) = op(Pc, *args, **kargs) # <<<<<<<<<<<<<<
* n[0] = len(patches)
* CHKERR(PetscMalloc(<size_t>n[0]*sizeof(PetscIS), userIS))
*/
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Pc));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Pc));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Pc));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(8, 482, __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(8, 482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
PyObject* sequence = __pyx_t_6;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(8, 482, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_5 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_1);
#else
__pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 482, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L10_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(8, 482, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L11_unpacking_done;
__pyx_L10_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(8, 482, __pyx_L1_error)
__pyx_L11_unpacking_done:;
}
__pyx_v_patches = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_iterationSet = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpc.pxi":483
* (op, args, kargs) = context
* (patches, iterationSet) = op(Pc, *args, **kargs)
* n[0] = len(patches) # <<<<<<<<<<<<<<
* CHKERR(PetscMalloc(<size_t>n[0]*sizeof(PetscIS), userIS))
* for i in range(n[0]):
*/
__pyx_t_9 = PyObject_Length(__pyx_v_patches); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(8, 483, __pyx_L1_error)
(__pyx_v_n[0]) = __pyx_t_9;
/* "petsc4py/PETSc/petscpc.pxi":484
* (patches, iterationSet) = op(Pc, *args, **kargs)
* n[0] = 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_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)(__pyx_v_n[0])) * (sizeof(IS))), __pyx_v_userIS)); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(8, 484, __pyx_L1_error)
/* "petsc4py/PETSc/petscpc.pxi":485
* n[0] = len(patches)
* CHKERR(PetscMalloc(<size_t>n[0]*sizeof(PetscIS), userIS))
* for i in range(n[0]): # <<<<<<<<<<<<<<
* userIS[0][i] = (<IS?>patches[i]).iset
* PetscINCREF(<PetscObject*>&(userIS[0][i]))
*/
__pyx_t_11 = (__pyx_v_n[0]);
__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/petscpc.pxi":486
* CHKERR(PetscMalloc(<size_t>n[0]*sizeof(PetscIS), userIS))
* for i in range(n[0]):
* userIS[0][i] = (<IS?>patches[i]).iset # <<<<<<<<<<<<<<
* PetscINCREF(<PetscObject*>&(userIS[0][i]))
* userIterationSet[0] = (<IS?>iterationSet).iset
*/
__pyx_t_6 = __Pyx_GetItemInt(__pyx_v_patches, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 486, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (!(likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(8, 486, __pyx_L1_error)
__pyx_t_14 = ((struct PyPetscISObject *)__pyx_t_6)->iset;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
((__pyx_v_userIS[0])[__pyx_v_i]) = __pyx_t_14;
/* "petsc4py/PETSc/petscpc.pxi":487
* for i in range(n[0]):
* userIS[0][i] = (<IS?>patches[i]).iset
* PetscINCREF(<PetscObject*>&(userIS[0][i])) # <<<<<<<<<<<<<<
* userIterationSet[0] = (<IS?>iterationSet).iset
* PetscINCREF(<PetscObject*>&(userIterationSet[0]))
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&((__pyx_v_userIS[0])[__pyx_v_i])))));
}
/* "petsc4py/PETSc/petscpc.pxi":488
* userIS[0][i] = (<IS?>patches[i]).iset
* PetscINCREF(<PetscObject*>&(userIS[0][i]))
* userIterationSet[0] = (<IS?>iterationSet).iset # <<<<<<<<<<<<<<
* PetscINCREF(<PetscObject*>&(userIterationSet[0]))
* return PETSC_SUCCESS
*/
if (!(likely(__Pyx_TypeTest(__pyx_v_iterationSet, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(8, 488, __pyx_L1_error)
__pyx_t_14 = ((struct PyPetscISObject *)__pyx_v_iterationSet)->iset;
(__pyx_v_userIterationSet[0]) = __pyx_t_14;
/* "petsc4py/PETSc/petscpc.pxi":489
* PetscINCREF(<PetscObject*>&(userIS[0][i]))
* userIterationSet[0] = (<IS?>iterationSet).iset
* PetscINCREF(<PetscObject*>&(userIterationSet[0])) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&(__pyx_v_userIterationSet[0])))));
/* "petsc4py/PETSc/petscpc.pxi":490
* userIterationSet[0] = (<IS?>iterationSet).iset
* PetscINCREF(<PetscObject*>&(userIterationSet[0]))
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscpc.pxi":470
* return PETSC_SUCCESS
*
* cdef PetscErrorCode PCPatch_UserConstructOperator( # <<<<<<<<<<<<<<
* PetscPC pc,
* PetscInt *n,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.PCPatch_UserConstructOperator", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Pc);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_op);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_XDECREF(__pyx_v_patches);
__Pyx_XDECREF(__pyx_v_iterationSet);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscksp.pxi":208
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ref_KSP", 0);
/* "petsc4py/PETSc/petscksp.pxi":209
*
* cdef inline KSP ref_KSP(PetscKSP ksp):
* cdef KSP ob = <KSP> KSP() # <<<<<<<<<<<<<<
* ob.ksp = ksp
* PetscINCREF(ob.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 209, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ob = ((struct PyPetscKSPObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscksp.pxi":210
* cdef inline KSP ref_KSP(PetscKSP ksp):
* cdef KSP ob = <KSP> KSP()
* ob.ksp = ksp # <<<<<<<<<<<<<<
* PetscINCREF(ob.obj)
* return ob
*/
__pyx_v_ob->ksp = __pyx_v_ksp;
/* "petsc4py/PETSc/petscksp.pxi":211
* cdef KSP ob = <KSP> KSP()
* ob.ksp = ksp
* PetscINCREF(ob.obj) # <<<<<<<<<<<<<<
* return ob
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj));
/* "petsc4py/PETSc/petscksp.pxi":212
* ob.ksp = ksp
* 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":208
* # -----------------------------------------------------------------------------
*
* 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":216
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_t_8;
KSPConvergedReason __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("KSP_Converged", 0);
/* "petsc4py/PETSc/petscksp.pxi":223
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef KSP Ksp = ref_KSP(ksp) # <<<<<<<<<<<<<<
* (converged, args, kargs) = Ksp.get_attr('__converged__')
* reason = converged(Ksp, toInt(its), toReal(rnm), *args, **kargs)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 223, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscksp.pxi":224
* ) except PETSC_ERR_PYTHON with gil:
* cdef KSP Ksp = ref_KSP(ksp)
* (converged, args, kargs) = Ksp.get_attr('__converged__') # <<<<<<<<<<<<<<
* reason = converged(Ksp, toInt(its), toReal(rnm), *args, **kargs)
* if reason is None: r[0] = KSP_CONVERGED_ITERATING
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_Ksp->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ksp), ((char *)"__converged__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
PyObject* sequence = __pyx_t_1;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(22, 224, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
__pyx_t_4 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(22, 224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(22, 224, __pyx_L1_error)
__pyx_t_6 = NULL;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L4_unpacking_done;
__pyx_L3_unpacking_failed:;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(22, 224, __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":225
* cdef KSP Ksp = ref_KSP(ksp)
* (converged, args, kargs) = Ksp.get_attr('__converged__')
* reason = converged(Ksp, toInt(its), toReal(rnm), *args, **kargs) # <<<<<<<<<<<<<<
* if reason is None: r[0] = KSP_CONVERGED_ITERATING
* elif reason is False: r[0] = KSP_CONVERGED_ITERATING
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_its); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rnm); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_Ksp));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ksp));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_Ksp));
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4);
__pyx_t_1 = 0;
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(22, 225, __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, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
} else {
__pyx_t_4 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_converged, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 225, __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":226
* (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);
__pyx_t_8 = (__pyx_t_7 != 0);
if (__pyx_t_8) {
(__pyx_v_r[0]) = KSP_CONVERGED_ITERATING;
goto __pyx_L5;
}
/* "petsc4py/PETSc/petscksp.pxi":227
* 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_8 = (__pyx_v_reason == Py_False);
__pyx_t_7 = (__pyx_t_8 != 0);
if (__pyx_t_7) {
(__pyx_v_r[0]) = KSP_CONVERGED_ITERATING;
goto __pyx_L5;
}
/* "petsc4py/PETSc/petscksp.pxi":228
* 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);
__pyx_t_8 = (__pyx_t_7 != 0);
if (__pyx_t_8) {
(__pyx_v_r[0]) = KSP_CONVERGED_ITS;
goto __pyx_L5;
}
/* "petsc4py/PETSc/petscksp.pxi":229
* 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_9 = ((KSPConvergedReason)__Pyx_PyInt_As_KSPConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(22, 229, __pyx_L1_error)
(__pyx_v_r[0]) = __pyx_t_9;
}
__pyx_L5:;
/* "petsc4py/PETSc/petscksp.pxi":230
* 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":216
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode KSP_Converged( # <<<<<<<<<<<<<<
* PetscKSP ksp,
* PetscInt its,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.KSP_Converged", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ksp);
__Pyx_XDECREF(__pyx_v_converged);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_XDECREF(__pyx_v_reason);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscksp.pxi":234
* # -----------------------------------------------------------------------------
*
* 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;
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 = NULL;
PyObject *(*__pyx_t_11)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("KSP_Monitor", 0);
/* "petsc4py/PETSc/petscksp.pxi":240
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef KSP Ksp = ref_KSP(ksp) # <<<<<<<<<<<<<<
* cdef object monitorlist = Ksp.get_attr('__monitor__')
* if monitorlist is None: return PETSC_SUCCESS
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 240, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscksp.pxi":241
* ) except PETSC_ERR_PYTHON with gil:
* cdef KSP Ksp = ref_KSP(ksp)
* cdef object monitorlist = Ksp.get_attr('__monitor__') # <<<<<<<<<<<<<<
* if monitorlist is None: return PETSC_SUCCESS
* for (monitor, args, kargs) in monitorlist:
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_Ksp->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ksp), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 241, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_monitorlist = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscksp.pxi":242
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscksp.pxi":243
* 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_4 = 0;
__pyx_t_5 = NULL;
} else {
__pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_monitorlist); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 243, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_5)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(22, 243, __pyx_L1_error)
#else
__pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(22, 243, __pyx_L1_error)
#else
__pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
}
} else {
__pyx_t_6 = __pyx_t_5(__pyx_t_1);
if (unlikely(!__pyx_t_6)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(22, 243, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_6);
}
if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
PyObject* sequence = __pyx_t_6;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(22, 243, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
__pyx_t_9 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
#else
__pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(22, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(22, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L6_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_L6_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_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_9);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(22, 243, __pyx_L1_error)
__pyx_t_11 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L7_unpacking_done;
__pyx_L6_unpacking_failed:;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(22, 243, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_monitor, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_8);
__pyx_t_8 = 0;
__Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_9);
__pyx_t_9 = 0;
/* "petsc4py/PETSc/petscksp.pxi":244
* 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_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_its); if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rnm); if (unlikely(!__pyx_t_9)) __PYX_ERR(22, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(((PyObject *)__pyx_v_Ksp));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ksp));
PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_Ksp));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_9);
__pyx_t_6 = 0;
__pyx_t_9 = 0;
__pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_9)) __PYX_ERR(22, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_6 = PyNumber_Add(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(22, 244, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_9 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_9)) __PYX_ERR(22, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
} else {
__pyx_t_9 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(22, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
}
__pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_monitor, __pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "petsc4py/PETSc/petscksp.pxi":243
* 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":245
* 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":234
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode KSP_Monitor( # <<<<<<<<<<<<<<
* PetscKSP ksp,
* PetscInt its,
*/
/* 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_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("petsc4py.PETSc.KSP_Monitor", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ksp);
__Pyx_XDECREF(__pyx_v_monitorlist);
__Pyx_XDECREF(__pyx_v_monitor);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscksp.pxi":249
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("KSP_ComputeRHS", 0);
/* "petsc4py/PETSc/petscksp.pxi":254
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef KSP Ksp = ref_KSP(ksp) # <<<<<<<<<<<<<<
* cdef Vec Rhs = ref_Vec(rhs)
* cdef object context = Ksp.get_attr('__rhs__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 254, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscksp.pxi":255
* ) 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(22, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Rhs = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscksp.pxi":256
* 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(22, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscksp.pxi":257
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":258
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(22, 258, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscksp.pxi":259
* 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(22, 259, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 259, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 259, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 259, __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, 259, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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, 259, __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, 259, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_computerhs = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscksp.pxi":260
* 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_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 260, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Ksp));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ksp));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Ksp));
__Pyx_INCREF(((PyObject *)__pyx_v_Rhs));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Rhs));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Rhs));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 260, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 260, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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, 260, __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, 260, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 260, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_computerhs, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 260, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscksp.pxi":261
* (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":249
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode KSP_ComputeRHS( # <<<<<<<<<<<<<<
* PetscKSP ksp,
* PetscVec rhs,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.KSP_ComputeRHS", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ksp);
__Pyx_XDECREF((PyObject *)__pyx_v_Rhs);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_computerhs);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscksp.pxi":263
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("KSP_ComputeOps", 0);
/* "petsc4py/PETSc/petscksp.pxi":269
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef KSP Ksp = ref_KSP(ksp) # <<<<<<<<<<<<<<
* cdef Mat Amat = ref_Mat(A)
* cdef Mat Bmat = ref_Mat(B)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscksp.pxi":270
* ) except PETSC_ERR_PYTHON with gil:
* cdef KSP Ksp = ref_KSP(ksp)
* cdef Mat Amat = ref_Mat(A) # <<<<<<<<<<<<<<
* cdef Mat Bmat = ref_Mat(B)
* cdef object context = Ksp.get_attr('__operators__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_A)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 270, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Amat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscksp.pxi":271
* 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(22, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Bmat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscksp.pxi":272
* 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(22, 272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscksp.pxi":273
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":274
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(22, 274, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscksp.pxi":275
* 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(22, 275, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 275, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 275, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 275, __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, 275, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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, 275, __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, 275, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_computeops = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscksp.pxi":276
* 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_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Ksp));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ksp));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Ksp));
__Pyx_INCREF(((PyObject *)__pyx_v_Amat));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Amat));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Amat));
__Pyx_INCREF(((PyObject *)__pyx_v_Bmat));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Bmat));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_Bmat));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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, 276, __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, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_computeops, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscksp.pxi":277
* (computeops, args, kargs) = context
* computeops(Ksp, Amat, Bmat, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* # -----------------------------------------------------------------------------
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscksp.pxi":263
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.KSP_ComputeOps", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ksp);
__Pyx_XDECREF((PyObject *)__pyx_v_Amat);
__Pyx_XDECREF((PyObject *)__pyx_v_Bmat);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_computeops);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscsnes.pxi":262
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ref_SNES", 0);
/* "petsc4py/PETSc/petscsnes.pxi":263
*
* cdef inline SNES ref_SNES(PetscSNES snes):
* cdef SNES ob = <SNES> SNES() # <<<<<<<<<<<<<<
* ob.snes = snes
* PetscINCREF(ob.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ob = ((struct PyPetscSNESObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":264
* cdef inline SNES ref_SNES(PetscSNES snes):
* cdef SNES ob = <SNES> SNES()
* ob.snes = snes # <<<<<<<<<<<<<<
* PetscINCREF(ob.obj)
* return ob
*/
__pyx_v_ob->snes = __pyx_v_snes;
/* "petsc4py/PETSc/petscsnes.pxi":265
* cdef SNES ob = <SNES> SNES()
* ob.snes = snes
* PetscINCREF(ob.obj) # <<<<<<<<<<<<<<
* return ob
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj));
/* "petsc4py/PETSc/petscsnes.pxi":266
* ob.snes = snes
* 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":262
* # -----------------------------------------------------------------------------
*
* 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":270
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("SNES_InitialGuess", 0);
/* "petsc4py/PETSc/petscsnes.pxi":275
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<<
* cdef Vec Xvec = ref_Vec(x)
* cdef object context = Snes.get_attr('__initialguess__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 275, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":276
* ) 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(23, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":277
* 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(23, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":278
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":279
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(23, 279, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscsnes.pxi":280
* 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(23, 280, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(23, 280, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L9_unpacking_done;
__pyx_L8_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(23, 280, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_initialguess = __pyx_t_1;
__pyx_t_1 = 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":281
* 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_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Snes));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Snes));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Snes));
__Pyx_INCREF(((PyObject *)__pyx_v_Xvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Xvec));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(23, 281, __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, 281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_initialguess, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":282
* (initialguess, args, kargs) = context
* initialguess(Snes, Xvec, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* # -----------------------------------------------------------------------------
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscsnes.pxi":270
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode SNES_InitialGuess( # <<<<<<<<<<<<<<
* PetscSNES snes,
* PetscVec x,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.SNES_InitialGuess", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Snes);
__Pyx_XDECREF((PyObject *)__pyx_v_Xvec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_initialguess);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscsnes.pxi":286
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *(*__pyx_t_9)(PyObject *);
PetscBool __pyx_t_10;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("SNES_PreCheck", 0);
/* "petsc4py/PETSc/petscsnes.pxi":293
* 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":294
* ) except PETSC_ERR_PYTHON with gil:
* cdef PetscSNES snes = NULL;
* CHKERR( SNESLineSearchGetSNES(linesearch, &snes) ); # <<<<<<<<<<<<<<
* cdef object b = False
* cdef SNES Snes = ref_SNES(snes)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchGetSNES(__pyx_v_linesearch, (&__pyx_v_snes))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(23, 294, __pyx_L1_error)
/* "petsc4py/PETSc/petscsnes.pxi":295
* 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":296
* CHKERR( SNESLineSearchGetSNES(linesearch, &snes) );
* cdef object b = False
* cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<<
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec Yvec = ref_Vec(y)
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 296, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":297
* cdef object b = False
* cdef SNES Snes = ref_SNES(snes)
* cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<<
* cdef Vec Yvec = ref_Vec(y)
* cdef object context = Snes.get_attr('__precheck__')
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":298
* 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(23, 298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_Yvec = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":299
* 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(23, 299, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_context = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":300
* 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);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_5 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_3 = __pyx_t_5;
__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":301
* 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_5 = (__pyx_v_context != Py_None);
__pyx_t_4 = (__pyx_t_5 != 0);
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_5 = (__pyx_t_4 != 0);
__pyx_t_3 = __pyx_t_5;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(23, 301, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscsnes.pxi":302
* 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(23, 302, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_6 = PyList_GET_ITEM(sequence, 1);
__pyx_t_7 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(23, 302, __pyx_L1_error)
__pyx_t_9 = 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_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(23, 302, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_precheck = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_6;
__pyx_t_6 = 0;
__pyx_v_kargs = __pyx_t_7;
__pyx_t_7 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":303
* 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_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(((PyObject *)__pyx_v_Xvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec));
PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_Xvec));
__Pyx_INCREF(((PyObject *)__pyx_v_Yvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Yvec));
PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_Yvec));
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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(23, 303, __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(23, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_precheck, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF_SET(__pyx_v_b, __pyx_t_7);
__pyx_t_7 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":304
* (precheck, args, kargs) = context
* b = precheck(Xvec, Yvec, *args, **kargs)
* changed[0] = asBool(b) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_10 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_b); if (unlikely(__pyx_t_10 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(23, 304, __pyx_L1_error)
(__pyx_v_changed[0]) = __pyx_t_10;
/* "petsc4py/PETSc/petscsnes.pxi":305
* b = precheck(Xvec, Yvec, *args, **kargs)
* changed[0] = asBool(b)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* # -----------------------------------------------------------------------------
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscsnes.pxi":286
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode SNES_PreCheck( # <<<<<<<<<<<<<<
* PetscSNESLineSearch linesearch,
* PetscVec x,
*/
/* 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.SNES_PreCheck", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_b);
__Pyx_XDECREF((PyObject *)__pyx_v_Snes);
__Pyx_XDECREF((PyObject *)__pyx_v_Xvec);
__Pyx_XDECREF((PyObject *)__pyx_v_Yvec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_precheck);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscsnes.pxi":310
*
*
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("SNES_Function", 0);
/* "petsc4py/PETSc/petscsnes.pxi":316
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<<
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec Fvec = ref_Vec(f)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 316, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":317
* ) except PETSC_ERR_PYTHON with gil:
* cdef SNES Snes = ref_SNES(snes)
* cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<<
* cdef Vec Fvec = ref_Vec(f)
* cdef object context = Snes.get_attr('__function__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":318
* 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(23, 318, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":319
* 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(23, 319, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":320
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":321
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(23, 321, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscsnes.pxi":322
* 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(23, 322, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(23, 322, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L9_unpacking_done;
__pyx_L8_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(23, 322, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_function = __pyx_t_1;
__pyx_t_1 = 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":323
* 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_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Snes));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Snes));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Snes));
__Pyx_INCREF(((PyObject *)__pyx_v_Xvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Xvec));
__Pyx_INCREF(((PyObject *)__pyx_v_Fvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Fvec));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_Fvec));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(23, 323, __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, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_function, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":324
* (function, args, kargs) = context
* function(Snes, Xvec, Fvec, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* # -----------------------------------------------------------------------------
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscsnes.pxi":310
*
*
* cdef PetscErrorCode SNES_Function( # <<<<<<<<<<<<<<
* PetscSNES snes,
* PetscVec x,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.SNES_Function", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Snes);
__Pyx_XDECREF((PyObject *)__pyx_v_Xvec);
__Pyx_XDECREF((PyObject *)__pyx_v_Fvec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_function);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscsnes.pxi":328
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("SNES_Update", 0);
/* "petsc4py/PETSc/petscsnes.pxi":332
* PetscInt its,
* ) except PETSC_ERR_PYTHON with gil:
* cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<<
* cdef object context = Snes.get_attr('__update__')
* assert context is not None and type(context) is tuple # sanity check
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":333
* ) except PETSC_ERR_PYTHON with gil:
* cdef SNES Snes = ref_SNES(snes)
* cdef object context = Snes.get_attr('__update__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple # sanity check
* (update, args, kargs) = context
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__update__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 333, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":334
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_4 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_3 = (__pyx_t_4 != 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(23, 334, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscsnes.pxi":335
* cdef object context = Snes.get_attr('__update__')
* assert context is not None and type(context) is tuple # sanity check
* (update, args, kargs) = context # <<<<<<<<<<<<<<
* update(Snes, toInt(its), *args, **kargs)
* return PETSC_SUCCESS
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(23, 335, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 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(23, 335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_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_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(23, 335, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(23, 335, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_update = __pyx_t_1;
__pyx_t_1 = 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
* (update, args, kargs) = context
* update(Snes, toInt(its), *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_its); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 336, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 336, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_Snes));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Snes));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Snes));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 336, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 336, __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;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(23, 336, __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(23, 336, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 336, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_update, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 336, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":337
* (update, args, kargs) = context
* update(Snes, toInt(its), *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* # -----------------------------------------------------------------------------
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscsnes.pxi":328
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode SNES_Update( # <<<<<<<<<<<<<<
* PetscSNES snes,
* 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_AddTraceback("petsc4py.PETSc.SNES_Update", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Snes);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_update);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscsnes.pxi":341
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("SNES_Jacobian", 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 Mat Jmat = ref_Mat(J)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 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 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, 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 Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<<
* cdef Mat Pmat = ref_Mat(P)
* cdef object context = Snes.get_attr('__jacobian__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 350, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":351
* 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(23, 351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":352
* 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(23, 352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":353
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":354
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(23, 354, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscsnes.pxi":355
* 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(23, 355, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(23, 355, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L9_unpacking_done;
__pyx_L8_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(23, 355, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_jacobian = __pyx_t_1;
__pyx_t_1 = 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":356
* 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_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Snes));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Snes));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Snes));
__Pyx_INCREF(((PyObject *)__pyx_v_Xvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Xvec));
__Pyx_INCREF(((PyObject *)__pyx_v_Jmat));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Jmat));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_Jmat));
__Pyx_INCREF(((PyObject *)__pyx_v_Pmat));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Pmat));
PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_Pmat));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(23, 356, __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, 356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":357
* (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":341
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode SNES_Jacobian( # <<<<<<<<<<<<<<
* PetscSNES snes,
* PetscVec x,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.SNES_Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Snes);
__Pyx_XDECREF((PyObject *)__pyx_v_Xvec);
__Pyx_XDECREF((PyObject *)__pyx_v_Jmat);
__Pyx_XDECREF((PyObject *)__pyx_v_Pmat);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_jacobian);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscsnes.pxi":361
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
PetscReal __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("SNES_Objective", 0);
/* "petsc4py/PETSc/petscsnes.pxi":367
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<<
* cdef Vec Xvec = ref_Vec(x)
* cdef object context = Snes.get_attr('__objective__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":368
* ) 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(23, 368, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":369
* 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(23, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":370
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":371
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(23, 371, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscsnes.pxi":372
* 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(23, 372, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(23, 372, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L9_unpacking_done;
__pyx_L8_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(23, 372, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_objective = __pyx_t_1;
__pyx_t_1 = 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":373
* 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_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Snes));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Snes));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Snes));
__Pyx_INCREF(((PyObject *)__pyx_v_Xvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Xvec));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(23, 373, __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, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_objective, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_obj = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":374
* (objective, args, kargs) = context
* obj = objective(Snes, Xvec, *args, **kargs)
* o[0] = asReal(obj) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_obj); if (unlikely(__pyx_t_9 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(23, 374, __pyx_L1_error)
(__pyx_v_o[0]) = __pyx_t_9;
/* "petsc4py/PETSc/petscsnes.pxi":375
* obj = objective(Snes, Xvec, *args, **kargs)
* o[0] = asReal(obj)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* # -----------------------------------------------------------------------------
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscsnes.pxi":361
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode SNES_Objective( # <<<<<<<<<<<<<<
* PetscSNES snes,
* PetscVec x,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.SNES_Objective", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Snes);
__Pyx_XDECREF((PyObject *)__pyx_v_Xvec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_objective);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_XDECREF(__pyx_v_obj);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscsnes.pxi":379
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("SNES_NGS", 0);
/* "petsc4py/PETSc/petscsnes.pxi":385
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<<
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec Bvec = ref_Vec(b)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":386
* ) except PETSC_ERR_PYTHON with gil:
* cdef SNES Snes = ref_SNES(snes)
* cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<<
* cdef Vec Bvec = ref_Vec(b)
* cdef object context = Snes.get_attr('__ngs__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":387
* 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(23, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Bvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":388
* 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(23, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":389
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":390
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(23, 390, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscsnes.pxi":391
* 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(23, 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_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 391, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 391, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 391, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 391, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(23, 391, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L9_unpacking_done;
__pyx_L8_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(23, 391, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_ngs = __pyx_t_1;
__pyx_t_1 = 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":392
* 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_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Snes));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Snes));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Snes));
__Pyx_INCREF(((PyObject *)__pyx_v_Xvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Xvec));
__Pyx_INCREF(((PyObject *)__pyx_v_Bvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Bvec));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_Bvec));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(23, 392, __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, 392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_ngs, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":393
* (ngs, args, kargs) = context
* ngs(Snes, Xvec, Bvec, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* # -----------------------------------------------------------------------------
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscsnes.pxi":379
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode SNES_NGS( # <<<<<<<<<<<<<<
* PetscSNES snes,
* PetscVec x,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.SNES_NGS", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Snes);
__Pyx_XDECREF((PyObject *)__pyx_v_Xvec);
__Pyx_XDECREF((PyObject *)__pyx_v_Bvec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_ngs);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscsnes.pxi":397
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
SNESConvergedReason __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("SNES_Converged", 0);
/* "petsc4py/PETSc/petscsnes.pxi":406
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<<
* cdef object it = toInt(iters)
* cdef object xn = toReal(xnorm)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":407
* ) except PETSC_ERR_PYTHON with gil:
* cdef SNES Snes = ref_SNES(snes)
* cdef object it = toInt(iters) # <<<<<<<<<<<<<<
* cdef object xn = toReal(xnorm)
* cdef object gn = toReal(gnorm)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_iters); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_it = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":408
* cdef SNES Snes = ref_SNES(snes)
* cdef object it = toInt(iters)
* cdef object xn = toReal(xnorm) # <<<<<<<<<<<<<<
* cdef object gn = toReal(gnorm)
* cdef object fn = toReal(fnorm)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_xnorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 408, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_xn = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":409
* cdef object it = toInt(iters)
* cdef object xn = toReal(xnorm)
* cdef object gn = toReal(gnorm) # <<<<<<<<<<<<<<
* cdef object fn = toReal(fnorm)
* cdef object context = Snes.get_attr('__converged__')
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_gnorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_gn = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":410
* 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(23, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_fn = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":411
* 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(23, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":412
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":413
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(23, 413, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscsnes.pxi":414
* 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(23, 414, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 414, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 414, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 414, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 414, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(23, 414, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L9_unpacking_done;
__pyx_L8_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(23, 414, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_converged = __pyx_t_1;
__pyx_t_1 = 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":415
* 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_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_xn);
__Pyx_GIVEREF(__pyx_v_xn);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_xn);
__Pyx_INCREF(__pyx_v_gn);
__Pyx_GIVEREF(__pyx_v_gn);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_gn);
__Pyx_INCREF(__pyx_v_fn);
__Pyx_GIVEREF(__pyx_v_fn);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_fn);
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_Snes));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Snes));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Snes));
__Pyx_INCREF(__pyx_v_it);
__Pyx_GIVEREF(__pyx_v_it);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_it);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_6);
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 415, __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;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(23, 415, __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(23, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_converged, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_reason = __pyx_t_5;
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":416
* (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);
__pyx_t_4 = (__pyx_t_2 != 0);
if (__pyx_t_4) {
(__pyx_v_r[0]) = SNES_CONVERGED_ITERATING;
goto __pyx_L10;
}
/* "petsc4py/PETSc/petscsnes.pxi":417
* 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_4 = (__pyx_v_reason == Py_False);
__pyx_t_2 = (__pyx_t_4 != 0);
if (__pyx_t_2) {
(__pyx_v_r[0]) = SNES_CONVERGED_ITERATING;
goto __pyx_L10;
}
/* "petsc4py/PETSc/petscsnes.pxi":418
* 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);
__pyx_t_4 = (__pyx_t_2 != 0);
if (__pyx_t_4) {
(__pyx_v_r[0]) = SNES_CONVERGED_ITS;
goto __pyx_L10;
}
/* "petsc4py/PETSc/petscsnes.pxi":419
* 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_9 = ((SNESConvergedReason)__Pyx_PyInt_As_SNESConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(23, 419, __pyx_L1_error)
(__pyx_v_r[0]) = __pyx_t_9;
}
__pyx_L10:;
/* "petsc4py/PETSc/petscsnes.pxi":420
* 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":397
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode SNES_Converged( # <<<<<<<<<<<<<<
* 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_AddTraceback("petsc4py.PETSc.SNES_Converged", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Snes);
__Pyx_XDECREF(__pyx_v_it);
__Pyx_XDECREF(__pyx_v_xn);
__Pyx_XDECREF(__pyx_v_gn);
__Pyx_XDECREF(__pyx_v_fn);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_converged);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_XDECREF(__pyx_v_reason);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscsnes.pxi":424
* # -----------------------------------------------------------------------------
*
* 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;
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 = NULL;
PyObject *(*__pyx_t_11)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("SNES_Monitor", 0);
/* "petsc4py/PETSc/petscsnes.pxi":430
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<<
* cdef object monitorlist = Snes.get_attr('__monitor__')
* if monitorlist is None: return PETSC_SUCCESS
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 430, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":431
* ) except PETSC_ERR_PYTHON with gil:
* cdef SNES Snes = ref_SNES(snes)
* cdef object monitorlist = Snes.get_attr('__monitor__') # <<<<<<<<<<<<<<
* if monitorlist is None: return PETSC_SUCCESS
* cdef object it = toInt(iters)
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 431, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_monitorlist = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":432
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscsnes.pxi":433
* cdef object monitorlist = Snes.get_attr('__monitor__')
* if monitorlist is None: return PETSC_SUCCESS
* cdef object it = toInt(iters) # <<<<<<<<<<<<<<
* cdef object rn = toReal(rnorm)
* for (monitor, args, kargs) in monitorlist:
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_iters); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 433, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_it = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":434
* if monitorlist is None: return PETSC_SUCCESS
* cdef object it = toInt(iters)
* cdef object rn = toReal(rnorm) # <<<<<<<<<<<<<<
* for (monitor, args, kargs) in monitorlist:
* monitor(Snes, it, rn, *args, **kargs)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rnorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_rn = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":435
* 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_4 = 0;
__pyx_t_5 = NULL;
} else {
__pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_monitorlist); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 435, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_5)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(23, 435, __pyx_L1_error)
#else
__pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(23, 435, __pyx_L1_error)
#else
__pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
}
} else {
__pyx_t_6 = __pyx_t_5(__pyx_t_1);
if (unlikely(!__pyx_t_6)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(23, 435, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_6);
}
if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
PyObject* sequence = __pyx_t_6;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(23, 435, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
__pyx_t_9 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
#else
__pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(23, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(23, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L6_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_L6_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_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_9);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(23, 435, __pyx_L1_error)
__pyx_t_11 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L7_unpacking_done;
__pyx_L6_unpacking_failed:;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(23, 435, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_monitor, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_8);
__pyx_t_8 = 0;
__Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_9);
__pyx_t_9 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":436
* cdef object rn = toReal(rnorm)
* for (monitor, args, kargs) in monitorlist:
* monitor(Snes, it, rn, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Snes));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Snes));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Snes));
__Pyx_INCREF(__pyx_v_it);
__Pyx_GIVEREF(__pyx_v_it);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_it);
__Pyx_INCREF(__pyx_v_rn);
__Pyx_GIVEREF(__pyx_v_rn);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_rn);
__pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_9)) __PYX_ERR(23, 436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(23, 436, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_9 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_9)) __PYX_ERR(23, 436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
} else {
__pyx_t_9 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(23, 436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_monitor, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petscsnes.pxi":435
* 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":437
* 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":424
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode SNES_Monitor( # <<<<<<<<<<<<<<
* PetscSNES snes,
* PetscInt iters,
*/
/* 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_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("petsc4py.PETSc.SNES_Monitor", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Snes);
__Pyx_XDECREF(__pyx_v_monitorlist);
__Pyx_XDECREF(__pyx_v_it);
__Pyx_XDECREF(__pyx_v_rn);
__Pyx_XDECREF(__pyx_v_monitor);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscts.pxi":331
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ref_TS", 0);
/* "petsc4py/PETSc/petscts.pxi":332
*
* cdef inline TS ref_TS(PetscTS ts):
* cdef TS ob = <TS> TS() # <<<<<<<<<<<<<<
* ob.ts = ts
* PetscINCREF(ob.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ob = ((struct PyPetscTSObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscts.pxi":333
* cdef inline TS ref_TS(PetscTS ts):
* cdef TS ob = <TS> TS()
* ob.ts = ts # <<<<<<<<<<<<<<
* PetscINCREF(ob.obj)
* return ob
*/
__pyx_v_ob->ts = __pyx_v_ts;
/* "petsc4py/PETSc/petscts.pxi":334
* cdef TS ob = <TS> TS()
* ob.ts = ts
* PetscINCREF(ob.obj) # <<<<<<<<<<<<<<
* return ob
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj));
/* "petsc4py/PETSc/petscts.pxi":335
* ob.ts = ts
* 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":331
* # -----------------------------------------------------------------------------
*
* 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":339
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TS_RHSFunction", 0);
/* "petsc4py/PETSc/petscts.pxi":346
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<<
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec Fvec = ref_Vec(f)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":347
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts)
* cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<<
* cdef Vec Fvec = ref_Vec(f)
* cdef object context = Ts.get_attr('__rhsfunction__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 347, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":348
* 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(24, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":349
* 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(24, 349, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":350
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":351
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(24, 351, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscts.pxi":352
* 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(24, 352, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 352, __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(24, 352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(24, 352, __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(24, 352, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_function = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscts.pxi":353
* 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_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 353, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 353, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ts));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Xvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec));
PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Xvec));
__Pyx_INCREF(((PyObject *)__pyx_v_Fvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Fvec));
PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_Fvec));
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 353, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 353, __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;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(24, 353, __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, 353, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 353, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_function, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 353, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscts.pxi":354
* (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":339
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode TS_RHSFunction( # <<<<<<<<<<<<<<
* PetscTS ts,
* PetscReal t,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TS_RHSFunction", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ts);
__Pyx_XDECREF((PyObject *)__pyx_v_Xvec);
__Pyx_XDECREF((PyObject *)__pyx_v_Fvec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_function);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscts.pxi":356
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TS_RHSJacobian", 0);
/* "petsc4py/PETSc/petscts.pxi":364
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<<
* cdef Vec Xvec = ref_Vec(x)
* cdef Mat Jmat = ref_Mat(J)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 364, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":365
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts)
* cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<<
* cdef Mat Jmat = ref_Mat(J)
* cdef Mat Pmat = ref_Mat(P)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":366
* cdef TS Ts = ref_TS(ts)
* cdef Vec Xvec = ref_Vec(x)
* cdef Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<<
* cdef Mat Pmat = ref_Mat(P)
* cdef object context = Ts.get_attr('__rhsjacobian__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 366, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":367
* 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(24, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":368
* 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(24, 368, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":369
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":370
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(24, 370, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscts.pxi":371
* 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(24, 371, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 371, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 371, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 371, __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(24, 371, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(24, 371, __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(24, 371, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_jacobian = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscts.pxi":372
* 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_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ts));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Xvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec));
PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Xvec));
__Pyx_INCREF(((PyObject *)__pyx_v_Jmat));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Jmat));
PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_Jmat));
__Pyx_INCREF(((PyObject *)__pyx_v_Pmat));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Pmat));
PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_Pmat));
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 372, __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;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(24, 372, __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, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscts.pxi":373
* (jacobian, args, kargs) = context
* jacobian(Ts, toReal(t), Xvec, Jmat, Pmat, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* # -----------------------------------------------------------------------------
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscts.pxi":356
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TS_RHSJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ts);
__Pyx_XDECREF((PyObject *)__pyx_v_Xvec);
__Pyx_XDECREF((PyObject *)__pyx_v_Jmat);
__Pyx_XDECREF((PyObject *)__pyx_v_Pmat);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_jacobian);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscts.pxi":377
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TS_IFunction", 0);
/* "petsc4py/PETSc/petscts.pxi":385
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<<
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec XDvec = ref_Vec(xdot)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":386
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts)
* cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<<
* cdef Vec XDvec = ref_Vec(xdot)
* cdef Vec Fvec = ref_Vec(f)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":387
* cdef TS Ts = ref_TS(ts)
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec XDvec = ref_Vec(xdot) # <<<<<<<<<<<<<<
* cdef Vec Fvec = ref_Vec(f)
* cdef object context = Ts.get_attr('__ifunction__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":388
* 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(24, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":389
* 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(24, 389, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":390
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":391
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(24, 391, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscts.pxi":392
* 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(24, 392, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 392, __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(24, 392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(24, 392, __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(24, 392, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_function = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscts.pxi":393
* 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_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ts));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Xvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec));
PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Xvec));
__Pyx_INCREF(((PyObject *)__pyx_v_XDvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_XDvec));
PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_XDvec));
__Pyx_INCREF(((PyObject *)__pyx_v_Fvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Fvec));
PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_Fvec));
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 393, __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;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(24, 393, __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, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_function, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscts.pxi":394
* (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":377
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode TS_IFunction( # <<<<<<<<<<<<<<
* PetscTS ts,
* PetscReal t,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TS_IFunction", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ts);
__Pyx_XDECREF((PyObject *)__pyx_v_Xvec);
__Pyx_XDECREF((PyObject *)__pyx_v_XDvec);
__Pyx_XDECREF((PyObject *)__pyx_v_Fvec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_function);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscts.pxi":396
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TS_IJacobian", 0);
/* "petsc4py/PETSc/petscts.pxi":406
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<<
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec XDvec = ref_Vec(xdot)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":407
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts)
* cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<<
* cdef Vec XDvec = ref_Vec(xdot)
* cdef Mat Jmat = ref_Mat(J)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":408
* cdef TS Ts = ref_TS(ts)
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec XDvec = ref_Vec(xdot) # <<<<<<<<<<<<<<
* cdef Mat Jmat = ref_Mat(J)
* cdef Mat Pmat = ref_Mat(P)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 408, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":409
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec XDvec = ref_Vec(xdot)
* cdef Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<<
* cdef Mat Pmat = ref_Mat(P)
* cdef object context = Ts.get_attr('__ijacobian__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":410
* 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(24, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":411
* 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(24, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":412
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":413
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(24, 413, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscts.pxi":414
* 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(24, 414, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 414, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 414, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 414, __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(24, 414, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(24, 414, __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(24, 414, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_jacobian = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscts.pxi":415
* 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_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_a); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ts));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Xvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec));
PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_Xvec));
__Pyx_INCREF(((PyObject *)__pyx_v_XDvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_XDvec));
PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_XDvec));
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_Jmat));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Jmat));
PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_v_Jmat));
__Pyx_INCREF(((PyObject *)__pyx_v_Pmat));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Pmat));
PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)__pyx_v_Pmat));
__pyx_t_6 = 0;
__pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(24, 415, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":416
* (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":396
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TS_IJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ts);
__Pyx_XDECREF((PyObject *)__pyx_v_Xvec);
__Pyx_XDECREF((PyObject *)__pyx_v_XDvec);
__Pyx_XDECREF((PyObject *)__pyx_v_Jmat);
__Pyx_XDECREF((PyObject *)__pyx_v_Pmat);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_jacobian);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscts.pxi":418
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TS_IJacobianP", 0);
/* "petsc4py/PETSc/petscts.pxi":427
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<<
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec XDvec = ref_Vec(xdot)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 427, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":428
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts)
* cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<<
* cdef Vec XDvec = ref_Vec(xdot)
* cdef Mat Jmat = ref_Mat(J)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 428, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":429
* cdef TS Ts = ref_TS(ts)
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec XDvec = ref_Vec(xdot) # <<<<<<<<<<<<<<
* cdef Mat Jmat = ref_Mat(J)
* cdef object context = Ts.get_attr('__ijacobianp__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":430
* 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(24, 430, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":431
* 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(24, 431, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":432
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":433
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(24, 433, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscts.pxi":434
* 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(24, 434, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 434, __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(24, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(24, 434, __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(24, 434, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_jacobian = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscts.pxi":435
* 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_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_a); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ts));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Xvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec));
PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_Xvec));
__Pyx_INCREF(((PyObject *)__pyx_v_XDvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_XDvec));
PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_XDvec));
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_Jmat));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Jmat));
PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_v_Jmat));
__pyx_t_6 = 0;
__pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(24, 435, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":436
* (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":418
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TS_IJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ts);
__Pyx_XDECREF((PyObject *)__pyx_v_Xvec);
__Pyx_XDECREF((PyObject *)__pyx_v_XDvec);
__Pyx_XDECREF((PyObject *)__pyx_v_Jmat);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_jacobian);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscts.pxi":438
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TS_I2Function", 0);
/* "petsc4py/PETSc/petscts.pxi":447
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<<
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec XDvec = ref_Vec(xdot)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":448
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts)
* cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<<
* cdef Vec XDvec = ref_Vec(xdot)
* cdef Vec XDDvec = ref_Vec(xdotdot)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 448, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":449
* cdef TS Ts = ref_TS(ts)
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec XDvec = ref_Vec(xdot) # <<<<<<<<<<<<<<
* cdef Vec XDDvec = ref_Vec(xdotdot)
* cdef Vec Fvec = ref_Vec(f)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 449, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":450
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec XDvec = ref_Vec(xdot)
* cdef Vec XDDvec = ref_Vec(xdotdot) # <<<<<<<<<<<<<<
* cdef Vec Fvec = ref_Vec(f)
* cdef object context = Ts.get_attr('__i2function__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdotdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 450, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_XDDvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":451
* 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(24, 451, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":452
* 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(24, 452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":453
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":454
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(24, 454, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscts.pxi":455
* 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(24, 455, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 455, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 455, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 455, __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(24, 455, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(24, 455, __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(24, 455, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_function = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscts.pxi":456
* 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_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 456, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 456, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ts));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Xvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec));
PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Xvec));
__Pyx_INCREF(((PyObject *)__pyx_v_XDvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_XDvec));
PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_XDvec));
__Pyx_INCREF(((PyObject *)__pyx_v_XDDvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_XDDvec));
PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_XDDvec));
__Pyx_INCREF(((PyObject *)__pyx_v_Fvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Fvec));
PyTuple_SET_ITEM(__pyx_t_5, 5, ((PyObject *)__pyx_v_Fvec));
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 456, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 456, __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;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(24, 456, __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, 456, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 456, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_function, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 456, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscts.pxi":457
* (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":438
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TS_I2Function", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ts);
__Pyx_XDECREF((PyObject *)__pyx_v_Xvec);
__Pyx_XDECREF((PyObject *)__pyx_v_XDvec);
__Pyx_XDECREF((PyObject *)__pyx_v_XDDvec);
__Pyx_XDECREF((PyObject *)__pyx_v_Fvec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_function);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscts.pxi":459
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TS_I2Jacobian", 0);
/* "petsc4py/PETSc/petscts.pxi":471
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<<
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec XDvec = ref_Vec(xdot)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 471, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":472
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts)
* cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<<
* cdef Vec XDvec = ref_Vec(xdot)
* cdef Vec XDDvec = ref_Vec(xdotdot)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":473
* cdef TS Ts = ref_TS(ts)
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec XDvec = ref_Vec(xdot) # <<<<<<<<<<<<<<
* cdef Vec XDDvec = ref_Vec(xdotdot)
* cdef Mat Jmat = ref_Mat(J)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":474
* cdef Vec Xvec = ref_Vec(x)
* cdef Vec XDvec = ref_Vec(xdot)
* cdef Vec XDDvec = ref_Vec(xdotdot) # <<<<<<<<<<<<<<
* cdef Mat Jmat = ref_Mat(J)
* cdef Mat Pmat = ref_Mat(P)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdotdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_XDDvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":475
* cdef Vec XDvec = ref_Vec(xdot)
* cdef Vec XDDvec = ref_Vec(xdotdot)
* cdef Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<<
* cdef Mat Pmat = ref_Mat(P)
* cdef object context = Ts.get_attr('__i2jacobian__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 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 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(24, 476, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":477
* 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(24, 477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":478
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":479
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(24, 479, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscts.pxi":480
* 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(24, 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_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 480, __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(24, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(24, 480, __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(24, 480, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_jacobian = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscts.pxi":481
* 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_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_v); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = PyTuple_New(9); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ts));
PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Xvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec));
PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_v_Xvec));
__Pyx_INCREF(((PyObject *)__pyx_v_XDvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_XDvec));
PyTuple_SET_ITEM(__pyx_t_7, 3, ((PyObject *)__pyx_v_XDvec));
__Pyx_INCREF(((PyObject *)__pyx_v_XDDvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_XDDvec));
PyTuple_SET_ITEM(__pyx_t_7, 4, ((PyObject *)__pyx_v_XDDvec));
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_Jmat));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Jmat));
PyTuple_SET_ITEM(__pyx_t_7, 7, ((PyObject *)__pyx_v_Jmat));
__Pyx_INCREF(((PyObject *)__pyx_v_Pmat));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Pmat));
PyTuple_SET_ITEM(__pyx_t_7, 8, ((PyObject *)__pyx_v_Pmat));
__pyx_t_6 = 0;
__pyx_t_5 = 0;
__pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PyNumber_Add(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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, 481, __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, 481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
__pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 481, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "petsc4py/PETSc/petscts.pxi":482
* (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":459
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TS_I2Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ts);
__Pyx_XDECREF((PyObject *)__pyx_v_Xvec);
__Pyx_XDECREF((PyObject *)__pyx_v_XDvec);
__Pyx_XDECREF((PyObject *)__pyx_v_XDDvec);
__Pyx_XDECREF((PyObject *)__pyx_v_Jmat);
__Pyx_XDECREF((PyObject *)__pyx_v_Pmat);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_jacobian);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscts.pxi":486
* # -----------------------------------------------------------------------------
*
* 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;
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 = NULL;
PyObject *(*__pyx_t_11)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TS_Monitor", 0);
/* "petsc4py/PETSc/petscts.pxi":493
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<<
* cdef Vec Vu = ref_Vec(u)
* cdef object monitorlist = Ts.get_attr('__monitor__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":494
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts)
* cdef Vec Vu = ref_Vec(u) # <<<<<<<<<<<<<<
* cdef object monitorlist = Ts.get_attr('__monitor__')
* if monitorlist is None: return PETSC_SUCCESS
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_u)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 494, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Vu = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":495
* cdef TS Ts = ref_TS(ts)
* cdef Vec Vu = ref_Vec(u)
* cdef object monitorlist = Ts.get_attr('__monitor__') # <<<<<<<<<<<<<<
* if monitorlist is None: return PETSC_SUCCESS
* for (monitor, args, kargs) in monitorlist:
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 495, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_monitorlist = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":496
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscts.pxi":497
* 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_4 = 0;
__pyx_t_5 = NULL;
} else {
__pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_monitorlist); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 497, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 497, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_5)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(24, 497, __pyx_L1_error)
#else
__pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 497, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(24, 497, __pyx_L1_error)
#else
__pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 497, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
}
} else {
__pyx_t_6 = __pyx_t_5(__pyx_t_1);
if (unlikely(!__pyx_t_6)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(24, 497, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_6);
}
if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
PyObject* sequence = __pyx_t_6;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(24, 497, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
__pyx_t_9 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
#else
__pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 497, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 497, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(24, 497, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(24, 497, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L6_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_L6_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_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_9);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(24, 497, __pyx_L1_error)
__pyx_t_11 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L7_unpacking_done;
__pyx_L6_unpacking_failed:;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(24, 497, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_monitor, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_8);
__pyx_t_8 = 0;
__Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_9);
__pyx_t_9 = 0;
/* "petsc4py/PETSc/petscts.pxi":498
* 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_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 498, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_time); if (unlikely(!__pyx_t_9)) __PYX_ERR(24, 498, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 498, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ts));
PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_9);
__Pyx_INCREF(((PyObject *)__pyx_v_Vu));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Vu));
PyTuple_SET_ITEM(__pyx_t_8, 3, ((PyObject *)__pyx_v_Vu));
__pyx_t_6 = 0;
__pyx_t_9 = 0;
__pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_9)) __PYX_ERR(24, 498, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_6 = PyNumber_Add(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 498, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(24, 498, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_9 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_9)) __PYX_ERR(24, 498, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
} else {
__pyx_t_9 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(24, 498, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
}
__pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_monitor, __pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 498, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "petsc4py/PETSc/petscts.pxi":497
* 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":499
* 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":486
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode TS_Monitor( # <<<<<<<<<<<<<<
* PetscTS ts,
* PetscInt step,
*/
/* 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_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("petsc4py.PETSc.TS_Monitor", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ts);
__Pyx_XDECREF((PyObject *)__pyx_v_Vu);
__Pyx_XDECREF(__pyx_v_monitorlist);
__Pyx_XDECREF(__pyx_v_monitor);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscts.pxi":503
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode TS_EventHandler( # <<<<<<<<<<<<<<
* PetscTS ts,
* PetscReal time,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_EventHandler(TS __pyx_v_ts, PetscReal __pyx_v_time, Vec __pyx_v_u, PetscScalar *__pyx_v_fvalue, CYTHON_UNUSED void *__pyx_v_ctx) {
struct PyPetscTSObject *__pyx_v_Ts = 0;
struct PyPetscVecObject *__pyx_v_Vu = 0;
PyObject *__pyx_v_context = 0;
PyObject *__pyx_v_eventhandler = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscInt __pyx_v_nevents;
npy_intp __pyx_v_s;
PyArrayObject *__pyx_v_fvalue_array = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TS_EventHandler", 0);
/* "petsc4py/PETSc/petscts.pxi":510
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<<
* cdef Vec Vu = ref_Vec(u)
* cdef object context = Ts.get_attr('__eventhandler__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 510, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":511
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts)
* cdef Vec Vu = ref_Vec(u) # <<<<<<<<<<<<<<
* cdef object context = Ts.get_attr('__eventhandler__')
* if context is None: return PETSC_SUCCESS
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_u)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 511, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Vu = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":512
* cdef TS Ts = ref_TS(ts)
* cdef Vec Vu = ref_Vec(u)
* cdef object context = Ts.get_attr('__eventhandler__') # <<<<<<<<<<<<<<
* if context is None: return PETSC_SUCCESS
* (eventhandler, args, kargs) = context
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__eventhandler__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 512, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":513
* cdef Vec Vu = ref_Vec(u)
* cdef object context = Ts.get_attr('__eventhandler__')
* if context is None: return PETSC_SUCCESS # <<<<<<<<<<<<<<
* (eventhandler, args, kargs) = context
* cdef PetscInt nevents = 0
*/
__pyx_t_2 = (__pyx_v_context == Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscts.pxi":514
* cdef object context = Ts.get_attr('__eventhandler__')
* if context is None: return PETSC_SUCCESS
* (eventhandler, args, kargs) = context # <<<<<<<<<<<<<<
* cdef PetscInt nevents = 0
* CHKERR( TSGetNumEvents(ts, &nevents) )
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(24, 514, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_4 = PyList_GET_ITEM(sequence, 1);
__pyx_t_5 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 514, __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, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L4_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_L4_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_L4_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(24, 514, __pyx_L1_error)
__pyx_t_7 = NULL;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
goto __pyx_L5_unpacking_done;
__pyx_L4_unpacking_failed:;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_7 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(24, 514, __pyx_L1_error)
__pyx_L5_unpacking_done:;
}
__pyx_v_eventhandler = __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":515
* if context is None: return PETSC_SUCCESS
* (eventhandler, 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":516
* (eventhandler, 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_SCALAR, fvalue)
*/
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetNumEvents(__pyx_v_ts, (&__pyx_v_nevents))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(24, 516, __pyx_L1_error)
/* "petsc4py/PETSc/petscts.pxi":517
* cdef PetscInt nevents = 0
* CHKERR( TSGetNumEvents(ts, &nevents) )
* cdef npy_intp s = <npy_intp> nevents # <<<<<<<<<<<<<<
* fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_SCALAR, fvalue)
* eventhandler(Ts, toReal(time), Vu, fvalue_array, *args, **kargs)
*/
__pyx_v_s = ((npy_intp)__pyx_v_nevents);
/* "petsc4py/PETSc/petscts.pxi":518
* CHKERR( TSGetNumEvents(ts, &nevents) )
* cdef npy_intp s = <npy_intp> nevents
* fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_SCALAR, fvalue) # <<<<<<<<<<<<<<
* eventhandler(Ts, toReal(time), Vu, fvalue_array, *args, **kargs)
* return PETSC_SUCCESS
*/
__pyx_t_5 = ((PyObject *)PyArray_SimpleNewFromData(1, (&__pyx_v_s), NPY_PETSC_SCALAR, __pyx_v_fvalue)); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 518, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_v_fvalue_array = ((PyArrayObject *)__pyx_t_5);
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscts.pxi":519
* cdef npy_intp s = <npy_intp> nevents
* fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_SCALAR, fvalue)
* eventhandler(Ts, toReal(time), Vu, fvalue_array, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 519, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 519, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ts));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_Vu));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Vu));
PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_Vu));
__Pyx_INCREF(((PyObject *)__pyx_v_fvalue_array));
__Pyx_GIVEREF(((PyObject *)__pyx_v_fvalue_array));
PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_fvalue_array));
__pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 519, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 519, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(24, 519, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 519, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 519, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_eventhandler, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 519, __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":520
* fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_SCALAR, fvalue)
* eventhandler(Ts, toReal(time), Vu, fvalue_array, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode TS_PostEvent(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscts.pxi":503
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode TS_EventHandler( # <<<<<<<<<<<<<<
* PetscTS ts,
* PetscReal time,
*/
/* 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_EventHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ts);
__Pyx_XDECREF((PyObject *)__pyx_v_Vu);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_eventhandler);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_XDECREF((PyObject *)__pyx_v_fvalue_array);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscts.pxi":522
* 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;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *(*__pyx_t_7)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TS_PostEvent", 0);
/* "petsc4py/PETSc/petscts.pxi":531
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<<
* cdef Vec Vu = ref_Vec(u)
* cdef object context = Ts.get_attr('__postevent__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 531, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":532
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts)
* cdef Vec Vu = ref_Vec(u) # <<<<<<<<<<<<<<
* cdef object context = Ts.get_attr('__postevent__')
* if context is None: return PETSC_SUCCESS
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_u)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Vu = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":533
* cdef TS Ts = ref_TS(ts)
* cdef Vec Vu = ref_Vec(u)
* cdef object context = Ts.get_attr('__postevent__') # <<<<<<<<<<<<<<
* if context is None: return PETSC_SUCCESS
* (postevent, args, kargs) = context
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__postevent__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 533, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":534
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscts.pxi":535
* 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(24, 535, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_4 = PyList_GET_ITEM(sequence, 1);
__pyx_t_5 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 535, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 535, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 535, __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, 535, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L4_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_L4_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_L4_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(24, 535, __pyx_L1_error)
__pyx_t_7 = NULL;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
goto __pyx_L5_unpacking_done;
__pyx_L4_unpacking_failed:;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_7 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(24, 535, __pyx_L1_error)
__pyx_L5_unpacking_done:;
}
__pyx_v_postevent = __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":536
* 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":537
* (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_5 = ((PyObject *)PyArray_SimpleNewFromData(1, (&__pyx_v_s), NPY_PETSC_INT, __pyx_v_events_zero)); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 537, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_v_events_zero_array = ((PyArrayObject *)__pyx_t_5);
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscts.pxi":538
* 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_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_forward); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ts));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Ts));
__Pyx_INCREF(((PyObject *)__pyx_v_events_zero_array));
__Pyx_GIVEREF(((PyObject *)__pyx_v_events_zero_array));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_events_zero_array));
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_Vu));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Vu));
PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_Vu));
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_4);
__pyx_t_5 = 0;
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(24, 538, __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, 538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
} else {
__pyx_t_4 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_postevent, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 538, __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":539
* 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":522
* 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_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("petsc4py.PETSc.TS_PostEvent", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ts);
__Pyx_XDECREF((PyObject *)__pyx_v_Vu);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_postevent);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_XDECREF((PyObject *)__pyx_v_events_zero_array);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscts.pxi":541
* return PETSC_SUCCESS
*
* cdef PetscErrorCode TS_PreStep( # <<<<<<<<<<<<<<
* PetscTS ts,
* ) except PETSC_ERR_PYTHON with gil:
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_PreStep(TS __pyx_v_ts) {
struct PyPetscTSObject *__pyx_v_Ts = 0;
PyObject *__pyx_v_prestep = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *(*__pyx_t_6)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TS_PreStep", 0);
/* "petsc4py/PETSc/petscts.pxi":544
* PetscTS ts,
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<<
* (prestep, args, kargs) = Ts.get_attr('__prestep__')
* prestep(Ts, *args, **kargs)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 544, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":545
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts)
* (prestep, args, kargs) = Ts.get_attr('__prestep__') # <<<<<<<<<<<<<<
* prestep(Ts, *args, **kargs)
* return PETSC_SUCCESS
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__prestep__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 545, __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, 545, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
__pyx_t_4 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 545, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 545, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 545, __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, 545, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
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, 545, __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, 545, __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":546
* cdef TS Ts = ref_TS(ts)
* (prestep, args, kargs) = Ts.get_attr('__prestep__')
* prestep(Ts, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 546, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ts));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Ts));
__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_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 546, __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, 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 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 546, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_prestep, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 546, __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":547
* (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":541
* return PETSC_SUCCESS
*
* cdef PetscErrorCode TS_PreStep( # <<<<<<<<<<<<<<
* PetscTS ts,
* ) except PETSC_ERR_PYTHON with gil:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.TS_PreStep", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ts);
__Pyx_XDECREF(__pyx_v_prestep);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscts.pxi":549
* return PETSC_SUCCESS
*
* cdef PetscErrorCode TS_PostStep( # <<<<<<<<<<<<<<
* PetscTS ts,
* ) except PETSC_ERR_PYTHON with gil:
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_PostStep(TS __pyx_v_ts) {
struct PyPetscTSObject *__pyx_v_Ts = 0;
PyObject *__pyx_v_poststep = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *(*__pyx_t_6)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TS_PostStep", 0);
/* "petsc4py/PETSc/petscts.pxi":552
* PetscTS ts,
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<<
* (poststep, args, kargs) = Ts.get_attr('__poststep__')
* poststep(Ts, *args, **kargs)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":553
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts)
* (poststep, args, kargs) = Ts.get_attr('__poststep__') # <<<<<<<<<<<<<<
* poststep(Ts, *args, **kargs)
* return PETSC_SUCCESS
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__poststep__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 553, __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, 553, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
__pyx_t_4 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 553, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 553, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 553, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
__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, 553, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
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, 553, __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, 553, __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":554
* cdef TS Ts = ref_TS(ts)
* (poststep, args, kargs) = Ts.get_attr('__poststep__')
* poststep(Ts, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 554, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ts));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Ts));
__pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 554, __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, 554, __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, 554, __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, 554, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
} else {
__pyx_t_4 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 554, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_poststep, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 554, __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":555
* (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":549
* return PETSC_SUCCESS
*
* cdef PetscErrorCode TS_PostStep( # <<<<<<<<<<<<<<
* PetscTS ts,
* ) except PETSC_ERR_PYTHON with gil:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.TS_PostStep", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ts);
__Pyx_XDECREF(__pyx_v_poststep);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscts.pxi":559
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TS_RHSJacobianP", 0);
/* "petsc4py/PETSc/petscts.pxi":566
* void* ctx,
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<<
* cdef Vec Xvec = ref_Vec(x)
* cdef Mat Jmat = ref_Mat(J)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 566, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":567
* ) except PETSC_ERR_PYTHON with gil:
* cdef TS Ts = ref_TS(ts)
* cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<<
* cdef Mat Jmat = ref_Mat(J)
* cdef object context = Ts.get_attr('__rhsjacobianp__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 567, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":568
* 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(24, 568, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":569
* 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(24, 569, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscts.pxi":570
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":571
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(24, 571, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscts.pxi":572
* 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(24, 572, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 572, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 572, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 572, __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(24, 572, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(24, 572, __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(24, 572, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_jacobianp = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscts.pxi":573
* 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_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Ts));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Ts));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Xvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec));
PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Xvec));
__Pyx_INCREF(((PyObject *)__pyx_v_Jmat));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Jmat));
PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_Jmat));
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 573, __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;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(24, 573, __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, 573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_jacobianp, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscts.pxi":574
* (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":559
* # -----------------------------------------------------------------------------
*
* cdef PetscErrorCode TS_RHSJacobianP( # <<<<<<<<<<<<<<
* PetscTS ts,
* PetscReal t,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TS_RHSJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Ts);
__Pyx_XDECREF((PyObject *)__pyx_v_Xvec);
__Pyx_XDECREF((PyObject *)__pyx_v_Jmat);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_jacobianp);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":187
* # --------------------------------------------------------------------
*
* 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ref_TAO", 0);
/* "petsc4py/PETSc/petsctao.pxi":188
*
* cdef inline TAO ref_TAO(PetscTAO tao):
* cdef TAO ob = <TAO> TAO() # <<<<<<<<<<<<<<
* ob.tao = tao
* PetscINCREF(ob.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ob = ((struct PyPetscTAOObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petsctao.pxi":189
* cdef inline TAO ref_TAO(PetscTAO tao):
* cdef TAO ob = <TAO> TAO()
* ob.tao = tao # <<<<<<<<<<<<<<
* PetscINCREF(ob.obj)
* return ob
*/
__pyx_v_ob->tao = __pyx_v_tao;
/* "petsc4py/PETSc/petsctao.pxi":190
* cdef TAO ob = <TAO> TAO()
* ob.tao = tao
* PetscINCREF(ob.obj) # <<<<<<<<<<<<<<
* return ob
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj));
/* "petsc4py/PETSc/petsctao.pxi":191
* ob.tao = tao
* 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":187
* # --------------------------------------------------------------------
*
* 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":195
* # --------------------------------------------------------------------
*
* 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;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
PetscReal __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_Objective", 0);
/* "petsc4py/PETSc/petsctao.pxi":199
* void *ctx) except PETSC_ERR_PYTHON with gil:
*
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef Vec x = ref_Vec(_x)
* context = tao.get_attr("__objective__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":200
*
* 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(25, 200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":201
* 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(25, 201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":202
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":203
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 203, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":204
* 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(25, 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_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 204, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 204, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 204, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 204, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(25, 204, __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(25, 204, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_objective = __pyx_t_1;
__pyx_t_1 = 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":205
* 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_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__Pyx_INCREF(((PyObject *)__pyx_v_x));
__Pyx_GIVEREF(((PyObject *)__pyx_v_x));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(25, 205, __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(25, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_objective, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_retv = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":206
* (objective, args, kargs) = context
* retv = objective(tao, x, *args, **kargs)
* _f[0] = asReal(retv) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_retv); if (unlikely(__pyx_t_9 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(25, 206, __pyx_L1_error)
(__pyx_v__f[0]) = __pyx_t_9;
/* "petsc4py/PETSc/petsctao.pxi":207
* 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":195
* # --------------------------------------------------------------------
*
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_Objective", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF((PyObject *)__pyx_v_x);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_objective);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_XDECREF(__pyx_v_retv);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":209
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_Residual", 0);
/* "petsc4py/PETSc/petsctao.pxi":213
* void *ctx) except PETSC_ERR_PYTHON with gil:
*
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef Vec x = ref_Vec(_x)
* cdef Vec r = ref_Vec(_r)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":214
*
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<<
* cdef Vec r = ref_Vec(_r)
* context = tao.get_attr("__residual__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 214, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":215
* 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(25, 215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_r = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":216
* 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(25, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":217
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":218
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 218, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":219
* 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(25, 219, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 219, __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(25, 219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(25, 219, __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(25, 219, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_residual = __pyx_t_1;
__pyx_t_1 = 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":220
* 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_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 220, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__Pyx_INCREF(((PyObject *)__pyx_v_x));
__Pyx_GIVEREF(((PyObject *)__pyx_v_x));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x));
__Pyx_INCREF(((PyObject *)__pyx_v_r));
__Pyx_GIVEREF(((PyObject *)__pyx_v_r));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_r));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 220, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 220, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(25, 220, __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(25, 220, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 220, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_residual, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 220, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":221
* (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":209
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_Residual", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF((PyObject *)__pyx_v_x);
__Pyx_XDECREF((PyObject *)__pyx_v_r);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_residual);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":223
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_Gradient", 0);
/* "petsc4py/PETSc/petsctao.pxi":227
* void *ctx) except PETSC_ERR_PYTHON with gil:
*
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef Vec x = ref_Vec(_x)
* cdef Vec g = ref_Vec(_g)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 227, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":228
*
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<<
* cdef Vec g = ref_Vec(_g)
* context = tao.get_attr("__gradient__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 228, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":229
* 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(25, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":230
* 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(25, 230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":231
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":232
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 232, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":233
* 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(25, 233, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 233, __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(25, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(25, 233, __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(25, 233, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_gradient = __pyx_t_1;
__pyx_t_1 = 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":234
* 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_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 234, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__Pyx_INCREF(((PyObject *)__pyx_v_x));
__Pyx_GIVEREF(((PyObject *)__pyx_v_x));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x));
__Pyx_INCREF(((PyObject *)__pyx_v_g));
__Pyx_GIVEREF(((PyObject *)__pyx_v_g));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_g));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 234, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 234, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(25, 234, __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(25, 234, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 234, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_gradient, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 234, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":235
* (gradient, args, kargs) = context
* gradient(tao, x, g, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petsctao.pxi":223
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_Gradient", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF((PyObject *)__pyx_v_x);
__Pyx_XDECREF((PyObject *)__pyx_v_g);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_gradient);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":238
*
*
* 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;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
PetscReal __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_ObjGrad", 0);
/* "petsc4py/PETSc/petsctao.pxi":242
* void *ctx) except PETSC_ERR_PYTHON with gil:
*
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef Vec x = ref_Vec(_x)
* cdef Vec g = ref_Vec(_g)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":243
*
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<<
* cdef Vec g = ref_Vec(_g)
* context = tao.get_attr("__objgrad__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":244
* 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(25, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":245
* 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(25, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":246
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":247
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 247, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":248
* 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(25, 248, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 248, __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(25, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(25, 248, __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(25, 248, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_objgrad = __pyx_t_1;
__pyx_t_1 = 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":249
* 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_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__Pyx_INCREF(((PyObject *)__pyx_v_x));
__Pyx_GIVEREF(((PyObject *)__pyx_v_x));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x));
__Pyx_INCREF(((PyObject *)__pyx_v_g));
__Pyx_GIVEREF(((PyObject *)__pyx_v_g));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_g));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(25, 249, __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(25, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_objgrad, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_retv = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":250
* (objgrad, args, kargs) = context
* retv = objgrad(tao, x, g, *args, **kargs)
* _f[0] = asReal(retv) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_retv); if (unlikely(__pyx_t_9 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(25, 250, __pyx_L1_error)
(__pyx_v__f[0]) = __pyx_t_9;
/* "petsc4py/PETSc/petsctao.pxi":251
* 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":238
*
*
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_ObjGrad", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF((PyObject *)__pyx_v_x);
__Pyx_XDECREF((PyObject *)__pyx_v_g);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_objgrad);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_XDECREF(__pyx_v_retv);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":253
* 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;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
PetscReal __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_BRGNRegObjGrad", 0);
/* "petsc4py/PETSc/petsctao.pxi":257
* void *ctx) except PETSC_ERR_PYTHON with gil:
*
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef Vec x = ref_Vec(_x)
* cdef Vec g = ref_Vec(_g)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":258
*
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<<
* cdef Vec g = ref_Vec(_g)
* context = tao.get_attr("__brgnregobjgrad__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":259
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x)
* 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(25, 259, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":260
* 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(25, 260, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":261
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":262
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 262, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":263
* 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(25, 263, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 263, __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(25, 263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(25, 263, __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(25, 263, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_objgrad = __pyx_t_1;
__pyx_t_1 = 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":264
* 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_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__Pyx_INCREF(((PyObject *)__pyx_v_x));
__Pyx_GIVEREF(((PyObject *)__pyx_v_x));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x));
__Pyx_INCREF(((PyObject *)__pyx_v_g));
__Pyx_GIVEREF(((PyObject *)__pyx_v_g));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_g));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(25, 264, __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(25, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_objgrad, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_retv = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":265
* (objgrad, args, kargs) = context
* retv = objgrad(tao, x, g, *args, **kargs)
* _f[0] = asReal(retv) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_retv); if (unlikely(__pyx_t_9 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(25, 265, __pyx_L1_error)
(__pyx_v__f[0]) = __pyx_t_9;
/* "petsc4py/PETSc/petsctao.pxi":266
* retv = objgrad(tao, x, g, *args, **kargs)
* _f[0] = asReal(retv)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode TAO_Constraints(PetscTAO _tao,
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petsctao.pxi":253
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_BRGNRegObjGrad", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF((PyObject *)__pyx_v_x);
__Pyx_XDECREF((PyObject *)__pyx_v_g);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_objgrad);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_XDECREF(__pyx_v_retv);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":268
* return PETSC_SUCCESS
*
* cdef PetscErrorCode TAO_Constraints(PetscTAO _tao, # <<<<<<<<<<<<<<
* PetscVec _x, PetscVec _r,
* void *ctx) except PETSC_ERR_PYTHON with gil:
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_Constraints(Tao __pyx_v__tao, Vec __pyx_v__x, Vec __pyx_v__r, void *__pyx_v_ctx) {
struct PyPetscTAOObject *__pyx_v_tao = 0;
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_r = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_constraints = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_Constraints", 0);
/* "petsc4py/PETSc/petsctao.pxi":272
* void *ctx) except PETSC_ERR_PYTHON with gil:
*
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef Vec x = ref_Vec(_x)
* cdef Vec r = ref_Vec(_r)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":273
*
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<<
* cdef Vec r = ref_Vec(_r)
* context = tao.get_attr("__constraints__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 273, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":274
* 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(25, 274, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_r = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":275
* 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(25, 275, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":276
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":277
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 277, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":278
* 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(25, 278, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 278, __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(25, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(25, 278, __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(25, 278, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_constraints = __pyx_t_1;
__pyx_t_1 = 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":279
* 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_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__Pyx_INCREF(((PyObject *)__pyx_v_x));
__Pyx_GIVEREF(((PyObject *)__pyx_v_x));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x));
__Pyx_INCREF(((PyObject *)__pyx_v_r));
__Pyx_GIVEREF(((PyObject *)__pyx_v_r));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_r));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(25, 279, __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(25, 279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_constraints, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":280
* (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":268
* return PETSC_SUCCESS
*
* cdef PetscErrorCode TAO_Constraints(PetscTAO _tao, # <<<<<<<<<<<<<<
* PetscVec _x, PetscVec _r,
* void *ctx) except PETSC_ERR_PYTHON with gil:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_Constraints", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF((PyObject *)__pyx_v_x);
__Pyx_XDECREF((PyObject *)__pyx_v_r);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_constraints);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":282
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_VarBounds", 0);
/* "petsc4py/PETSc/petsctao.pxi":286
* void *ctx) except PETSC_ERR_PYTHON with gil:
*
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef Vec xl = ref_Vec(_xl)
* cdef Vec xu = ref_Vec(_xu)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 286, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":287
*
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec xl = ref_Vec(_xl) # <<<<<<<<<<<<<<
* cdef Vec xu = ref_Vec(_xu)
* context = tao.get_attr("__varbounds__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__xl)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 287, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_xl = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":288
* 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(25, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_xu = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":289
* 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(25, 289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":290
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":291
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 291, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":292
* 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(25, 292, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 292, __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(25, 292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(25, 292, __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(25, 292, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_varbounds = __pyx_t_1;
__pyx_t_1 = 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":293
* 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_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__Pyx_INCREF(((PyObject *)__pyx_v_xl));
__Pyx_GIVEREF(((PyObject *)__pyx_v_xl));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_xl));
__Pyx_INCREF(((PyObject *)__pyx_v_xu));
__Pyx_GIVEREF(((PyObject *)__pyx_v_xu));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_xu));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(25, 293, __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(25, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_varbounds, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":294
* (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":282
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_VarBounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF((PyObject *)__pyx_v_xl);
__Pyx_XDECREF((PyObject *)__pyx_v_xu);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_varbounds);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":296
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_Hessian", 0);
/* "petsc4py/PETSc/petsctao.pxi":301
* PetscMat _P,
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef Vec x = ref_Vec(_x)
* cdef Mat H = ref_Mat(_H)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 301, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":302
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<<
* cdef Mat H = ref_Mat(_H)
* cdef Mat P = ref_Mat(_P)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":303
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x)
* cdef Mat H = ref_Mat(_H) # <<<<<<<<<<<<<<
* cdef Mat P = ref_Mat(_P)
* context = tao.get_attr("__hessian__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__H)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_H = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":304
* 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(25, 304, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":305
* 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(25, 305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":306
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":307
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 307, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":308
* 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(25, 308, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 308, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 308, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 308, __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(25, 308, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(25, 308, __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(25, 308, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_hessian = __pyx_t_1;
__pyx_t_1 = 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":309
* 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_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__Pyx_INCREF(((PyObject *)__pyx_v_x));
__Pyx_GIVEREF(((PyObject *)__pyx_v_x));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x));
__Pyx_INCREF(((PyObject *)__pyx_v_H));
__Pyx_GIVEREF(((PyObject *)__pyx_v_H));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_H));
__Pyx_INCREF(((PyObject *)__pyx_v_P));
__Pyx_GIVEREF(((PyObject *)__pyx_v_P));
PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_P));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(25, 309, __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(25, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_hessian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":310
* (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":296
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_Hessian", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF((PyObject *)__pyx_v_x);
__Pyx_XDECREF((PyObject *)__pyx_v_H);
__Pyx_XDECREF((PyObject *)__pyx_v_P);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_hessian);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":312
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_BRGNRegHessian", 0);
/* "petsc4py/PETSc/petsctao.pxi":316
* PetscMat _H,
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef Vec x = ref_Vec(_x)
* cdef Mat H = ref_Mat(_H)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 316, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":317
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<<
* cdef Mat H = ref_Mat(_H)
* context = tao.get_attr("__brgnreghessian__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":318
* 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(25, 318, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_H = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":319
* 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(25, 319, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":320
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":321
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 321, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":322
* 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(25, 322, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 322, __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(25, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(25, 322, __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(25, 322, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_hessian = __pyx_t_1;
__pyx_t_1 = 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":323
* 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_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__Pyx_INCREF(((PyObject *)__pyx_v_x));
__Pyx_GIVEREF(((PyObject *)__pyx_v_x));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x));
__Pyx_INCREF(((PyObject *)__pyx_v_H));
__Pyx_GIVEREF(((PyObject *)__pyx_v_H));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_H));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(25, 323, __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(25, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_hessian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":324
* (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":312
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_BRGNRegHessian", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF((PyObject *)__pyx_v_x);
__Pyx_XDECREF((PyObject *)__pyx_v_H);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_hessian);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":326
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_Jacobian", 0);
/* "petsc4py/PETSc/petsctao.pxi":331
* PetscMat _P,
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef Vec x = ref_Vec(_x)
* cdef Mat J = ref_Mat(_J)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 331, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":332
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<<
* cdef Mat J = ref_Mat(_J)
* cdef Mat P = ref_Mat(_P)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":333
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x)
* cdef Mat J = ref_Mat(_J) # <<<<<<<<<<<<<<
* cdef Mat P = ref_Mat(_P)
* context = tao.get_attr("__jacobian__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 333, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":334
* 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(25, 334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":335
* 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(25, 335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":336
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":337
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 337, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":338
* 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(25, 338, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 338, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 338, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 338, __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(25, 338, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(25, 338, __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(25, 338, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_jacobian = __pyx_t_1;
__pyx_t_1 = 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":339
* 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_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 339, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__Pyx_INCREF(((PyObject *)__pyx_v_x));
__Pyx_GIVEREF(((PyObject *)__pyx_v_x));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x));
__Pyx_INCREF(((PyObject *)__pyx_v_J));
__Pyx_GIVEREF(((PyObject *)__pyx_v_J));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_J));
__Pyx_INCREF(((PyObject *)__pyx_v_P));
__Pyx_GIVEREF(((PyObject *)__pyx_v_P));
PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_P));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 339, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 339, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(25, 339, __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(25, 339, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 339, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 339, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":340
* (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":326
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF((PyObject *)__pyx_v_x);
__Pyx_XDECREF((PyObject *)__pyx_v_J);
__Pyx_XDECREF((PyObject *)__pyx_v_P);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_jacobian);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":342
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_JacobianResidual", 0);
/* "petsc4py/PETSc/petsctao.pxi":347
* PetscMat _P,
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef Vec x = ref_Vec(_x)
* cdef Mat J = ref_Mat(_J)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 347, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":348
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<<
* cdef Mat J = ref_Mat(_J)
* cdef Mat P = ref_Mat(_P)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":349
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x)
* cdef Mat J = ref_Mat(_J) # <<<<<<<<<<<<<<
* cdef Mat P = ref_Mat(_P)
* context = tao.get_attr("__jacobian_residual__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 349, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":350
* 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(25, 350, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":351
* 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(25, 351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":352
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":353
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 353, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":354
* 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(25, 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_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 354, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 354, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 354, __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(25, 354, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(25, 354, __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(25, 354, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_jacobian = __pyx_t_1;
__pyx_t_1 = 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":355
* 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_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__Pyx_INCREF(((PyObject *)__pyx_v_x));
__Pyx_GIVEREF(((PyObject *)__pyx_v_x));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x));
__Pyx_INCREF(((PyObject *)__pyx_v_J));
__Pyx_GIVEREF(((PyObject *)__pyx_v_J));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_J));
__Pyx_INCREF(((PyObject *)__pyx_v_P));
__Pyx_GIVEREF(((PyObject *)__pyx_v_P));
PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_P));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(25, 355, __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(25, 355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":356
* (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":342
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_JacobianResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF((PyObject *)__pyx_v_x);
__Pyx_XDECREF((PyObject *)__pyx_v_J);
__Pyx_XDECREF((PyObject *)__pyx_v_P);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_jacobian);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":358
* return PETSC_SUCCESS
*
* cdef PetscErrorCode TAO_JacobianState(PetscTAO _tao, # <<<<<<<<<<<<<<
* PetscVec _x,
* PetscMat _J,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_JacobianState(Tao __pyx_v__tao, Vec __pyx_v__x, Mat __pyx_v__J, Mat __pyx_v__P, Mat __pyx_v__I, void *__pyx_v_ctx) {
struct PyPetscTAOObject *__pyx_v_tao = 0;
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscMatObject *__pyx_v_J = 0;
struct PyPetscMatObject *__pyx_v_P = 0;
struct PyPetscMatObject *__pyx_v_I = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_jacobian = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_JacobianState", 0);
/* "petsc4py/PETSc/petsctao.pxi":364
* PetscMat _I,
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef Vec x = ref_Vec(_x)
* cdef Mat J = ref_Mat(_J)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 364, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":365
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<<
* cdef Mat J = ref_Mat(_J)
* cdef Mat P = ref_Mat(_P)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":366
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x)
* cdef Mat J = ref_Mat(_J) # <<<<<<<<<<<<<<
* cdef Mat P = ref_Mat(_P)
* cdef Mat I = ref_Mat(_I)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 366, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":367
* cdef Vec x = ref_Vec(_x)
* cdef Mat J = ref_Mat(_J)
* cdef Mat P = ref_Mat(_P) # <<<<<<<<<<<<<<
* cdef Mat I = ref_Mat(_I)
* context = tao.get_attr("__jacobian_state__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":368
* cdef Mat J = ref_Mat(_J)
* cdef Mat P = ref_Mat(_P)
* cdef Mat I = ref_Mat(_I) # <<<<<<<<<<<<<<
* context = tao.get_attr("__jacobian_state__")
* if context is None and ctx != NULL: context = <object>ctx
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__I)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 368, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_I = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":369
* cdef Mat P = ref_Mat(_P)
* cdef Mat I = ref_Mat(_I)
* context = tao.get_attr("__jacobian_state__") # <<<<<<<<<<<<<<
* if context is None and ctx != NULL: context = <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(25, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":370
* cdef Mat I = ref_Mat(_I)
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":371
* 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, P, I, *args, **kargs)
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(__pyx_assertions_enabled())) {
__pyx_t_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 371, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":372
* 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, I, *args, **kargs)
* return PETSC_SUCCESS
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(25, 372, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 372, __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(25, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(25, 372, __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(25, 372, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_jacobian = __pyx_t_1;
__pyx_t_1 = 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":373
* assert context is not None and type(context) is tuple # sanity check
* (jacobian, args, kargs) = context
* jacobian(tao, x, J, P, I, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__Pyx_INCREF(((PyObject *)__pyx_v_x));
__Pyx_GIVEREF(((PyObject *)__pyx_v_x));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x));
__Pyx_INCREF(((PyObject *)__pyx_v_J));
__Pyx_GIVEREF(((PyObject *)__pyx_v_J));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_J));
__Pyx_INCREF(((PyObject *)__pyx_v_P));
__Pyx_GIVEREF(((PyObject *)__pyx_v_P));
PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_P));
__Pyx_INCREF(((PyObject *)__pyx_v_I));
__Pyx_GIVEREF(((PyObject *)__pyx_v_I));
PyTuple_SET_ITEM(__pyx_t_6, 4, ((PyObject *)__pyx_v_I));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(25, 373, __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(25, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":374
* (jacobian, args, kargs) = context
* jacobian(tao, x, J, P, I, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode TAO_JacobianDesign(PetscTAO _tao,
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petsctao.pxi":358
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_JacobianState", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF((PyObject *)__pyx_v_x);
__Pyx_XDECREF((PyObject *)__pyx_v_J);
__Pyx_XDECREF((PyObject *)__pyx_v_P);
__Pyx_XDECREF((PyObject *)__pyx_v_I);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_jacobian);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":376
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_JacobianDesign", 0);
/* "petsc4py/PETSc/petsctao.pxi":380
* PetscMat _J,
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef Vec x = ref_Vec(_x)
* cdef Mat J = ref_Mat(_J)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":381
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<<
* cdef Mat J = ref_Mat(_J)
* context = tao.get_attr("__jacobian_design__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 381, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":382
* 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(25, 382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":383
* 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(25, 383, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":384
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":385
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 385, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":386
* 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(25, 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_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(25, 386, __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(25, 386, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_jacobian = __pyx_t_1;
__pyx_t_1 = 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":387
* 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_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__Pyx_INCREF(((PyObject *)__pyx_v_x));
__Pyx_GIVEREF(((PyObject *)__pyx_v_x));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x));
__Pyx_INCREF(((PyObject *)__pyx_v_J));
__Pyx_GIVEREF(((PyObject *)__pyx_v_J));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_J));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(25, 387, __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(25, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":388
* (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":376
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_JacobianDesign", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF((PyObject *)__pyx_v_x);
__Pyx_XDECREF((PyObject *)__pyx_v_J);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_jacobian);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":390
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_EqualityConstraints", 0);
/* "petsc4py/PETSc/petsctao.pxi":394
* PetscVec _c,
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef Vec x = ref_Vec(_x)
* cdef Vec c = ref_Vec(_c)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 394, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":395
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<<
* cdef Vec c = ref_Vec(_c)
* context = tao.get_attr("__equality_constraints__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 395, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":396
* 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(25, 396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":397
* 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(25, 397, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":398
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":399
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 399, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":400
* 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(25, 400, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 400, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 400, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 400, __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(25, 400, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(25, 400, __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(25, 400, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_f = __pyx_t_1;
__pyx_t_1 = 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":401
* 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_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 401, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__Pyx_INCREF(((PyObject *)__pyx_v_x));
__Pyx_GIVEREF(((PyObject *)__pyx_v_x));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x));
__Pyx_INCREF(((PyObject *)__pyx_v_c));
__Pyx_GIVEREF(((PyObject *)__pyx_v_c));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_c));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 401, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 401, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(25, 401, __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(25, 401, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 401, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 401, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":402
* (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":390
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_EqualityConstraints", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF((PyObject *)__pyx_v_x);
__Pyx_XDECREF((PyObject *)__pyx_v_c);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_f);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":404
* 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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_JacobianEquality", 0);
/* "petsc4py/PETSc/petsctao.pxi":409
* PetscMat _P,
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef Vec x = ref_Vec(_x)
* cdef Mat J = ref_Mat(_J)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":410
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<<
* cdef Mat J = ref_Mat(_J)
* cdef Mat P = ref_Mat(_P)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":411
* cdef TAO tao = ref_TAO(_tao)
* cdef Vec x = ref_Vec(_x)
* cdef Mat J = ref_Mat(_J) # <<<<<<<<<<<<<<
* cdef Mat P = ref_Mat(_P)
* context = tao.get_attr("__jacobian_equality__")
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":412
* 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(25, 412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":413
* 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(25, 413, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":414
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_ctx != NULL) != 0);
__pyx_t_2 = __pyx_t_4;
__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":415
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
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_4 = (__pyx_t_3 != 0);
__pyx_t_2 = __pyx_t_4;
__pyx_L6_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 415, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":416
* 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(25, 416, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 416, __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(25, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
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(25, 416, __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(25, 416, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_v_jacobian = __pyx_t_1;
__pyx_t_1 = 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":417
* 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_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 417, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__Pyx_INCREF(((PyObject *)__pyx_v_x));
__Pyx_GIVEREF(((PyObject *)__pyx_v_x));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x));
__Pyx_INCREF(((PyObject *)__pyx_v_J));
__Pyx_GIVEREF(((PyObject *)__pyx_v_J));
PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_J));
__Pyx_INCREF(((PyObject *)__pyx_v_P));
__Pyx_GIVEREF(((PyObject *)__pyx_v_P));
PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_P));
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 417, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 417, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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(25, 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(25, 417, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
__pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 417, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 417, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":418
* (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":404
* 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_JacobianEquality", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF((PyObject *)__pyx_v_x);
__Pyx_XDECREF((PyObject *)__pyx_v_J);
__Pyx_XDECREF((PyObject *)__pyx_v_P);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_jacobian);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":421
*
* # 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_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;
int __pyx_t_4;
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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_Update", 0);
/* "petsc4py/PETSc/petsctao.pxi":425
* PetscInt its,
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef object context = tao.get_attr('__update__')
* assert context is not None and type(context) is tuple # sanity check
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 425, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":426
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao)
* cdef object context = tao.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_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__update__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 426, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":427
* cdef TAO tao = ref_TAO(_tao)
* cdef object context = tao.get_attr('__update__')
* assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<<
* (update, args, kargs) = context
* update(tao, toInt(its), *args, **kargs)
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(__pyx_assertions_enabled())) {
__pyx_t_3 = (__pyx_v_context != Py_None);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_4 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_3 = (__pyx_t_4 != 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 427, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":428
* cdef object context = tao.get_attr('__update__')
* assert context is not None and type(context) is tuple # sanity check
* (update, args, kargs) = context # <<<<<<<<<<<<<<
* update(tao, 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(25, 428, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 428, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 428, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 428, __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(25, 428, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_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_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 428, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(25, 428, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_update = __pyx_t_1;
__pyx_t_1 = 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":429
* assert context is not None and type(context) is tuple # sanity check
* (update, args, kargs) = context
* update(tao, toInt(its), *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_its); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 429, __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;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(25, 429, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_update, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petsctao.pxi":430
* (update, args, kargs) = context
* update(tao, toInt(its), *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petsctao.pxi":421
*
* # 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_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__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_context);
__Pyx_XDECREF(__pyx_v_update);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":433
*
*
* 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;
int __pyx_t_11;
TaoConvergedReason __pyx_t_12;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_Converged", 0);
/* "petsc4py/PETSc/petsctao.pxi":436
* void* ctx) except PETSC_ERR_PYTHON with gil:
* # call first the default convergence test
* CHKERR( TaoDefaultConvergenceTest(_tao, NULL) ) # <<<<<<<<<<<<<<
* # call next the user-provided convergence test
* cdef TAO tao = ref_TAO(_tao)
*/
__pyx_t_1 = TaoDefaultConvergenceTest(__pyx_v__tao, NULL); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(25, 436, __pyx_L1_error)
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(25, 436, __pyx_L1_error)
/* "petsc4py/PETSc/petsctao.pxi":438
* CHKERR( TaoDefaultConvergenceTest(_tao, NULL) )
* # call next the user-provided convergence test
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* (converged, args, kargs) = tao.get_attr('__converged__')
* reason = converged(tao, *args, **kargs)
*/
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 438, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petsctao.pxi":439
* # call next the user-provided convergence test
* cdef TAO tao = ref_TAO(_tao)
* (converged, args, kargs) = tao.get_attr('__converged__') # <<<<<<<<<<<<<<
* reason = converged(tao, *args, **kargs)
* if reason is None: return PETSC_SUCCESS
*/
__pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__converged__")); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 439, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
PyObject* sequence = __pyx_t_3;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(25, 439, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 439, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 439, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 439, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 439, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 439, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L4_unpacking_done;
__pyx_L3_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(25, 439, __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":440
* cdef TAO tao = ref_TAO(_tao)
* (converged, args, kargs) = tao.get_attr('__converged__')
* reason = converged(tao, *args, **kargs) # <<<<<<<<<<<<<<
* if reason is None: return PETSC_SUCCESS
* # handle value of convergence reason
*/
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 440, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_tao));
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 440, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 440, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(25, 440, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 440, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 440, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_converged, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 440, __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":441
* (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);
__pyx_t_10 = (__pyx_t_9 != 0);
if (__pyx_t_10) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petsctao.pxi":443
* 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":444
* # 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_9 = (__pyx_v_reason == Py_False);
__pyx_t_11 = (__pyx_t_9 != 0);
if (!__pyx_t_11) {
} else {
__pyx_t_10 = __pyx_t_11;
goto __pyx_L7_bool_binop_done;
}
__pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_reason, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(25, 444, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_10 = __pyx_t_11;
__pyx_L7_bool_binop_done:;
if (__pyx_t_10) {
/* "petsc4py/PETSc/petsctao.pxi":445
* 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":444
* # 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":446
* 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_11 = (__pyx_v_reason == Py_True);
__pyx_t_9 = (__pyx_t_11 != 0);
if (!__pyx_t_9) {
} else {
__pyx_t_10 = __pyx_t_9;
goto __pyx_L9_bool_binop_done;
}
__pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_reason, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 446, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(25, 446, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_10 = __pyx_t_9;
__pyx_L9_bool_binop_done:;
if (__pyx_t_10) {
/* "petsc4py/PETSc/petsctao.pxi":447
* 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":446
* 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":449
* creason = TAO_CONVERGED_USER
* else:
* creason = reason # <<<<<<<<<<<<<<
* assert creason >= TAO_DIVERGED_USER
* assert creason <= TAO_CONVERGED_USER
*/
/*else*/ {
__pyx_t_12 = ((TaoConvergedReason)__Pyx_PyInt_As_TaoConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(25, 449, __pyx_L1_error)
__pyx_v_creason = __pyx_t_12;
/* "petsc4py/PETSc/petsctao.pxi":450
* 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())) {
if (unlikely(!((__pyx_v_creason >= TAO_DIVERGED_USER) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 450, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petsctao.pxi":451
* 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())) {
if (unlikely(!((__pyx_v_creason <= TAO_CONVERGED_USER) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(25, 451, __pyx_L1_error)
}
}
#endif
}
__pyx_L6:;
/* "petsc4py/PETSc/petsctao.pxi":452
* assert creason >= TAO_DIVERGED_USER
* assert creason <= TAO_CONVERGED_USER
* CHKERR( TaoSetConvergedReason(_tao, creason) ) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetConvergedReason(__pyx_v__tao, __pyx_v_creason)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(25, 452, __pyx_L1_error)
/* "petsc4py/PETSc/petsctao.pxi":453
* 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":433
*
*
* cdef PetscErrorCode TAO_Converged(PetscTAO _tao, # <<<<<<<<<<<<<<
* void* ctx) except PETSC_ERR_PYTHON with gil:
* # call first the default convergence test
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.TAO_Converged", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF(__pyx_v_converged);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_XDECREF(__pyx_v_reason);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petsctao.pxi":455
* 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;
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 = NULL;
PyObject *(*__pyx_t_11)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("TAO_Monitor", 0);
/* "petsc4py/PETSc/petsctao.pxi":457
* cdef PetscErrorCode TAO_Monitor(PetscTAO _tao,
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<<
* cdef object monitorlist = tao.get_attr('__monitor__')
* if monitorlist is None: return PETSC_SUCCESS
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 457, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":458
* void* ctx) except PETSC_ERR_PYTHON with gil:
* cdef TAO tao = ref_TAO(_tao)
* cdef object monitorlist = tao.get_attr('__monitor__') # <<<<<<<<<<<<<<
* if monitorlist is None: return PETSC_SUCCESS
* for (monitor, args, kargs) in monitorlist:
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_monitorlist = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petsctao.pxi":459
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petsctao.pxi":460
* 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_4 = 0;
__pyx_t_5 = NULL;
} else {
__pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_monitorlist); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 460, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_5)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(25, 460, __pyx_L1_error)
#else
__pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(25, 460, __pyx_L1_error)
#else
__pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
}
} else {
__pyx_t_6 = __pyx_t_5(__pyx_t_1);
if (unlikely(!__pyx_t_6)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(25, 460, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_6);
}
if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
PyObject* sequence = __pyx_t_6;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(25, 460, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
__pyx_t_9 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
#else
__pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(25, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L6_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_L6_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_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_9);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(25, 460, __pyx_L1_error)
__pyx_t_11 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L7_unpacking_done;
__pyx_L6_unpacking_failed:;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(25, 460, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_monitor, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_8);
__pyx_t_8 = 0;
__Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_9);
__pyx_t_9 = 0;
/* "petsc4py/PETSc/petsctao.pxi":461
* if monitorlist is None: return PETSC_SUCCESS
* for (monitor, args, kargs) in monitorlist:
* monitor(tao, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_tao));
__Pyx_GIVEREF(((PyObject *)__pyx_v_tao));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao));
__pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(25, 461, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_9 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
} else {
__pyx_t_9 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_monitor, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/petsctao.pxi":460
* 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":462
* for (monitor, args, kargs) in monitorlist:
* monitor(tao, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petsctao.pxi":455
* 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_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.TAO_Monitor", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tao);
__Pyx_XDECREF(__pyx_v_monitorlist);
__Pyx_XDECREF(__pyx_v_monitor);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdm.pxi":190
* # --------------------------------------------------------------------
*
* 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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
DMBoundaryType __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("asBoundaryType", 0);
/* "petsc4py/PETSc/petscdm.pxi":192
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscdm.pxi":193
* 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":192
* 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":194
* if boundary is None:
* return DM_BOUNDARY_NONE
* if boundary is False: # <<<<<<<<<<<<<<
* return DM_BOUNDARY_NONE
* if boundary is True:
*/
__pyx_t_2 = (__pyx_v_boundary == Py_False);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscdm.pxi":195
* 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":194
* if boundary is None:
* return DM_BOUNDARY_NONE
* if boundary is False: # <<<<<<<<<<<<<<
* return DM_BOUNDARY_NONE
* if boundary is True:
*/
}
/* "petsc4py/PETSc/petscdm.pxi":196
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscdm.pxi":197
* 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":196
* if boundary is False:
* return DM_BOUNDARY_NONE
* if boundary is True: # <<<<<<<<<<<<<<
* return DM_BOUNDARY_PERIODIC
* if isinstance(boundary, str):
*/
}
/* "petsc4py/PETSc/petscdm.pxi":198
* if boundary is True:
* return DM_BOUNDARY_PERIODIC
* if isinstance(boundary, str): # <<<<<<<<<<<<<<
* if boundary == 'none':
* return DM_BOUNDARY_NONE
*/
__pyx_t_2 = PyString_Check(__pyx_v_boundary);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscdm.pxi":199
* return DM_BOUNDARY_PERIODIC
* if isinstance(boundary, str):
* if boundary == 'none': # <<<<<<<<<<<<<<
* return DM_BOUNDARY_NONE
* elif boundary == 'ghosted':
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_boundary, __pyx_n_s_none, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(26, 199, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscdm.pxi":200
* 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":199
* return DM_BOUNDARY_PERIODIC
* if isinstance(boundary, str):
* if boundary == 'none': # <<<<<<<<<<<<<<
* return DM_BOUNDARY_NONE
* elif boundary == 'ghosted':
*/
}
/* "petsc4py/PETSc/petscdm.pxi":201
* if boundary == 'none':
* return DM_BOUNDARY_NONE
* elif boundary == 'ghosted': # <<<<<<<<<<<<<<
* return DM_BOUNDARY_GHOSTED
* elif boundary == 'mirror':
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_boundary, __pyx_n_s_ghosted, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(26, 201, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscdm.pxi":202
* 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":201
* if boundary == 'none':
* return DM_BOUNDARY_NONE
* elif boundary == 'ghosted': # <<<<<<<<<<<<<<
* return DM_BOUNDARY_GHOSTED
* elif boundary == 'mirror':
*/
}
/* "petsc4py/PETSc/petscdm.pxi":203
* elif boundary == 'ghosted':
* return DM_BOUNDARY_GHOSTED
* elif boundary == 'mirror': # <<<<<<<<<<<<<<
* return DM_BOUNDARY_MIRROR
* elif boundary == 'periodic':
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_boundary, __pyx_n_s_mirror, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(26, 203, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscdm.pxi":204
* 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":203
* elif boundary == 'ghosted':
* return DM_BOUNDARY_GHOSTED
* elif boundary == 'mirror': # <<<<<<<<<<<<<<
* return DM_BOUNDARY_MIRROR
* elif boundary == 'periodic':
*/
}
/* "petsc4py/PETSc/petscdm.pxi":205
* elif boundary == 'mirror':
* return DM_BOUNDARY_MIRROR
* elif boundary == 'periodic': # <<<<<<<<<<<<<<
* return DM_BOUNDARY_PERIODIC
* elif boundary == 'twist':
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_boundary, __pyx_n_s_periodic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(26, 205, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscdm.pxi":206
* 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":205
* elif boundary == 'mirror':
* return DM_BOUNDARY_MIRROR
* elif boundary == 'periodic': # <<<<<<<<<<<<<<
* return DM_BOUNDARY_PERIODIC
* elif boundary == 'twist':
*/
}
/* "petsc4py/PETSc/petscdm.pxi":207
* elif boundary == 'periodic':
* return DM_BOUNDARY_PERIODIC
* elif boundary == 'twist': # <<<<<<<<<<<<<<
* return DM_BOUNDARY_TWIST
* else:
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_boundary, __pyx_n_s_twist, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(26, 207, __pyx_L1_error)
if (likely(__pyx_t_1)) {
/* "petsc4py/PETSc/petscdm.pxi":208
* 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":207
* elif boundary == 'periodic':
* return DM_BOUNDARY_PERIODIC
* elif boundary == 'twist': # <<<<<<<<<<<<<<
* return DM_BOUNDARY_TWIST
* else:
*/
}
/* "petsc4py/PETSc/petscdm.pxi":210
* return DM_BOUNDARY_TWIST
* else:
* raise ValueError("unknown boundary type: %s" % boundary) # <<<<<<<<<<<<<<
* return boundary
*
*/
/*else*/ {
__pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_boundary_type_s, __pyx_v_boundary); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 210, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 210, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(26, 210, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscdm.pxi":198
* if boundary is True:
* return DM_BOUNDARY_PERIODIC
* if isinstance(boundary, str): # <<<<<<<<<<<<<<
* if boundary == 'none':
* return DM_BOUNDARY_NONE
*/
}
/* "petsc4py/PETSc/petscdm.pxi":211
* else:
* raise ValueError("unknown boundary type: %s" % boundary)
* return boundary # <<<<<<<<<<<<<<
*
* cdef inline PetscInt asBoundary(object boundary,
*/
__pyx_t_5 = ((DMBoundaryType)__Pyx_PyInt_As_DMBoundaryType(__pyx_v_boundary)); if (unlikely(PyErr_Occurred())) __PYX_ERR(26, 211, __pyx_L1_error)
__pyx_r = __pyx_t_5;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdm.pxi":190
* # --------------------------------------------------------------------
*
* cdef inline PetscDMBoundaryType asBoundaryType(object boundary) \ # <<<<<<<<<<<<<<
* except <PetscDMBoundaryType>(-1):
* if boundary is None:
*/
/* function exit code */
__pyx_L1_error:;
__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":213
* return boundary
*
* cdef inline PetscInt asBoundary(object boundary, # <<<<<<<<<<<<<<
* PetscDMBoundaryType *_x,
* PetscDMBoundaryType *_y,
*/
static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asBoundary(PyObject *__pyx_v_boundary, DMBoundaryType *__pyx_v__x, DMBoundaryType *__pyx_v__y, DMBoundaryType *__pyx_v__z) {
PetscInt __pyx_v_dim;
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_y = 0;
PyObject *__pyx_v_z = 0;
PetscInt __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
DMBoundaryType __pyx_t_5;
Py_ssize_t __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
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("asBoundary", 0);
__Pyx_INCREF(__pyx_v_boundary);
/* "petsc4py/PETSc/petscdm.pxi":217
* PetscDMBoundaryType *_y,
* PetscDMBoundaryType *_z) except -1:
* cdef PetscInt dim = 0 # <<<<<<<<<<<<<<
* cdef object x=None, y=None, z=None
* if (boundary is None or
*/
__pyx_v_dim = 0;
/* "petsc4py/PETSc/petscdm.pxi":218
* PetscDMBoundaryType *_z) except -1:
* cdef PetscInt dim = 0
* cdef object x=None, y=None, z=None # <<<<<<<<<<<<<<
* if (boundary is None or
* isinstance(boundary, str) or
*/
__Pyx_INCREF(Py_None);
__pyx_v_x = Py_None;
__Pyx_INCREF(Py_None);
__pyx_v_y = Py_None;
__Pyx_INCREF(Py_None);
__pyx_v_z = Py_None;
/* "petsc4py/PETSc/petscdm.pxi":219
* cdef PetscInt dim = 0
* cdef object x=None, y=None, z=None
* if (boundary is None or # <<<<<<<<<<<<<<
* isinstance(boundary, str) or
* isinstance(boundary, int)):
*/
__pyx_t_2 = (__pyx_v_boundary == Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (!__pyx_t_3) {
} else {
__pyx_t_1 = __pyx_t_3;
goto __pyx_L4_bool_binop_done;
}
/* "petsc4py/PETSc/petscdm.pxi":220
* cdef object x=None, y=None, z=None
* if (boundary is None or
* isinstance(boundary, str) or # <<<<<<<<<<<<<<
* isinstance(boundary, int)):
* _x[0] = _y[0] = _z[0] = asBoundaryType(boundary)
*/
__pyx_t_3 = PyString_Check(__pyx_v_boundary);
__pyx_t_2 = (__pyx_t_3 != 0);
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L4_bool_binop_done;
}
/* "petsc4py/PETSc/petscdm.pxi":221
* if (boundary is None or
* isinstance(boundary, str) or
* isinstance(boundary, int)): # <<<<<<<<<<<<<<
* _x[0] = _y[0] = _z[0] = asBoundaryType(boundary)
* else:
*/
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 221, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = PyObject_IsInstance(__pyx_v_boundary, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(26, 221, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__pyx_t_2 != 0);
__pyx_t_1 = __pyx_t_3;
__pyx_L4_bool_binop_done:;
/* "petsc4py/PETSc/petscdm.pxi":219
* cdef PetscInt dim = 0
* cdef object x=None, y=None, z=None
* if (boundary is None or # <<<<<<<<<<<<<<
* isinstance(boundary, str) or
* isinstance(boundary, int)):
*/
if (__pyx_t_1) {
/* "petsc4py/PETSc/petscdm.pxi":222
* isinstance(boundary, str) or
* isinstance(boundary, int)):
* _x[0] = _y[0] = _z[0] = asBoundaryType(boundary) # <<<<<<<<<<<<<<
* else:
* _x[0] = _y[0] = _z[0] = DM_BOUNDARY_NONE
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_boundary); if (unlikely(__pyx_t_5 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(26, 222, __pyx_L1_error)
(__pyx_v__x[0]) = __pyx_t_5;
(__pyx_v__y[0]) = __pyx_t_5;
(__pyx_v__z[0]) = __pyx_t_5;
/* "petsc4py/PETSc/petscdm.pxi":219
* cdef PetscInt dim = 0
* cdef object x=None, y=None, z=None
* if (boundary is None or # <<<<<<<<<<<<<<
* isinstance(boundary, str) or
* isinstance(boundary, int)):
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscdm.pxi":224
* _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":225
* 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(26, 225, __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":226
* _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_6 = PyObject_Length(__pyx_v_boundary); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(26, 226, __pyx_L1_error)
__pyx_v_dim = ((PetscInt)__pyx_t_6);
/* "petsc4py/PETSc/petscdm.pxi":227
* 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) != 0);
if (__pyx_t_1) {
goto __pyx_L7;
}
/* "petsc4py/PETSc/petscdm.pxi":228
* 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) != 0);
if (__pyx_t_1) {
if ((likely(PyTuple_CheckExact(__pyx_v_boundary))) || (PyList_CheckExact(__pyx_v_boundary))) {
PyObject* sequence = __pyx_v_boundary;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 1)) {
if (size > 1) __Pyx_RaiseTooManyValuesError(1);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(26, 228, __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);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
}
__Pyx_INCREF(__pyx_t_4);
#else
__pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 228, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_boundary); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 228, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 1) < 0) __PYX_ERR(26, 228, __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(26, 228, __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":229
* 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) != 0);
if (__pyx_t_1) {
if ((likely(PyTuple_CheckExact(__pyx_v_boundary))) || (PyList_CheckExact(__pyx_v_boundary))) {
PyObject* sequence = __pyx_v_boundary;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(26, 229, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
__pyx_t_7 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_7);
#else
__pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_9 = PyObject_GetIter(__pyx_v_boundary); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_8 = Py_TYPE(__pyx_t_9)->tp_iternext;
index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L10_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L10_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_9), 2) < 0) __PYX_ERR(26, 229, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L11_unpacking_done;
__pyx_L10_unpacking_failed:;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(26, 229, __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_7);
__pyx_t_7 = 0;
goto __pyx_L7;
}
/* "petsc4py/PETSc/petscdm.pxi":230
* 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) != 0);
if (__pyx_t_1) {
if ((likely(PyTuple_CheckExact(__pyx_v_boundary))) || (PyList_CheckExact(__pyx_v_boundary))) {
PyObject* sequence = __pyx_v_boundary;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(26, 230, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_4 = PyList_GET_ITEM(sequence, 1);
__pyx_t_9 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_9);
#else
__pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_10 = PyObject_GetIter(__pyx_v_boundary); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_8 = Py_TYPE(__pyx_t_10)->tp_iternext;
index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L12_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L12_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
index = 2; __pyx_t_9 = __pyx_t_8(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L12_unpacking_failed;
__Pyx_GOTREF(__pyx_t_9);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_10), 3) < 0) __PYX_ERR(26, 230, __pyx_L1_error)
__pyx_t_8 = 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_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(26, 230, __pyx_L1_error)
__pyx_L13_unpacking_done:;
}
__Pyx_DECREF_SET(__pyx_v_x, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_DECREF_SET(__pyx_v_y, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_z, __pyx_t_9);
__pyx_t_9 = 0;
}
__pyx_L7:;
/* "petsc4py/PETSc/petscdm.pxi":231
* 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) != 0);
if (__pyx_t_1) {
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_x); if (unlikely(__pyx_t_5 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(26, 231, __pyx_L1_error)
(__pyx_v__x[0]) = __pyx_t_5;
}
/* "petsc4py/PETSc/petscdm.pxi":232
* 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) != 0);
if (__pyx_t_1) {
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_y); if (unlikely(__pyx_t_5 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(26, 232, __pyx_L1_error)
(__pyx_v__y[0]) = __pyx_t_5;
}
/* "petsc4py/PETSc/petscdm.pxi":233
* 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) != 0);
if (__pyx_t_1) {
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_z); if (unlikely(__pyx_t_5 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(26, 233, __pyx_L1_error)
(__pyx_v__z[0]) = __pyx_t_5;
}
}
__pyx_L3:;
/* "petsc4py/PETSc/petscdm.pxi":234
* 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":213
* 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_7);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("petsc4py.PETSc.asBoundary", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1L;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_x);
__Pyx_XDECREF(__pyx_v_y);
__Pyx_XDECREF(__pyx_v_z);
__Pyx_XDECREF(__pyx_v_boundary);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdm.pxi":236
* 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":240
* 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) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_empty_tuple);
__pyx_r = __pyx_empty_tuple;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdm.pxi":241
* 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) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 241, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 241, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__pyx_t_2 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdm.pxi":242
* 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) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__pyx_t_3 = 0;
__pyx_t_2 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdm.pxi":243
* 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) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_z); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
__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":236
* 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":247
* # -----------------------------------------------------------------------------
*
* 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ref_DM", 0);
/* "petsc4py/PETSc/petscdm.pxi":248
*
* cdef inline DM ref_DM(PetscDM dm):
* cdef DM ob = <DM> DM() # <<<<<<<<<<<<<<
* ob.dm = dm
* PetscINCREF(ob.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ob = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdm.pxi":249
* cdef inline DM ref_DM(PetscDM dm):
* cdef DM ob = <DM> DM()
* ob.dm = dm # <<<<<<<<<<<<<<
* PetscINCREF(ob.obj)
* return ob
*/
__pyx_v_ob->dm = __pyx_v_dm;
/* "petsc4py/PETSc/petscdm.pxi":250
* cdef DM ob = <DM> DM()
* ob.dm = dm
* PetscINCREF(ob.obj) # <<<<<<<<<<<<<<
* return ob
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj));
/* "petsc4py/PETSc/petscdm.pxi":251
* ob.dm = dm
* 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":247
* # -----------------------------------------------------------------------------
*
* 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":255
* # --------------------------------------------------------------------
*
* 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;
int __pyx_t_4;
Py_ssize_t __pyx_t_5;
PyObject *(*__pyx_t_6)(PyObject *);
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_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DM_PyCoarsenHook", 0);
/* "petsc4py/PETSc/petscdm.pxi":261
* ) except PETSC_ERR_PYTHON with gil:
*
* cdef DM Fine = ref_DM(fine) # <<<<<<<<<<<<<<
* cdef DM Coarse = ref_DM(coarse)
* cdef object hooks = Fine.get_attr('__coarsenhooks__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_DM(__pyx_v_fine)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Fine = ((struct PyPetscDMObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdm.pxi":262
*
* cdef DM Fine = ref_DM(fine)
* cdef DM Coarse = ref_DM(coarse) # <<<<<<<<<<<<<<
* cdef object hooks = Fine.get_attr('__coarsenhooks__')
* assert hooks is not None and type(hooks) is list
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_DM(__pyx_v_coarse)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Coarse = ((struct PyPetscDMObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdm.pxi":263
* cdef DM Fine = ref_DM(fine)
* cdef DM Coarse = ref_DM(coarse)
* cdef object hooks = Fine.get_attr('__coarsenhooks__') # <<<<<<<<<<<<<<
* assert hooks is not None and type(hooks) is list
* for hook in hooks:
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Fine->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Fine), ((char *)"__coarsenhooks__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_hooks = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdm.pxi":264
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_4 = (((PyObject *)Py_TYPE(__pyx_v_hooks)) == ((PyObject *)(&PyList_Type)));
__pyx_t_3 = (__pyx_t_4 != 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(26, 264, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdm.pxi":265
* 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_5 = 0;
__pyx_t_6 = NULL;
} else {
__pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_hooks); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 265, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 265, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_6)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(26, 265, __pyx_L1_error)
#else
__pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 265, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
} else {
if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(26, 265, __pyx_L1_error)
#else
__pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 265, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
__pyx_t_7 = __pyx_t_6(__pyx_t_1);
if (unlikely(!__pyx_t_7)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(26, 265, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_7);
}
__Pyx_XDECREF_SET(__pyx_v_hook, __pyx_t_7);
__pyx_t_7 = 0;
/* "petsc4py/PETSc/petscdm.pxi":266
* assert hooks is not None and type(hooks) is list
* for hook in hooks:
* (hookop, args, kargs) = hook # <<<<<<<<<<<<<<
* hookop(Fine, Coarse, *args, **kargs)
* return PETSC_SUCCESS
*/
if ((likely(PyTuple_CheckExact(__pyx_v_hook))) || (PyList_CheckExact(__pyx_v_hook))) {
PyObject* sequence = __pyx_v_hook;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(26, 266, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
__pyx_t_9 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
#else
__pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(26, 266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_10 = PyObject_GetIter(__pyx_v_hook); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L7_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_L7_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_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_9);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(26, 266, __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(26, 266, __pyx_L1_error)
__pyx_L8_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_hookop, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_8);
__pyx_t_8 = 0;
__Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_9);
__pyx_t_9 = 0;
/* "petsc4py/PETSc/petscdm.pxi":267
* for hook in hooks:
* (hookop, args, kargs) = hook
* hookop(Fine, Coarse, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 267, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(((PyObject *)__pyx_v_Fine));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Fine));
PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_Fine));
__Pyx_INCREF(((PyObject *)__pyx_v_Coarse));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Coarse));
PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_Coarse));
__pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(26, 267, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = PyNumber_Add(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 267, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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(26, 267, __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(26, 267, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
} else {
__pyx_t_8 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(26, 267, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
}
__pyx_t_9 = __Pyx_PyObject_Call(__pyx_v_hookop, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 267, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__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;
/* "petsc4py/PETSc/petscdm.pxi":265
* 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":268
* (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":255
* # --------------------------------------------------------------------
*
* cdef PetscErrorCode DM_PyCoarsenHook( # <<<<<<<<<<<<<<
* PetscDM fine,
* PetscDM coarse,
*/
/* 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_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("petsc4py.PETSc.DM_PyCoarsenHook", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Fine);
__Pyx_XDECREF((PyObject *)__pyx_v_Coarse);
__Pyx_XDECREF(__pyx_v_hooks);
__Pyx_XDECREF(__pyx_v_hook);
__Pyx_XDECREF(__pyx_v_hookop);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdm.pxi":270
* 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;
int __pyx_t_4;
Py_ssize_t __pyx_t_5;
PyObject *(*__pyx_t_6)(PyObject *);
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_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DM_PyRestrictHook", 0);
/* "petsc4py/PETSc/petscdm.pxi":279
* ) except PETSC_ERR_PYTHON with gil:
*
* cdef DM Fine = ref_DM(fine) # <<<<<<<<<<<<<<
* cdef Mat Mrestrict = ref_Mat(mrestrict)
* cdef Vec Rscale = ref_Vec(rscale)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_DM(__pyx_v_fine)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Fine = ((struct PyPetscDMObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdm.pxi":280
*
* cdef DM Fine = ref_DM(fine)
* cdef Mat Mrestrict = ref_Mat(mrestrict) # <<<<<<<<<<<<<<
* cdef Vec Rscale = ref_Vec(rscale)
* cdef Mat Inject = ref_Mat(inject)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_mrestrict)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Mrestrict = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdm.pxi":281
* cdef DM Fine = ref_DM(fine)
* cdef Mat Mrestrict = ref_Mat(mrestrict)
* cdef Vec Rscale = ref_Vec(rscale) # <<<<<<<<<<<<<<
* cdef Mat Inject = ref_Mat(inject)
* cdef DM Coarse = ref_DM(coarse)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_rscale)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Rscale = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdm.pxi":282
* cdef Mat Mrestrict = ref_Mat(mrestrict)
* cdef Vec Rscale = ref_Vec(rscale)
* cdef Mat Inject = ref_Mat(inject) # <<<<<<<<<<<<<<
* cdef DM Coarse = ref_DM(coarse)
* cdef object hooks = Fine.get_attr('__restricthooks__')
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_inject)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Inject = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdm.pxi":283
* cdef Vec Rscale = ref_Vec(rscale)
* cdef Mat Inject = ref_Mat(inject)
* cdef DM Coarse = ref_DM(coarse) # <<<<<<<<<<<<<<
* cdef object hooks = Fine.get_attr('__restricthooks__')
* assert hooks is not None and type(hooks) is list
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_DM(__pyx_v_coarse)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 283, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_Coarse = ((struct PyPetscDMObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdm.pxi":284
* cdef Mat Inject = ref_Mat(inject)
* cdef DM Coarse = ref_DM(coarse)
* cdef object hooks = Fine.get_attr('__restricthooks__') # <<<<<<<<<<<<<<
* assert hooks is not None and type(hooks) is list
* for hook in hooks:
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Fine->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Fine), ((char *)"__restricthooks__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_hooks = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdm.pxi":285
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_4 = (((PyObject *)Py_TYPE(__pyx_v_hooks)) == ((PyObject *)(&PyList_Type)));
__pyx_t_3 = (__pyx_t_4 != 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(26, 285, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdm.pxi":286
* 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_5 = 0;
__pyx_t_6 = NULL;
} else {
__pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_hooks); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 286, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 286, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_6)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(26, 286, __pyx_L1_error)
#else
__pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 286, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
} else {
if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(26, 286, __pyx_L1_error)
#else
__pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 286, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
__pyx_t_7 = __pyx_t_6(__pyx_t_1);
if (unlikely(!__pyx_t_7)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(26, 286, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_7);
}
__Pyx_XDECREF_SET(__pyx_v_hook, __pyx_t_7);
__pyx_t_7 = 0;
/* "petsc4py/PETSc/petscdm.pxi":287
* assert hooks is not None and type(hooks) is list
* for hook in hooks:
* (hookop, args, kargs) = hook # <<<<<<<<<<<<<<
* hookop(Fine, Mrestrict, Rscale, Inject, Coarse, *args, **kargs)
* return PETSC_SUCCESS
*/
if ((likely(PyTuple_CheckExact(__pyx_v_hook))) || (PyList_CheckExact(__pyx_v_hook))) {
PyObject* sequence = __pyx_v_hook;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(26, 287, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
__pyx_t_9 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
#else
__pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 287, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(26, 287, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 287, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_10 = PyObject_GetIter(__pyx_v_hook); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 287, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L7_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_L7_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_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_9);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(26, 287, __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(26, 287, __pyx_L1_error)
__pyx_L8_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_hookop, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_8);
__pyx_t_8 = 0;
__Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_9);
__pyx_t_9 = 0;
/* "petsc4py/PETSc/petscdm.pxi":288
* for hook in hooks:
* (hookop, args, kargs) = hook
* hookop(Fine, Mrestrict, Rscale, Inject, Coarse, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
* # -----------------------------------------------------------------------------
*/
__pyx_t_9 = PyTuple_New(5); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(((PyObject *)__pyx_v_Fine));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Fine));
PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_Fine));
__Pyx_INCREF(((PyObject *)__pyx_v_Mrestrict));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Mrestrict));
PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_Mrestrict));
__Pyx_INCREF(((PyObject *)__pyx_v_Rscale));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Rscale));
PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_v_Rscale));
__Pyx_INCREF(((PyObject *)__pyx_v_Inject));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Inject));
PyTuple_SET_ITEM(__pyx_t_9, 3, ((PyObject *)__pyx_v_Inject));
__Pyx_INCREF(((PyObject *)__pyx_v_Coarse));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Coarse));
PyTuple_SET_ITEM(__pyx_t_9, 4, ((PyObject *)__pyx_v_Coarse));
__pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(26, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = PyNumber_Add(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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(26, 288, __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(26, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
} else {
__pyx_t_8 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(26, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
}
__pyx_t_9 = __Pyx_PyObject_Call(__pyx_v_hookop, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(26, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__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;
/* "petsc4py/PETSc/petscdm.pxi":286
* 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":289
* (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":270
* 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_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("petsc4py.PETSc.DM_PyRestrictHook", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Fine);
__Pyx_XDECREF((PyObject *)__pyx_v_Mrestrict);
__Pyx_XDECREF((PyObject *)__pyx_v_Rscale);
__Pyx_XDECREF((PyObject *)__pyx_v_Inject);
__Pyx_XDECREF((PyObject *)__pyx_v_Coarse);
__Pyx_XDECREF(__pyx_v_hooks);
__Pyx_XDECREF(__pyx_v_hook);
__Pyx_XDECREF(__pyx_v_hookop);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmda.pxi":88
* # --------------------------------------------------------------------
*
* cdef inline PetscDMDAStencilType asStencil(object stencil) \ # <<<<<<<<<<<<<<
* except <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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
DMDAStencilType __pyx_t_5;
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 = PyString_Check(__pyx_v_stencil);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "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_2 = (__Pyx_PyString_Equals(__pyx_v_stencil, __pyx_n_s_star, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 91, __pyx_L1_error)
if (__pyx_t_2) {
__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_2 = (__Pyx_PyString_Equals(__pyx_v_stencil, __pyx_n_s_box, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 92, __pyx_L1_error)
if (likely(__pyx_t_2)) {
__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 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_stencil_type_s, __pyx_v_stencil); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(9, 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_5 = ((DMDAStencilType)__Pyx_PyInt_As_DMDAStencilType(__pyx_v_stencil)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 94, __pyx_L1_error)
__pyx_r = __pyx_t_5;
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_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) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_n_s_star);
__pyx_r = __pyx_n_s_star;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmda.pxi":98
* cdef inline object toStencil(PetscDMDAStencilType stype):
* if stype == DMDA_STENCIL_STAR: return "star"
* elif stype == DMDA_STENCIL_BOX: return "box" # <<<<<<<<<<<<<<
*
* cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \
*/
__pyx_t_1 = ((__pyx_v_stype == DMDA_STENCIL_BOX) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_n_s_box);
__pyx_r = __pyx_n_s_box;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmda.pxi":96
* return stencil
*
* cdef inline object toStencil(PetscDMDAStencilType stype): # <<<<<<<<<<<<<<
* if stype == DMDA_STENCIL_STAR: return "star"
* elif stype == DMDA_STENCIL_BOX: return "box"
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmda.pxi":100
* elif stype == DMDA_STENCIL_BOX: return "box"
*
* cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \ # <<<<<<<<<<<<<<
* except <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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
DMDAInterpolationType __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("dainterpolationtype", 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 = PyString_Check(__pyx_v_itype);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "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_3 = __pyx_v_itype;
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_q0, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 103, __pyx_L1_error)
if (!__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_Q0, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 103, __pyx_L1_error)
__pyx_t_2 = __pyx_t_1;
__pyx_L5_bool_binop_done:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__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_3 = __pyx_v_itype;
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_q1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 104, __pyx_L1_error)
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L8_bool_binop_done;
}
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_Q1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 104, __pyx_L1_error)
__pyx_t_1 = __pyx_t_2;
__pyx_L8_bool_binop_done:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_2 = (__pyx_t_1 != 0);
if (likely(__pyx_t_2)) {
__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_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_interpolation_type_s, __pyx_v_itype); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 105, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 105, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(9, 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_5 = ((DMDAInterpolationType)__Pyx_PyInt_As_DMDAInterpolationType(__pyx_v_itype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 106, __pyx_L1_error)
__pyx_r = __pyx_t_5;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmda.pxi":100
* elif stype == DMDA_STENCIL_BOX: return "box"
*
* cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \ # <<<<<<<<<<<<<<
* except <PetscDMDAInterpolationType>(-1):
* if (isinstance(itype, str)):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("petsc4py.PETSc.dainterpolationtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = ((DMDAInterpolationType)-1L);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmda.pxi":108
* return itype
*
* cdef inline PetscDMDAElementType daelementtype(object etype) \ # <<<<<<<<<<<<<<
* except <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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
DMDAElementType __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("daelementtype", 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 = PyString_Check(__pyx_v_etype);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "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_3 = __pyx_v_etype;
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_p1, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 111, __pyx_L1_error)
if (!__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_P1, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 111, __pyx_L1_error)
__pyx_t_2 = __pyx_t_1;
__pyx_L5_bool_binop_done:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__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_3 = __pyx_v_etype;
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_q1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 112, __pyx_L1_error)
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L8_bool_binop_done;
}
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_Q1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 112, __pyx_L1_error)
__pyx_t_1 = __pyx_t_2;
__pyx_L8_bool_binop_done:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_2 = (__pyx_t_1 != 0);
if (likely(__pyx_t_2)) {
__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_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_element_type_s, __pyx_v_etype); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(9, 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) nogil:
*/
__pyx_t_5 = ((DMDAElementType)__Pyx_PyInt_As_DMDAElementType(__pyx_v_etype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 114, __pyx_L1_error)
__pyx_r = __pyx_t_5;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmda.pxi":108
* return itype
*
* cdef inline PetscDMDAElementType daelementtype(object etype) \ # <<<<<<<<<<<<<<
* except <PetscDMDAElementType>(-1):
* if (isinstance(etype, str)):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("petsc4py.PETSc.daelementtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = ((DMDAElementType)-1L);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmda.pxi":116
* return etype
*
* cdef inline PetscErrorCode DMDAGetDim(PetscDM da, PetscInt *dim) 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) 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) 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(9, 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(9, 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) != 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) != 0);
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(9, 133, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
}
__Pyx_INCREF(__pyx_t_1);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 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(9, 133, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
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(9, 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(9, 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) != 0);
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(9, 134, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_4 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_4);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 134, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 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(9, 134, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext;
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(9, 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(9, 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) != 0);
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(9, 135, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 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(9, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_5 = Py_TYPE(__pyx_t_7)->tp_iternext;
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(9, 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(9, 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) != 0);
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(9, 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) != 0);
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(9, 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) != 0);
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(9, 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) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_empty_tuple);
__pyx_r = __pyx_empty_tuple;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmda.pxi":146
* PetscInt P):
* if dim == 0: return ()
* elif dim == 1: return (toInt(M),) # <<<<<<<<<<<<<<
* elif dim == 2: return (toInt(M), toInt(N))
* elif dim == 3: return (toInt(M), toInt(N), toInt(P))
*/
__pyx_t_1 = ((__pyx_v_dim == 1) != 0);
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(9, 146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__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) != 0);
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(9, 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(9, 147, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 147, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__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) != 0);
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(9, 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(9, 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(9, 148, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 148, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
__pyx_t_4 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmda.pxi":141
* return dim
*
* cdef inline tuple toDims(PetscInt dim, # <<<<<<<<<<<<<<
* PetscInt M,
* PetscInt N,
*/
/* function exit code */
__pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.toDims", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmda.pxi":150
* elif dim == 3: return (toInt(M), toInt(N), toInt(P))
*
* cdef inline tuple asOwnershipRanges(object ownership_ranges, # <<<<<<<<<<<<<<
* PetscInt dim,
* PetscInt *m, PetscInt *n, PetscInt *p,
*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_asOwnershipRanges(PyObject *__pyx_v_ownership_ranges, PetscInt __pyx_v_dim, PetscInt *__pyx_v_m, PetscInt *__pyx_v_n, PetscInt *__pyx_v_p, PetscInt **__pyx_v__x, PetscInt **__pyx_v__y, PetscInt **__pyx_v__z) {
PyObject *__pyx_v_ranges = 0;
PetscInt __pyx_v_rdim;
PetscInt __pyx_v_nlx;
PetscInt __pyx_v_nly;
PetscInt __pyx_v_nlz;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("asOwnershipRanges", 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(9, 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(9, 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) != 0);
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) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscdmda.pxi":162
* elif dim != rdim: raise ValueError(
* "number of dimensions %d and number ownership ranges %d" %
* (toInt(dim), toInt(rdim))) # <<<<<<<<<<<<<<
* if dim >= 1:
* ranges[0] = iarray_i(ranges[0], &nlx, _x)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_rdim); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
__pyx_t_1 = 0;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":161
* if dim == PETSC_DECIDE: dim = rdim
* elif dim != rdim: raise ValueError(
* "number of dimensions %d and number ownership ranges %d" % # <<<<<<<<<<<<<<
* (toInt(dim), toInt(rdim)))
* if dim >= 1:
*/
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_number_of_dimensions_d_and_numbe, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":160
* cdef PetscInt nlx=0, nly=0, nlz=0
* if dim == PETSC_DECIDE: dim = rdim
* elif dim != rdim: raise ValueError( # <<<<<<<<<<<<<<
* "number of dimensions %d and number ownership ranges %d" %
* (toInt(dim), toInt(rdim)))
*/
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(9, 160, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/petscdmda.pxi":163
* "number of dimensions %d and number ownership ranges %d" %
* (toInt(dim), toInt(rdim)))
* if dim >= 1: # <<<<<<<<<<<<<<
* ranges[0] = iarray_i(ranges[0], &nlx, _x)
* if m[0] == PETSC_DECIDE: m[0] = nlx
*/
__pyx_t_3 = ((__pyx_v_dim >= 1) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscdmda.pxi":164
* (toInt(dim), toInt(rdim)))
* if dim >= 1:
* ranges[0] = iarray_i(ranges[0], &nlx, _x) # <<<<<<<<<<<<<<
* if m[0] == PETSC_DECIDE: m[0] = nlx
* elif m[0] != nlx: raise ValueError(
*/
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ranges, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_5, (&__pyx_v_nlx), __pyx_v__x)); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(__Pyx_SetItemInt(__pyx_v_ranges, 0, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(9, 164, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":165
* if dim >= 1:
* ranges[0] = iarray_i(ranges[0], &nlx, _x)
* if m[0] == PETSC_DECIDE: m[0] = nlx # <<<<<<<<<<<<<<
* elif m[0] != nlx: raise ValueError(
* "ownership range size %d and number or processors %d" %
*/
__pyx_t_3 = (((__pyx_v_m[0]) == PETSC_DECIDE) != 0);
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) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscdmda.pxi":168
* elif m[0] != nlx: raise ValueError(
* "ownership range size %d and number or processors %d" %
* (toInt(nlx), toInt(m[0]))) # <<<<<<<<<<<<<<
* if dim >= 2:
* ranges[1] = iarray_i(ranges[1], &nly, _y)
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nlx); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
__pyx_t_4 = 0;
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":167
* if m[0] == PETSC_DECIDE: m[0] = nlx
* elif m[0] != nlx: raise ValueError(
* "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<<
* (toInt(nlx), toInt(m[0])))
* if dim >= 2:
*/
__pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":166
* ranges[0] = iarray_i(ranges[0], &nlx, _x)
* if m[0] == PETSC_DECIDE: m[0] = nlx
* elif m[0] != nlx: raise ValueError( # <<<<<<<<<<<<<<
* "ownership range size %d and number or processors %d" %
* (toInt(nlx), toInt(m[0])))
*/
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(9, 166, __pyx_L1_error)
}
__pyx_L5:;
/* "petsc4py/PETSc/petscdmda.pxi":163
* "number of dimensions %d and number ownership ranges %d" %
* (toInt(dim), toInt(rdim)))
* if dim >= 1: # <<<<<<<<<<<<<<
* ranges[0] = iarray_i(ranges[0], &nlx, _x)
* if m[0] == PETSC_DECIDE: m[0] = nlx
*/
}
/* "petsc4py/PETSc/petscdmda.pxi":169
* "ownership range size %d and number or processors %d" %
* (toInt(nlx), toInt(m[0])))
* if dim >= 2: # <<<<<<<<<<<<<<
* ranges[1] = iarray_i(ranges[1], &nly, _y)
* if n[0] == PETSC_DECIDE: n[0] = nly
*/
__pyx_t_3 = ((__pyx_v_dim >= 2) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscdmda.pxi":170
* (toInt(nlx), toInt(m[0])))
* if dim >= 2:
* ranges[1] = iarray_i(ranges[1], &nly, _y) # <<<<<<<<<<<<<<
* if n[0] == PETSC_DECIDE: n[0] = nly
* elif n[0] != nly: raise ValueError(
*/
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ranges, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_1, (&__pyx_v_nly), __pyx_v__y)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__Pyx_SetItemInt(__pyx_v_ranges, 1, __pyx_t_5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(9, 170, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":171
* if dim >= 2:
* ranges[1] = iarray_i(ranges[1], &nly, _y)
* if n[0] == PETSC_DECIDE: n[0] = nly # <<<<<<<<<<<<<<
* elif n[0] != nly: raise ValueError(
* "ownership range size %d and number or processors %d" %
*/
__pyx_t_3 = (((__pyx_v_n[0]) == PETSC_DECIDE) != 0);
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) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscdmda.pxi":174
* elif n[0] != nly: raise ValueError(
* "ownership range size %d and number or processors %d" %
* (toInt(nly), toInt(n[0]))) # <<<<<<<<<<<<<<
* if dim >= 3:
* ranges[2] = iarray_i(ranges[2], &nlz, _z)
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nly); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 174, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_n[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 174, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 174, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
__pyx_t_5 = 0;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":173
* if n[0] == PETSC_DECIDE: n[0] = nly
* elif n[0] != nly: raise ValueError(
* "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<<
* (toInt(nly), toInt(n[0])))
* if dim >= 3:
*/
__pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":172
* ranges[1] = iarray_i(ranges[1], &nly, _y)
* if n[0] == PETSC_DECIDE: n[0] = nly
* elif n[0] != nly: raise ValueError( # <<<<<<<<<<<<<<
* "ownership range size %d and number or processors %d" %
* (toInt(nly), toInt(n[0])))
*/
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(9, 172, __pyx_L1_error)
}
__pyx_L7:;
/* "petsc4py/PETSc/petscdmda.pxi":169
* "ownership range size %d and number or processors %d" %
* (toInt(nlx), toInt(m[0])))
* if dim >= 2: # <<<<<<<<<<<<<<
* ranges[1] = iarray_i(ranges[1], &nly, _y)
* if n[0] == PETSC_DECIDE: n[0] = nly
*/
}
/* "petsc4py/PETSc/petscdmda.pxi":175
* "ownership range size %d and number or processors %d" %
* (toInt(nly), toInt(n[0])))
* if dim >= 3: # <<<<<<<<<<<<<<
* ranges[2] = iarray_i(ranges[2], &nlz, _z)
* if p[0] == PETSC_DECIDE: p[0] = nlz
*/
__pyx_t_3 = ((__pyx_v_dim >= 3) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscdmda.pxi":176
* (toInt(nly), toInt(n[0])))
* if dim >= 3:
* ranges[2] = iarray_i(ranges[2], &nlz, _z) # <<<<<<<<<<<<<<
* if p[0] == PETSC_DECIDE: p[0] = nlz
* elif p[0] != nlz: raise ValueError(
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ranges, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 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(9, 176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(__Pyx_SetItemInt(__pyx_v_ranges, 2, __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(9, 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) != 0);
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) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscdmda.pxi":180
* elif p[0] != nlz: raise ValueError(
* "ownership range size %d and number or processors %d" %
* (toInt(nlz), toInt(p[0]))) # <<<<<<<<<<<<<<
* return tuple(ranges)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nlz); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 180, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_p[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 180, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 180, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
__pyx_t_1 = 0;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":179
* if p[0] == PETSC_DECIDE: p[0] = nlz
* elif p[0] != nlz: raise ValueError(
* "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<<
* (toInt(nlz), toInt(p[0])))
* return tuple(ranges)
*/
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 179, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":178
* ranges[2] = iarray_i(ranges[2], &nlz, _z)
* if p[0] == PETSC_DECIDE: p[0] = nlz
* elif p[0] != nlz: raise ValueError( # <<<<<<<<<<<<<<
* "ownership range size %d and number or processors %d" %
* (toInt(nlz), toInt(p[0])))
*/
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 178, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(9, 178, __pyx_L1_error)
}
__pyx_L9:;
/* "petsc4py/PETSc/petscdmda.pxi":175
* "ownership range size %d and number or processors %d" %
* (toInt(nly), toInt(n[0])))
* if dim >= 3: # <<<<<<<<<<<<<<
* ranges[2] = iarray_i(ranges[2], &nlz, _z)
* if p[0] == PETSC_DECIDE: p[0] = nlz
*/
}
/* "petsc4py/PETSc/petscdmda.pxi":181
* "ownership range size %d and number or processors %d" %
* (toInt(nlz), toInt(p[0])))
* return tuple(ranges) # <<<<<<<<<<<<<<
*
* cdef inline tuple toOwnershipRanges(PetscInt dim,
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_ranges); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 181, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmda.pxi":150
* elif dim == 3: return (toInt(M), toInt(N), toInt(P))
*
* cdef inline tuple asOwnershipRanges(object ownership_ranges, # <<<<<<<<<<<<<<
* PetscInt dim,
* PetscInt *m, PetscInt *n, PetscInt *p,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.asOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_ranges);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmda.pxi":183
* return tuple(ranges)
*
* cdef inline tuple toOwnershipRanges(PetscInt dim, # <<<<<<<<<<<<<<
* PetscInt m, PetscInt n, PetscInt p,
* const PetscInt *lx,
*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toOwnershipRanges(PetscInt __pyx_v_dim, PetscInt __pyx_v_m, PetscInt __pyx_v_n, PetscInt __pyx_v_p, PetscInt const *__pyx_v_lx, PetscInt const *__pyx_v_ly, PetscInt const *__pyx_v_lz) {
PyObject *__pyx_v_ranges = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("toOwnershipRanges", 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(9, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__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) != 0);
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(9, 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(9, 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) != 0);
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(9, 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(9, 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(9, 194, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmda.pxi":183
* return tuple(ranges)
*
* cdef inline tuple toOwnershipRanges(PetscInt dim, # <<<<<<<<<<<<<<
* PetscInt m, PetscInt n, PetscInt p,
* const PetscInt *lx,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.toOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_ranges);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmda.pxi":205
* cdef readonly ndarray array
*
* def __cinit__(self, DMDA da, Vec vec, bint DOF=False): # <<<<<<<<<<<<<<
* #
* cdef PetscInt dim=0, dof=0
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_da = 0;
struct PyPetscVecObject *__pyx_v_vec = 0;
int __pyx_v_DOF;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_da,&__pyx_n_s_vec,&__pyx_n_s_DOF,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_da)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(9, 205, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_DOF);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(9, 205, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_da = ((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)values[0]);
__pyx_v_vec = ((struct PyPetscVecObject *)values[1]);
if (values[2]) {
__pyx_v_DOF = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_DOF == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 205, __pyx_L3_error)
} else {
__pyx_v_DOF = ((int)0);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 205, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_da), __pyx_ptype_8petsc4py_5PETSc_DMDA, 0, "da", 0))) __PYX_ERR(9, 205, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(9, 205, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array___cinit__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self), __pyx_v_da, __pyx_v_vec, __pyx_v_DOF);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array___cinit__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_da, struct PyPetscVecObject *__pyx_v_vec, int __pyx_v_DOF) {
PetscInt __pyx_v_dim;
PetscInt __pyx_v_dof;
PetscInt __pyx_v_lxs;
PetscInt __pyx_v_lys;
PetscInt __pyx_v_lzs;
PetscInt __pyx_v_lxm;
PetscInt __pyx_v_lym;
PetscInt __pyx_v_lzm;
PetscInt __pyx_v_gxs;
PetscInt __pyx_v_gys;
PetscInt __pyx_v_gzs;
PetscInt __pyx_v_gxm;
PetscInt __pyx_v_gym;
PetscInt __pyx_v_gzm;
PetscInt __pyx_v_n;
PetscInt __pyx_v_xs;
PetscInt __pyx_v_ys;
PetscInt __pyx_v_zs;
PetscInt __pyx_v_xm;
PetscInt __pyx_v_ym;
PetscInt __pyx_v_zm;
PyObject *__pyx_v_starts = 0;
PyObject *__pyx_v_sizes = 0;
Py_ssize_t __pyx_v_k;
Py_ssize_t __pyx_v_f;
Py_ssize_t __pyx_v_d;
PyObject *__pyx_v_shape = 0;
PyObject *__pyx_v_strides = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_t_2;
PetscInt __pyx_t_3;
PetscInt __pyx_t_4;
PetscInt __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
int __pyx_t_10;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/petscdmda.pxi":207
* def __cinit__(self, DMDA da, Vec vec, bint DOF=False):
* #
* cdef PetscInt dim=0, dof=0 # <<<<<<<<<<<<<<
* CHKERR( DMDAGetInfo(da.dm,
* &dim, NULL, NULL, NULL, NULL, NULL, NULL,
*/
__pyx_v_dim = 0;
__pyx_v_dof = 0;
/* "petsc4py/PETSc/petscdmda.pxi":208
* #
* cdef PetscInt dim=0, dof=0
* CHKERR( DMDAGetInfo(da.dm, # <<<<<<<<<<<<<<
* &dim, NULL, NULL, NULL, NULL, NULL, NULL,
* &dof, NULL, NULL, NULL, NULL, NULL) )
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_da->__pyx_base.dm, (&__pyx_v_dim), NULL, NULL, NULL, NULL, NULL, NULL, (&__pyx_v_dof), NULL, NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(9, 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(9, 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(9, 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(9, 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)) != 0);
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)) != 0);
if (likely(__pyx_t_2)) {
/* "petsc4py/PETSc/petscdmda.pxi":229
* xm, ym, zm = lxm, lym, lzm
* elif (n == gxm*gym*gzm*dof):
* xs, ys, zs = gxs, gys, gzs # <<<<<<<<<<<<<<
* xm, ym, zm = gxm, gym, gzm
* else:
*/
__pyx_t_3 = __pyx_v_gxs;
__pyx_t_4 = __pyx_v_gys;
__pyx_t_5 = __pyx_v_gzs;
__pyx_v_xs = __pyx_t_3;
__pyx_v_ys = __pyx_t_4;
__pyx_v_zs = __pyx_t_5;
/* "petsc4py/PETSc/petscdmda.pxi":230
* elif (n == gxm*gym*gzm*dof):
* xs, ys, zs = gxs, gys, gzs
* xm, ym, zm = gxm, gym, gzm # <<<<<<<<<<<<<<
* else:
* raise ValueError(
*/
__pyx_t_5 = __pyx_v_gxm;
__pyx_t_4 = __pyx_v_gym;
__pyx_t_3 = __pyx_v_gzm;
__pyx_v_xm = __pyx_t_5;
__pyx_v_ym = __pyx_t_4;
__pyx_v_zm = __pyx_t_3;
/* "petsc4py/PETSc/petscdmda.pxi":228
* xs, ys, zs = lxs, lys, lzs
* xm, ym, zm = lxm, lym, lzm
* elif (n == gxm*gym*gzm*dof): # <<<<<<<<<<<<<<
* xs, ys, zs = gxs, gys, gzs
* xm, ym, zm = gxm, gym, gzm
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscdmda.pxi":232
* xm, ym, zm = gxm, gym, gzm
* else:
* raise ValueError( # <<<<<<<<<<<<<<
* "Vector local size %d is not compatible "
* "with DMDA local sizes %s"
*/
/*else*/ {
/* "petsc4py/PETSc/petscdmda.pxi":235
* "Vector local size %d is not compatible "
* "with DMDA local sizes %s"
* % (<Py_ssize_t>n, toDims(dim, lxm, lym, lzm))) # <<<<<<<<<<<<<<
* #
* cdef tuple starts = toDims(dim, xs, ys, zs)
*/
__pyx_t_6 = PyInt_FromSsize_t(((Py_ssize_t)__pyx_v_n)); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_lxm, __pyx_v_lym, __pyx_v_lzm); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
__pyx_t_6 = 0;
__pyx_t_7 = 0;
__pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Vector_local_size_d_is_not_compa, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":232
* xm, ym, zm = gxm, gym, gzm
* else:
* raise ValueError( # <<<<<<<<<<<<<<
* "Vector local size %d is not compatible "
* "with DMDA local sizes %s"
*/
__pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 232, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(9, 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_8 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_xs, __pyx_v_ys, __pyx_v_zs); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_v_starts = ((PyObject*)__pyx_t_8);
__pyx_t_8 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":238
* #
* cdef tuple starts = toDims(dim, xs, ys, zs)
* cdef tuple sizes = toDims(dim, xm, ym, zm) # <<<<<<<<<<<<<<
* cdef Py_ssize_t k = <Py_ssize_t>sizeof(PetscScalar)
* cdef Py_ssize_t f = <Py_ssize_t>dof
*/
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_xm, __pyx_v_ym, __pyx_v_zm); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_v_sizes = ((PyObject*)__pyx_t_8);
__pyx_t_8 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":239
* cdef tuple starts = toDims(dim, xs, ys, zs)
* cdef tuple sizes = toDims(dim, xm, ym, zm)
* cdef Py_ssize_t k = <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_8 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_xm, __pyx_v_ym, __pyx_v_zm); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_v_shape = ((PyObject*)__pyx_t_8);
__pyx_t_8 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":243
* cdef Py_ssize_t d = <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_8 = PyInt_FromSsize_t((__pyx_v_k * __pyx_v_f)); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = PyInt_FromSsize_t(((__pyx_v_k * __pyx_v_f) * __pyx_v_xm)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = PyInt_FromSsize_t((((__pyx_v_k * __pyx_v_f) * __pyx_v_xm) * __pyx_v_ym)); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_6);
__pyx_t_8 = 0;
__pyx_t_7 = 0;
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_9, 0, __pyx_v_d, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (!(likely(PyTuple_CheckExact(__pyx_t_6))||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(9, 243, __pyx_L1_error)
__pyx_v_strides = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":244
* cdef tuple shape = toDims(dim, xm, ym, zm)
* cdef tuple strides = (k*f, k*f*xm, k*f*xm*ym)[:d]
* if DOF or f > 1: shape += (f,) # <<<<<<<<<<<<<<
* if DOF or f > 1: strides += (k,)
* #
*/
__pyx_t_10 = (__pyx_v_DOF != 0);
if (!__pyx_t_10) {
} else {
__pyx_t_2 = __pyx_t_10;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_10 = ((__pyx_v_f > 1) != 0);
__pyx_t_2 = __pyx_t_10;
__pyx_L5_bool_binop_done:;
if (__pyx_t_2) {
__pyx_t_6 = PyInt_FromSsize_t(__pyx_v_f); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6);
__pyx_t_6 = 0;
__pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_shape, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF_SET(__pyx_v_shape, ((PyObject*)__pyx_t_6));
__pyx_t_6 = 0;
}
/* "petsc4py/PETSc/petscdmda.pxi":245
* cdef tuple strides = (k*f, k*f*xm, k*f*xm*ym)[:d]
* if DOF or f > 1: shape += (f,)
* if DOF or f > 1: strides += (k,) # <<<<<<<<<<<<<<
* #
* self.vecbuf = _Vec_buffer(vec)
*/
__pyx_t_10 = (__pyx_v_DOF != 0);
if (!__pyx_t_10) {
} else {
__pyx_t_2 = __pyx_t_10;
goto __pyx_L8_bool_binop_done;
}
__pyx_t_10 = ((__pyx_v_f > 1) != 0);
__pyx_t_2 = __pyx_t_10;
__pyx_L8_bool_binop_done:;
if (__pyx_t_2) {
__pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6);
__pyx_t_6 = 0;
__pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_strides, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF_SET(__pyx_v_strides, ((PyObject*)__pyx_t_6));
__pyx_t_6 = 0;
}
/* "petsc4py/PETSc/petscdmda.pxi":247
* if DOF or f > 1: strides += (k,)
* #
* self.vecbuf = _Vec_buffer(vec) # <<<<<<<<<<<<<<
* self.starts = starts
* self.sizes = sizes
*/
__pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_buffer), ((PyObject *)__pyx_v_vec)); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 247, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_v_self->vecbuf);
__Pyx_DECREF(((PyObject *)__pyx_v_self->vecbuf));
__pyx_v_self->vecbuf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":248
* #
* self.vecbuf = _Vec_buffer(vec)
* self.starts = starts # <<<<<<<<<<<<<<
* self.sizes = sizes
* self.shape = shape
*/
__Pyx_INCREF(__pyx_v_starts);
__Pyx_GIVEREF(__pyx_v_starts);
__Pyx_GOTREF(__pyx_v_self->starts);
__Pyx_DECREF(__pyx_v_self->starts);
__pyx_v_self->starts = __pyx_v_starts;
/* "petsc4py/PETSc/petscdmda.pxi":249
* self.vecbuf = _Vec_buffer(vec)
* self.starts = starts
* self.sizes = sizes # <<<<<<<<<<<<<<
* self.shape = shape
* self.strides = strides
*/
__Pyx_INCREF(__pyx_v_sizes);
__Pyx_GIVEREF(__pyx_v_sizes);
__Pyx_GOTREF(__pyx_v_self->sizes);
__Pyx_DECREF(__pyx_v_self->sizes);
__pyx_v_self->sizes = __pyx_v_sizes;
/* "petsc4py/PETSc/petscdmda.pxi":250
* self.starts = starts
* self.sizes = sizes
* self.shape = shape # <<<<<<<<<<<<<<
* self.strides = strides
*
*/
__Pyx_INCREF(__pyx_v_shape);
__Pyx_GIVEREF(__pyx_v_shape);
__Pyx_GOTREF(__pyx_v_self->shape);
__Pyx_DECREF(__pyx_v_self->shape);
__pyx_v_self->shape = __pyx_v_shape;
/* "petsc4py/PETSc/petscdmda.pxi":251
* self.sizes = sizes
* self.shape = shape
* self.strides = strides # <<<<<<<<<<<<<<
*
* cdef int acquire(self) except -1:
*/
__Pyx_INCREF(__pyx_v_strides);
__Pyx_GIVEREF(__pyx_v_strides);
__Pyx_GOTREF(__pyx_v_self->strides);
__Pyx_DECREF(__pyx_v_self->strides);
__pyx_v_self->strides = __pyx_v_strides;
/* "petsc4py/PETSc/petscdmda.pxi":205
* cdef readonly ndarray array
*
* def __cinit__(self, DMDA da, Vec vec, bint DOF=False): # <<<<<<<<<<<<<<
* #
* cdef PetscInt dim=0, dof=0
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_starts);
__Pyx_XDECREF(__pyx_v_sizes);
__Pyx_XDECREF(__pyx_v_shape);
__Pyx_XDECREF(__pyx_v_strides);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmda.pxi":253
* self.strides = strides
*
* cdef int acquire(self) except -1: # <<<<<<<<<<<<<<
* self.vecbuf.acquire()
* if self.array is None:
*/
static int __pyx_f_8petsc4py_5PETSc_15_DMDA_Vec_array_acquire(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
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("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(9, 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "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_4 = ((PyObject *)__pyx_v_self->vecbuf);
__Pyx_INCREF(__pyx_t_4);
__pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GIVEREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_v_self->array);
__Pyx_DECREF(((PyObject *)__pyx_v_self->array));
__pyx_v_self->array = ((PyArrayObject *)__pyx_t_5);
__pyx_t_5 = 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_5 = __pyx_v_self->shape;
__Pyx_INCREF(__pyx_t_5);
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self->array), __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(9, 257, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_5 = __pyx_v_self->strides;
__Pyx_INCREF(__pyx_t_5);
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self->array), __pyx_n_s_strides, __pyx_t_5) < 0) __PYX_ERR(9, 258, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_4);
__Pyx_XDECREF(__pyx_t_5);
__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(9, 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(__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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
__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(9, 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(9, 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(9, 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
__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(9, 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(9, 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(9, 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_15_DMDA_Vec_array_6__enter__[] = "_DMDA_Vec_array.__enter__(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_7__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6__enter__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6__enter__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__enter__", 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(9, 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*/
static char __pyx_doc_8petsc4py_5PETSc_15_DMDA_Vec_array_8__exit__[] = "_DMDA_Vec_array.__exit__(self, *exc)";
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;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_exc = __pyx_args;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_8__exit__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self), __pyx_v_exc);
/* function exit code */
__Pyx_XDECREF(__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(9, 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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 != 0)) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscdmda.pxi":291
* cdef object adjust_index_exp(object starts, object index):
* if not isinstance(index, tuple):
* return adjust_index(starts[0], index) # <<<<<<<<<<<<<<
* index = list(index)
* for i, start in enumerate(starts):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_starts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 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(9, 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(9, 292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":293
* return adjust_index(starts[0], index)
* index = list(index)
* for i, start in enumerate(starts): # <<<<<<<<<<<<<<
* index[i] = adjust_index(start, index[i])
* index = tuple(index)
*/
__Pyx_INCREF(__pyx_int_0);
__pyx_t_4 = __pyx_int_0;
if (likely(PyList_CheckExact(__pyx_v_starts)) || PyTuple_CheckExact(__pyx_v_starts)) {
__pyx_t_3 = __pyx_v_starts; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
__pyx_t_6 = NULL;
} else {
__pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_starts); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 293, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_6)) {
if (likely(PyList_CheckExact(__pyx_t_3))) {
if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(9, 293, __pyx_L1_error)
#else
__pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
} else {
if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(9, 293, __pyx_L1_error)
#else
__pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
__pyx_t_7 = __pyx_t_6(__pyx_t_3);
if (unlikely(!__pyx_t_7)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(9, 293, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_7);
}
__Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_7);
__pyx_t_7 = 0;
__Pyx_INCREF(__pyx_t_4);
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
__pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 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(9, 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(9, 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(9, 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(9, 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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
int __pyx_t_7;
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("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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "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_2 = (__pyx_v_index == __pyx_builtin_Ellipsis);
__pyx_t_1 = (__pyx_t_2 != 0);
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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscdmda.pxi":304
* return index
* if isinstance(index, slice):
* start = index.start # <<<<<<<<<<<<<<
* stop = index.stop
* step = index.step
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 304, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_start = __pyx_t_3;
__pyx_t_3 = 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_stop = __pyx_t_3;
__pyx_t_3 = 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_step = __pyx_t_3;
__pyx_t_3 = 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_2 = (__pyx_v_start != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_v_start, __pyx_v_lbound); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 307, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_start, __pyx_t_3);
__pyx_t_3 = 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_v_stop, __pyx_v_lbound); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 308, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_stop, __pyx_t_3);
__pyx_t_3 = 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_3 = PySlice_New(__pyx_v_start, __pyx_v_stop, __pyx_v_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 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_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/petscdmda.pxi":311
* return slice(start, stop, step)
* try:
* return index - lbound # <<<<<<<<<<<<<<
* except TypeError:
* return index
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = PyNumber_Subtract(__pyx_v_index, __pyx_v_lbound); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 311, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 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_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/petscdmda.pxi":312
* try:
* return index - lbound
* except TypeError: # <<<<<<<<<<<<<<
* return index
*
*/
__pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
if (__pyx_t_7) {
__Pyx_AddTraceback("petsc4py.PETSc.adjust_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(9, 312, __pyx_L10_except_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_9);
/* "petsc4py/PETSc/petscdmda.pxi":313
* return index - lbound
* except TypeError:
* return index # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_index);
__pyx_r = __pyx_v_index;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L11_except_return;
}
goto __pyx_L10_except_error;
__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_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_L12_try_return:;
__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_L0;
__pyx_L11_except_return:;
__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_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_3);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("petsc4py.PETSc.adjust_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_start);
__Pyx_XDECREF(__pyx_v_stop);
__Pyx_XDECREF(__pyx_v_step);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmstag.pxi":85
* # --------------------------------------------------------------------
*
* cdef inline PetscDMStagStencilType asStagStencil(object stencil) \ # <<<<<<<<<<<<<<
* except <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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
DMStagStencilType __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("asStagStencil", 0);
/* "petsc4py/PETSc/petscdmstag.pxi":87
* 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 = PyString_Check(__pyx_v_stencil);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscdmstag.pxi":88
* 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_2 = (__Pyx_PyString_Equals(__pyx_v_stencil, __pyx_n_s_star, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 88, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_STENCIL_STAR;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":89
* if isinstance(stencil, str):
* if stencil == "star": return DMSTAG_STENCIL_STAR
* elif stencil == "box": return DMSTAG_STENCIL_BOX # <<<<<<<<<<<<<<
* elif stencil == "none": return DMSTAG_STENCIL_NONE
* else: raise ValueError("unknown stencil type: %s" % stencil)
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil, __pyx_n_s_box, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 89, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_STENCIL_BOX;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":90
* if stencil == "star": return DMSTAG_STENCIL_STAR
* elif stencil == "box": return DMSTAG_STENCIL_BOX
* elif stencil == "none": return DMSTAG_STENCIL_NONE # <<<<<<<<<<<<<<
* else: raise ValueError("unknown stencil type: %s" % stencil)
* return stencil
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil, __pyx_n_s_none, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 90, __pyx_L1_error)
if (likely(__pyx_t_2)) {
__pyx_r = DMSTAG_STENCIL_NONE;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":91
* elif stencil == "box": return DMSTAG_STENCIL_BOX
* elif stencil == "none": return DMSTAG_STENCIL_NONE
* else: raise ValueError("unknown stencil type: %s" % stencil) # <<<<<<<<<<<<<<
* return stencil
*
*/
/*else*/ {
__pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_stencil_type_s, __pyx_v_stencil); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(27, 91, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscdmstag.pxi":87
* 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":92
* elif stencil == "none": return DMSTAG_STENCIL_NONE
* else: raise ValueError("unknown stencil type: %s" % stencil)
* return stencil # <<<<<<<<<<<<<<
*
* cdef inline object toStagStencil(PetscDMStagStencilType stype):
*/
__pyx_t_5 = ((DMStagStencilType)__Pyx_PyInt_As_DMStagStencilType(__pyx_v_stencil)); if (unlikely(PyErr_Occurred())) __PYX_ERR(27, 92, __pyx_L1_error)
__pyx_r = __pyx_t_5;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmstag.pxi":85
* # --------------------------------------------------------------------
*
* cdef inline PetscDMStagStencilType asStagStencil(object stencil) \ # <<<<<<<<<<<<<<
* except <PetscDMStagStencilType>(-1):
* if isinstance(stencil, str):
*/
/* function exit code */
__pyx_L1_error:;
__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":94
* return stencil
*
* cdef inline object toStagStencil(PetscDMStagStencilType stype): # <<<<<<<<<<<<<<
* if stype == DMSTAG_STENCIL_STAR: return "star"
* elif stype == DMSTAG_STENCIL_BOX: return "box"
*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagStencil(DMStagStencilType __pyx_v_stype) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("toStagStencil", 0);
/* "petsc4py/PETSc/petscdmstag.pxi":95
*
* cdef inline object toStagStencil(PetscDMStagStencilType stype):
* if stype == DMSTAG_STENCIL_STAR: return "star" # <<<<<<<<<<<<<<
* elif stype == DMSTAG_STENCIL_BOX: return "box"
* elif stype == DMSTAG_STENCIL_NONE: return "none"
*/
__pyx_t_1 = ((__pyx_v_stype == DMSTAG_STENCIL_STAR) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_n_s_star);
__pyx_r = __pyx_n_s_star;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":96
* cdef inline object toStagStencil(PetscDMStagStencilType stype):
* if stype == DMSTAG_STENCIL_STAR: return "star"
* elif stype == DMSTAG_STENCIL_BOX: return "box" # <<<<<<<<<<<<<<
* elif stype == DMSTAG_STENCIL_NONE: return "none"
*
*/
__pyx_t_1 = ((__pyx_v_stype == DMSTAG_STENCIL_BOX) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_n_s_box);
__pyx_r = __pyx_n_s_box;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":97
* if stype == DMSTAG_STENCIL_STAR: return "star"
* elif stype == DMSTAG_STENCIL_BOX: return "box"
* elif stype == DMSTAG_STENCIL_NONE: return "none" # <<<<<<<<<<<<<<
*
* cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \
*/
__pyx_t_1 = ((__pyx_v_stype == DMSTAG_STENCIL_NONE) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_n_s_none);
__pyx_r = __pyx_n_s_none;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":94
* return stencil
*
* cdef inline object toStagStencil(PetscDMStagStencilType stype): # <<<<<<<<<<<<<<
* if stype == DMSTAG_STENCIL_STAR: return "star"
* elif stype == DMSTAG_STENCIL_BOX: return "box"
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmstag.pxi":99
* elif stype == DMSTAG_STENCIL_NONE: return "none"
*
* cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \ # <<<<<<<<<<<<<<
* except <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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
DMStagStencilLocation __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("asStagStencilLocation", 0);
/* "petsc4py/PETSc/petscdmstag.pxi":101
* 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 = PyString_Check(__pyx_v_stencil_location);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/petscdmstag.pxi":102
* 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_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_null, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 102, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_NULL_LOCATION;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":103
* if isinstance(stencil_location, str):
* if stencil_location == "null": return DMSTAG_NULL_LOCATION
* elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT # <<<<<<<<<<<<<<
* elif stencil_location == "back_down": return DMSTAG_BACK_DOWN
* elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_down_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 103, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_BACK_DOWN_LEFT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":104
* if stencil_location == "null": return DMSTAG_NULL_LOCATION
* elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT
* elif stencil_location == "back_down": return DMSTAG_BACK_DOWN # <<<<<<<<<<<<<<
* elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT
* elif stencil_location == "back_left": return DMSTAG_BACK_LEFT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_down, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 104, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_BACK_DOWN;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":105
* elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT
* elif stencil_location == "back_down": return DMSTAG_BACK_DOWN
* elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT # <<<<<<<<<<<<<<
* elif stencil_location == "back_left": return DMSTAG_BACK_LEFT
* elif stencil_location == "back": return DMSTAG_BACK
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_down_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 105, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_BACK_DOWN_RIGHT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":106
* elif stencil_location == "back_down": return DMSTAG_BACK_DOWN
* elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT
* elif stencil_location == "back_left": return DMSTAG_BACK_LEFT # <<<<<<<<<<<<<<
* elif stencil_location == "back": return DMSTAG_BACK
* elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 106, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_BACK_LEFT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":107
* elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT
* elif stencil_location == "back_left": return DMSTAG_BACK_LEFT
* elif stencil_location == "back": return DMSTAG_BACK # <<<<<<<<<<<<<<
* elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT
* elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 107, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_BACK;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":108
* elif stencil_location == "back_left": return DMSTAG_BACK_LEFT
* elif stencil_location == "back": return DMSTAG_BACK
* elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT # <<<<<<<<<<<<<<
* elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT
* elif stencil_location == "back_up": return DMSTAG_BACK_UP
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 108, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_BACK_RIGHT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":109
* elif stencil_location == "back": return DMSTAG_BACK
* elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT
* elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT # <<<<<<<<<<<<<<
* elif stencil_location == "back_up": return DMSTAG_BACK_UP
* elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_up_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 109, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_BACK_UP_LEFT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":110
* elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT
* elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT
* elif stencil_location == "back_up": return DMSTAG_BACK_UP # <<<<<<<<<<<<<<
* elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT
* elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_up, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 110, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_BACK_UP;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":111
* elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT
* elif stencil_location == "back_up": return DMSTAG_BACK_UP
* elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT # <<<<<<<<<<<<<<
* elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT
* elif stencil_location == "down": return DMSTAG_DOWN
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_up_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 111, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_BACK_UP_RIGHT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":112
* elif stencil_location == "back_up": return DMSTAG_BACK_UP
* elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT
* elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT # <<<<<<<<<<<<<<
* elif stencil_location == "down": return DMSTAG_DOWN
* elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_down_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 112, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_DOWN_LEFT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":113
* elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT
* elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT
* elif stencil_location == "down": return DMSTAG_DOWN # <<<<<<<<<<<<<<
* elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT
* elif stencil_location == "left": return DMSTAG_LEFT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_down, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 113, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_DOWN;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":114
* elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT
* elif stencil_location == "down": return DMSTAG_DOWN
* elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT # <<<<<<<<<<<<<<
* elif stencil_location == "left": return DMSTAG_LEFT
* elif stencil_location == "element": return DMSTAG_ELEMENT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_down_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 114, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_DOWN_RIGHT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":115
* elif stencil_location == "down": return DMSTAG_DOWN
* elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT
* elif stencil_location == "left": return DMSTAG_LEFT # <<<<<<<<<<<<<<
* elif stencil_location == "element": return DMSTAG_ELEMENT
* elif stencil_location == "right": return DMSTAG_RIGHT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 115, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_LEFT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":116
* elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT
* elif stencil_location == "left": return DMSTAG_LEFT
* elif stencil_location == "element": return DMSTAG_ELEMENT # <<<<<<<<<<<<<<
* elif stencil_location == "right": return DMSTAG_RIGHT
* elif stencil_location == "up_left": return DMSTAG_UP_LEFT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_element, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 116, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_ELEMENT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":117
* elif stencil_location == "left": return DMSTAG_LEFT
* elif stencil_location == "element": return DMSTAG_ELEMENT
* elif stencil_location == "right": return DMSTAG_RIGHT # <<<<<<<<<<<<<<
* elif stencil_location == "up_left": return DMSTAG_UP_LEFT
* elif stencil_location == "up": return DMSTAG_UP
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 117, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_RIGHT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":118
* elif stencil_location == "element": return DMSTAG_ELEMENT
* elif stencil_location == "right": return DMSTAG_RIGHT
* elif stencil_location == "up_left": return DMSTAG_UP_LEFT # <<<<<<<<<<<<<<
* elif stencil_location == "up": return DMSTAG_UP
* elif stencil_location == "up_right": return DMSTAG_UP_RIGHT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_up_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 118, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_UP_LEFT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":119
* elif stencil_location == "right": return DMSTAG_RIGHT
* elif stencil_location == "up_left": return DMSTAG_UP_LEFT
* elif stencil_location == "up": return DMSTAG_UP # <<<<<<<<<<<<<<
* elif stencil_location == "up_right": return DMSTAG_UP_RIGHT
* elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_up, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 119, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_UP;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":120
* elif stencil_location == "up_left": return DMSTAG_UP_LEFT
* elif stencil_location == "up": return DMSTAG_UP
* elif stencil_location == "up_right": return DMSTAG_UP_RIGHT # <<<<<<<<<<<<<<
* elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT
* elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_up_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 120, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_UP_RIGHT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":121
* elif stencil_location == "up": return DMSTAG_UP
* elif stencil_location == "up_right": return DMSTAG_UP_RIGHT
* elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT # <<<<<<<<<<<<<<
* elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN
* elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_down_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 121, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_FRONT_DOWN_LEFT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":122
* elif stencil_location == "up_right": return DMSTAG_UP_RIGHT
* elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT
* elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN # <<<<<<<<<<<<<<
* elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT
* elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_down, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 122, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_FRONT_DOWN;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":123
* elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT
* elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN
* elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT # <<<<<<<<<<<<<<
* elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT
* elif stencil_location == "front": return DMSTAG_FRONT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_down_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 123, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_FRONT_DOWN_RIGHT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":124
* elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN
* elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT
* elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT # <<<<<<<<<<<<<<
* elif stencil_location == "front": return DMSTAG_FRONT
* elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 124, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_FRONT_LEFT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":125
* elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT
* elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT
* elif stencil_location == "front": return DMSTAG_FRONT # <<<<<<<<<<<<<<
* elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT
* elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 125, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_FRONT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":126
* elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT
* elif stencil_location == "front": return DMSTAG_FRONT
* elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT # <<<<<<<<<<<<<<
* elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT
* elif stencil_location == "front_up": return DMSTAG_FRONT_UP
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 126, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_FRONT_RIGHT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":127
* elif stencil_location == "front": return DMSTAG_FRONT
* elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT
* elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT # <<<<<<<<<<<<<<
* elif stencil_location == "front_up": return DMSTAG_FRONT_UP
* elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_up_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 127, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_FRONT_UP_LEFT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":128
* elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT
* elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT
* elif stencil_location == "front_up": return DMSTAG_FRONT_UP # <<<<<<<<<<<<<<
* elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT
* else: raise ValueError("unknown stencil location type: %s" % stencil_location)
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_up, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 128, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_r = DMSTAG_FRONT_UP;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":129
* elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT
* elif stencil_location == "front_up": return DMSTAG_FRONT_UP
* elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT # <<<<<<<<<<<<<<
* else: raise ValueError("unknown stencil location type: %s" % stencil_location)
* return stencil_location
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_up_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(27, 129, __pyx_L1_error)
if (likely(__pyx_t_2)) {
__pyx_r = DMSTAG_FRONT_UP_RIGHT;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":130
* elif stencil_location == "front_up": return DMSTAG_FRONT_UP
* elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT
* else: raise ValueError("unknown stencil location type: %s" % stencil_location) # <<<<<<<<<<<<<<
* return stencil_location
*
*/
/*else*/ {
__pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_stencil_location_type_s, __pyx_v_stencil_location); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(27, 130, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscdmstag.pxi":101
* 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":131
* elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT
* else: raise ValueError("unknown stencil location type: %s" % stencil_location)
* return stencil_location # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_5 = ((DMStagStencilLocation)__Pyx_PyInt_As_DMStagStencilLocation(__pyx_v_stencil_location)); if (unlikely(PyErr_Occurred())) __PYX_ERR(27, 131, __pyx_L1_error)
__pyx_r = __pyx_t_5;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmstag.pxi":99
* 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_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":134
*
*
* cdef inline PetscInt asStagDims(dims, # <<<<<<<<<<<<<<
* PetscInt *_M,
* PetscInt *_N,
*/
static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asStagDims(PyObject *__pyx_v_dims, PetscInt *__pyx_v__M, PetscInt *__pyx_v__N, PetscInt *__pyx_v__P) {
PetscInt __pyx_v_dim;
PyObject *__pyx_v_M = 0;
PyObject *__pyx_v_N = 0;
PyObject *__pyx_v_P = 0;
PetscInt __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *(*__pyx_t_5)(PyObject *);
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PetscInt __pyx_t_8;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("asStagDims", 0);
__Pyx_INCREF(__pyx_v_dims);
/* "petsc4py/PETSc/petscdmstag.pxi":138
* PetscInt *_N,
* PetscInt *_P) except? -1:
* cdef PetscInt dim = PETSC_DECIDE # <<<<<<<<<<<<<<
* cdef object M=None, N=None, P=None
* dims = tuple(dims)
*/
__pyx_v_dim = PETSC_DECIDE;
/* "petsc4py/PETSc/petscdmstag.pxi":139
* PetscInt *_P) except? -1:
* cdef PetscInt dim = PETSC_DECIDE
* cdef object M=None, N=None, P=None # <<<<<<<<<<<<<<
* dims = tuple(dims)
* dim = <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":140
* 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(27, 140, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_dims, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":141
* cdef object M=None, N=None, P=None
* dims = tuple(dims)
* dim = <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(27, 141, __pyx_L1_error)
__pyx_v_dim = ((PetscInt)__pyx_t_2);
/* "petsc4py/PETSc/petscdmstag.pxi":142
* 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) != 0);
if (__pyx_t_3) {
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscdmstag.pxi":143
* 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) != 0);
if (__pyx_t_3) {
if ((likely(PyTuple_CheckExact(__pyx_v_dims))) || (PyList_CheckExact(__pyx_v_dims))) {
PyObject* sequence = __pyx_v_dims;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 1)) {
if (size > 1) __Pyx_RaiseTooManyValuesError(1);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(27, 143, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
}
__Pyx_INCREF(__pyx_t_1);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_4 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 1) < 0) __PYX_ERR(27, 143, __pyx_L1_error)
__pyx_t_5 = NULL;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L5_unpacking_done;
__pyx_L4_unpacking_failed:;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(27, 143, __pyx_L1_error)
__pyx_L5_unpacking_done:;
}
__Pyx_DECREF_SET(__pyx_v_M, __pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscdmstag.pxi":144
* if dim == 0: pass
* elif dim == 1: M, = dims
* elif dim == 2: M, N = dims # <<<<<<<<<<<<<<
* elif dim == 3: M, N, P = dims
* if dim >= 1: _M[0] = asInt(M)
*/
__pyx_t_3 = ((__pyx_v_dim == 2) != 0);
if (__pyx_t_3) {
if ((likely(PyTuple_CheckExact(__pyx_v_dims))) || (PyList_CheckExact(__pyx_v_dims))) {
PyObject* sequence = __pyx_v_dims;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(27, 144, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_4 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_4);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 144, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 144, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_6 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 144, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_6), 2) < 0) __PYX_ERR(27, 144, __pyx_L1_error)
__pyx_t_5 = NULL;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
goto __pyx_L7_unpacking_done;
__pyx_L6_unpacking_failed:;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_5 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(27, 144, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__Pyx_DECREF_SET(__pyx_v_M, __pyx_t_1);
__pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_N, __pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscdmstag.pxi":145
* elif dim == 1: M, = dims
* elif dim == 2: M, N = dims
* elif dim == 3: M, N, P = dims # <<<<<<<<<<<<<<
* if dim >= 1: _M[0] = asInt(M)
* if dim >= 2: _N[0] = asInt(N)
*/
__pyx_t_3 = ((__pyx_v_dim == 3) != 0);
if (__pyx_t_3) {
if ((likely(PyTuple_CheckExact(__pyx_v_dims))) || (PyList_CheckExact(__pyx_v_dims))) {
PyObject* sequence = __pyx_v_dims;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(27, 145, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 145, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 145, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 145, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 145, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_5 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_4 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_6 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_7), 3) < 0) __PYX_ERR(27, 145, __pyx_L1_error)
__pyx_t_5 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L9_unpacking_done;
__pyx_L8_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_5 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(27, 145, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__Pyx_DECREF_SET(__pyx_v_M, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_N, __pyx_t_1);
__pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_P, __pyx_t_6);
__pyx_t_6 = 0;
}
__pyx_L3:;
/* "petsc4py/PETSc/petscdmstag.pxi":146
* elif dim == 2: M, N = dims
* elif dim == 3: M, N, P = dims
* if dim >= 1: _M[0] = asInt(M) # <<<<<<<<<<<<<<
* if dim >= 2: _N[0] = asInt(N)
* if dim >= 3: _P[0] = asInt(P)
*/
__pyx_t_3 = ((__pyx_v_dim >= 1) != 0);
if (__pyx_t_3) {
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_M); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(27, 146, __pyx_L1_error)
(__pyx_v__M[0]) = __pyx_t_8;
}
/* "petsc4py/PETSc/petscdmstag.pxi":147
* elif dim == 3: M, N, P = dims
* if dim >= 1: _M[0] = asInt(M)
* if dim >= 2: _N[0] = asInt(N) # <<<<<<<<<<<<<<
* if dim >= 3: _P[0] = asInt(P)
* return dim
*/
__pyx_t_3 = ((__pyx_v_dim >= 2) != 0);
if (__pyx_t_3) {
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_N); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(27, 147, __pyx_L1_error)
(__pyx_v__N[0]) = __pyx_t_8;
}
/* "petsc4py/PETSc/petscdmstag.pxi":148
* if dim >= 1: _M[0] = asInt(M)
* if dim >= 2: _N[0] = asInt(N)
* if dim >= 3: _P[0] = asInt(P) # <<<<<<<<<<<<<<
* return dim
*
*/
__pyx_t_3 = ((__pyx_v_dim >= 3) != 0);
if (__pyx_t_3) {
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_P); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(27, 148, __pyx_L1_error)
(__pyx_v__P[0]) = __pyx_t_8;
}
/* "petsc4py/PETSc/petscdmstag.pxi":149
* if dim >= 2: _N[0] = asInt(N)
* if dim >= 3: _P[0] = asInt(P)
* return dim # <<<<<<<<<<<<<<
*
* cdef inline tuple toStagDims(PetscInt dim,
*/
__pyx_r = __pyx_v_dim;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmstag.pxi":134
*
*
* cdef inline PetscInt asStagDims(dims, # <<<<<<<<<<<<<<
* PetscInt *_M,
* PetscInt *_N,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.asStagDims", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1L;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_M);
__Pyx_XDECREF(__pyx_v_N);
__Pyx_XDECREF(__pyx_v_P);
__Pyx_XDECREF(__pyx_v_dims);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmstag.pxi":151
* return dim
*
* cdef inline tuple toStagDims(PetscInt dim, # <<<<<<<<<<<<<<
* PetscInt M,
* PetscInt N,
*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagDims(PetscInt __pyx_v_dim, PetscInt __pyx_v_M, PetscInt __pyx_v_N, PetscInt __pyx_v_P) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("toStagDims", 0);
/* "petsc4py/PETSc/petscdmstag.pxi":155
* PetscInt N,
* PetscInt P):
* if dim == 0: return () # <<<<<<<<<<<<<<
* elif dim == 1: return (toInt(M),)
* elif dim == 2: return (toInt(M), toInt(N))
*/
__pyx_t_1 = ((__pyx_v_dim == 0) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_empty_tuple);
__pyx_r = __pyx_empty_tuple;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":156
* PetscInt P):
* if dim == 0: return ()
* elif dim == 1: return (toInt(M),) # <<<<<<<<<<<<<<
* elif dim == 2: return (toInt(M), toInt(N))
* elif dim == 3: return (toInt(M), toInt(N), toInt(P))
*/
__pyx_t_1 = ((__pyx_v_dim == 1) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__pyx_t_2 = 0;
__pyx_r = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":157
* if dim == 0: return ()
* elif dim == 1: return (toInt(M),)
* elif dim == 2: return (toInt(M), toInt(N)) # <<<<<<<<<<<<<<
* elif dim == 3: return (toInt(M), toInt(N), toInt(P))
*
*/
__pyx_t_1 = ((__pyx_v_dim == 2) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__pyx_t_3 = 0;
__pyx_t_2 = 0;
__pyx_r = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":158
* elif dim == 1: return (toInt(M),)
* elif dim == 2: return (toInt(M), toInt(N))
* elif dim == 3: return (toInt(M), toInt(N), toInt(P)) # <<<<<<<<<<<<<<
*
* cdef inline PetscInt asDofs(dofs,
*/
__pyx_t_1 = ((__pyx_v_dim == 3) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_P); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
__pyx_t_4 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":151
* return dim
*
* cdef inline tuple toStagDims(PetscInt dim, # <<<<<<<<<<<<<<
* PetscInt M,
* PetscInt N,
*/
/* function exit code */
__pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.toStagDims", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmstag.pxi":160
* elif dim == 3: return (toInt(M), toInt(N), toInt(P))
*
* cdef inline PetscInt asDofs(dofs, # <<<<<<<<<<<<<<
* PetscInt *_dof0,
* PetscInt *_dof1,
*/
static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asDofs(PyObject *__pyx_v_dofs, PetscInt *__pyx_v__dof0, PetscInt *__pyx_v__dof1, PetscInt *__pyx_v__dof2, PetscInt *__pyx_v__dof3) {
PetscInt __pyx_v_ndofs;
PyObject *__pyx_v_dof0 = 0;
PyObject *__pyx_v_dof1 = 0;
PyObject *__pyx_v_dof2 = 0;
PyObject *__pyx_v_dof3 = 0;
PetscInt __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *(*__pyx_t_6)(PyObject *);
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PetscInt __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("asDofs", 0);
__Pyx_INCREF(__pyx_v_dofs);
/* "petsc4py/PETSc/petscdmstag.pxi":165
* PetscInt *_dof2,
* PetscInt *_dof3) except? -1:
* cdef PetscInt ndofs = PETSC_DECIDE # <<<<<<<<<<<<<<
* cdef object dof0=None, dof1=None, dof2=None, dof3=None
* dofs = tuple(dofs)
*/
__pyx_v_ndofs = PETSC_DECIDE;
/* "petsc4py/PETSc/petscdmstag.pxi":166
* PetscInt *_dof3) except? -1:
* cdef PetscInt ndofs = PETSC_DECIDE
* cdef object dof0=None, dof1=None, dof2=None, dof3=None # <<<<<<<<<<<<<<
* dofs = tuple(dofs)
* ndofs = <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":167
* 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(27, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_dofs, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":168
* cdef object dof0=None, dof1=None, dof2=None, dof3=None
* dofs = tuple(dofs)
* ndofs = <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(27, 168, __pyx_L1_error)
__pyx_v_ndofs = ((PetscInt)__pyx_t_2);
/* "petsc4py/PETSc/petscdmstag.pxi":169
* 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) != 0);
if (__pyx_t_3) {
if ((likely(PyTuple_CheckExact(__pyx_v_dofs))) || (PyList_CheckExact(__pyx_v_dofs))) {
PyObject* sequence = __pyx_v_dofs;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(27, 169, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_4 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_4);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 169, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 169, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_5 = PyObject_GetIter(__pyx_v_dofs); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 169, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(27, 169, __pyx_L1_error)
__pyx_t_6 = NULL;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L5_unpacking_done;
__pyx_L4_unpacking_failed:;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(27, 169, __pyx_L1_error)
__pyx_L5_unpacking_done:;
}
__Pyx_DECREF_SET(__pyx_v_dof0, __pyx_t_1);
__pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_dof1, __pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscdmstag.pxi":170
* ndofs = <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) != 0);
if (__pyx_t_3) {
if ((likely(PyTuple_CheckExact(__pyx_v_dofs))) || (PyList_CheckExact(__pyx_v_dofs))) {
PyObject* sequence = __pyx_v_dofs;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(27, 170, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_5 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
#else
__pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_dofs); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_5 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_7), 3) < 0) __PYX_ERR(27, 170, __pyx_L1_error)
__pyx_t_6 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L7_unpacking_done;
__pyx_L6_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_6 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(27, 170, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__Pyx_DECREF_SET(__pyx_v_dof0, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_dof1, __pyx_t_1);
__pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_dof2, __pyx_t_5);
__pyx_t_5 = 0;
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscdmstag.pxi":171
* if ndofs == 2: dof0, dof1 = dofs
* elif ndofs == 3: dof0, dof1, dof2 = dofs
* elif ndofs == 4: dof0, dof1, dof2, dof3 = dofs # <<<<<<<<<<<<<<
* if ndofs >= 2: _dof0[0] = asInt(dof0)
* if ndofs >= 2: _dof1[0] = asInt(dof1)
*/
__pyx_t_3 = ((__pyx_v_ndofs == 4) != 0);
if (__pyx_t_3) {
if ((likely(PyTuple_CheckExact(__pyx_v_dofs))) || (PyList_CheckExact(__pyx_v_dofs))) {
PyObject* sequence = __pyx_v_dofs;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 4)) {
if (size > 4) __Pyx_RaiseTooManyValuesError(4);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(27, 171, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 3);
} else {
__pyx_t_5 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_4 = PyList_GET_ITEM(sequence, 2);
__pyx_t_7 = PyList_GET_ITEM(sequence, 3);
}
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_7);
#else
{
Py_ssize_t i;
PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_1,&__pyx_t_4,&__pyx_t_7};
for (i=0; i < 4; i++) {
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(27, 171, __pyx_L1_error)
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
}
#endif
} else {
Py_ssize_t index = -1;
PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_1,&__pyx_t_4,&__pyx_t_7};
__pyx_t_8 = PyObject_GetIter(__pyx_v_dofs); if (unlikely(!__pyx_t_8)) __PYX_ERR(27, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_6 = Py_TYPE(__pyx_t_8)->tp_iternext;
for (index=0; index < 4; index++) {
PyObject* item = __pyx_t_6(__pyx_t_8); if (unlikely(!item)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_8), 4) < 0) __PYX_ERR(27, 171, __pyx_L1_error)
__pyx_t_6 = NULL;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L9_unpacking_done;
__pyx_L8_unpacking_failed:;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_6 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(27, 171, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__Pyx_DECREF_SET(__pyx_v_dof0, __pyx_t_5);
__pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_dof1, __pyx_t_1);
__pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_dof2, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_dof3, __pyx_t_7);
__pyx_t_7 = 0;
}
__pyx_L3:;
/* "petsc4py/PETSc/petscdmstag.pxi":172
* elif ndofs == 3: dof0, dof1, dof2 = dofs
* elif ndofs == 4: dof0, dof1, dof2, dof3 = dofs
* if ndofs >= 2: _dof0[0] = asInt(dof0) # <<<<<<<<<<<<<<
* if ndofs >= 2: _dof1[0] = asInt(dof1)
* if ndofs >= 3: _dof2[0] = asInt(dof2)
*/
__pyx_t_3 = ((__pyx_v_ndofs >= 2) != 0);
if (__pyx_t_3) {
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof0); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(27, 172, __pyx_L1_error)
(__pyx_v__dof0[0]) = __pyx_t_9;
}
/* "petsc4py/PETSc/petscdmstag.pxi":173
* elif ndofs == 4: dof0, dof1, dof2, dof3 = dofs
* if ndofs >= 2: _dof0[0] = asInt(dof0)
* if ndofs >= 2: _dof1[0] = asInt(dof1) # <<<<<<<<<<<<<<
* if ndofs >= 3: _dof2[0] = asInt(dof2)
* if ndofs >= 4: _dof3[0] = asInt(dof3)
*/
__pyx_t_3 = ((__pyx_v_ndofs >= 2) != 0);
if (__pyx_t_3) {
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof1); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(27, 173, __pyx_L1_error)
(__pyx_v__dof1[0]) = __pyx_t_9;
}
/* "petsc4py/PETSc/petscdmstag.pxi":174
* if ndofs >= 2: _dof0[0] = asInt(dof0)
* if ndofs >= 2: _dof1[0] = asInt(dof1)
* if ndofs >= 3: _dof2[0] = asInt(dof2) # <<<<<<<<<<<<<<
* if ndofs >= 4: _dof3[0] = asInt(dof3)
* return ndofs
*/
__pyx_t_3 = ((__pyx_v_ndofs >= 3) != 0);
if (__pyx_t_3) {
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof2); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(27, 174, __pyx_L1_error)
(__pyx_v__dof2[0]) = __pyx_t_9;
}
/* "petsc4py/PETSc/petscdmstag.pxi":175
* if ndofs >= 2: _dof1[0] = asInt(dof1)
* if ndofs >= 3: _dof2[0] = asInt(dof2)
* if ndofs >= 4: _dof3[0] = asInt(dof3) # <<<<<<<<<<<<<<
* return ndofs
*
*/
__pyx_t_3 = ((__pyx_v_ndofs >= 4) != 0);
if (__pyx_t_3) {
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof3); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(27, 175, __pyx_L1_error)
(__pyx_v__dof3[0]) = __pyx_t_9;
}
/* "petsc4py/PETSc/petscdmstag.pxi":176
* if ndofs >= 3: _dof2[0] = asInt(dof2)
* if ndofs >= 4: _dof3[0] = asInt(dof3)
* return ndofs # <<<<<<<<<<<<<<
*
* cdef inline tuple toDofs(PetscInt ndofs,
*/
__pyx_r = __pyx_v_ndofs;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmstag.pxi":160
* elif dim == 3: return (toInt(M), toInt(N), toInt(P))
*
* cdef inline PetscInt asDofs(dofs, # <<<<<<<<<<<<<<
* PetscInt *_dof0,
* PetscInt *_dof1,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("petsc4py.PETSc.asDofs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1L;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dof0);
__Pyx_XDECREF(__pyx_v_dof1);
__Pyx_XDECREF(__pyx_v_dof2);
__Pyx_XDECREF(__pyx_v_dof3);
__Pyx_XDECREF(__pyx_v_dofs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmstag.pxi":178
* return ndofs
*
* cdef inline tuple toDofs(PetscInt ndofs, # <<<<<<<<<<<<<<
* PetscInt dof0,
* PetscInt dof1,
*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toDofs(PetscInt __pyx_v_ndofs, PetscInt __pyx_v_dof0, PetscInt __pyx_v_dof1, PetscInt __pyx_v_dof2, PetscInt __pyx_v_dof3) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("toDofs", 0);
/* "petsc4py/PETSc/petscdmstag.pxi":183
* PetscInt dof2,
* PetscInt dof3):
* if ndofs == 2: return (toInt(dof0), toInt(dof1)) # <<<<<<<<<<<<<<
* elif ndofs == 3: return (toInt(dof0), toInt(dof1), toInt(dof2))
* elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3))
*/
__pyx_t_1 = ((__pyx_v_ndofs == 2) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof0); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 183, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 183, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 183, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":184
* PetscInt dof3):
* if ndofs == 2: return (toInt(dof0), toInt(dof1))
* elif ndofs == 3: return (toInt(dof0), toInt(dof1), toInt(dof2)) # <<<<<<<<<<<<<<
* elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3))
*
*/
__pyx_t_1 = ((__pyx_v_ndofs == 3) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof0); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof2); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
__pyx_t_4 = 0;
__pyx_t_3 = 0;
__pyx_t_2 = 0;
__pyx_r = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":185
* if ndofs == 2: return (toInt(dof0), toInt(dof1))
* elif ndofs == 3: return (toInt(dof0), toInt(dof1), toInt(dof2))
* elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3)) # <<<<<<<<<<<<<<
*
* cdef inline tuple asStagOwnershipRanges(object ownership_ranges,
*/
__pyx_t_1 = ((__pyx_v_ndofs == 4) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof0); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof1); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof2); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof3); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 185, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4);
__pyx_t_5 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_r = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":178
* return ndofs
*
* cdef inline tuple toDofs(PetscInt ndofs, # <<<<<<<<<<<<<<
* PetscInt dof0,
* PetscInt dof1,
*/
/* function exit code */
__pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("petsc4py.PETSc.toDofs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmstag.pxi":187
* elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3))
*
* cdef inline tuple asStagOwnershipRanges(object ownership_ranges, # <<<<<<<<<<<<<<
* PetscInt dim,
* PetscInt *m, PetscInt *n, PetscInt *p,
*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_asStagOwnershipRanges(PyObject *__pyx_v_ownership_ranges, PetscInt __pyx_v_dim, PetscInt *__pyx_v_m, PetscInt *__pyx_v_n, PetscInt *__pyx_v_p, PetscInt **__pyx_v__x, PetscInt **__pyx_v__y, PetscInt **__pyx_v__z) {
PyObject *__pyx_v_ranges = 0;
PetscInt __pyx_v_rdim;
PetscInt __pyx_v_nlx;
PetscInt __pyx_v_nly;
PetscInt __pyx_v_nlz;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("asStagOwnershipRanges", 0);
/* "petsc4py/PETSc/petscdmstag.pxi":193
* 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(27, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ranges = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":194
* PetscInt **_z):
* cdef object ranges = list(ownership_ranges)
* cdef PetscInt rdim = <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(27, 194, __pyx_L1_error)
__pyx_v_rdim = ((PetscInt)__pyx_t_2);
/* "petsc4py/PETSc/petscdmstag.pxi":195
* cdef object ranges = list(ownership_ranges)
* cdef PetscInt rdim = <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":196
* 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) != 0);
if (__pyx_t_3) {
__pyx_v_dim = __pyx_v_rdim;
goto __pyx_L3;
}
/* "petsc4py/PETSc/petscdmstag.pxi":197
* cdef PetscInt nlx=0, nly=0, nlz=0
* if dim == PETSC_DECIDE: dim = rdim
* elif dim != rdim: raise ValueError( # <<<<<<<<<<<<<<
* "number of dimensions %d and number ownership ranges %d" %
* (toInt(dim), toInt(rdim)))
*/
__pyx_t_3 = ((__pyx_v_dim != __pyx_v_rdim) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscdmstag.pxi":199
* elif dim != rdim: raise ValueError(
* "number of dimensions %d and number ownership ranges %d" %
* (toInt(dim), toInt(rdim))) # <<<<<<<<<<<<<<
* if dim >= 1:
* ranges[0] = iarray_i(ranges[0], &nlx, _x)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_rdim); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
__pyx_t_1 = 0;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":198
* if dim == PETSC_DECIDE: dim = rdim
* elif dim != rdim: raise ValueError(
* "number of dimensions %d and number ownership ranges %d" % # <<<<<<<<<<<<<<
* (toInt(dim), toInt(rdim)))
* if dim >= 1:
*/
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_number_of_dimensions_d_and_numbe, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":197
* cdef PetscInt nlx=0, nly=0, nlz=0
* if dim == PETSC_DECIDE: dim = rdim
* elif dim != rdim: raise ValueError( # <<<<<<<<<<<<<<
* "number of dimensions %d and number ownership ranges %d" %
* (toInt(dim), toInt(rdim)))
*/
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(27, 197, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/petscdmstag.pxi":200
* "number of dimensions %d and number ownership ranges %d" %
* (toInt(dim), toInt(rdim)))
* if dim >= 1: # <<<<<<<<<<<<<<
* ranges[0] = iarray_i(ranges[0], &nlx, _x)
* if m[0] == PETSC_DECIDE: m[0] = nlx
*/
__pyx_t_3 = ((__pyx_v_dim >= 1) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscdmstag.pxi":201
* (toInt(dim), toInt(rdim)))
* if dim >= 1:
* ranges[0] = iarray_i(ranges[0], &nlx, _x) # <<<<<<<<<<<<<<
* if m[0] == PETSC_DECIDE: m[0] = nlx
* elif m[0] != nlx: raise ValueError(
*/
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ranges, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_5, (&__pyx_v_nlx), __pyx_v__x)); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(__Pyx_SetItemInt(__pyx_v_ranges, 0, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(27, 201, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":202
* if dim >= 1:
* ranges[0] = iarray_i(ranges[0], &nlx, _x)
* if m[0] == PETSC_DECIDE: m[0] = nlx # <<<<<<<<<<<<<<
* elif m[0] != nlx: raise ValueError(
* "ownership range size %d and number or processors %d" %
*/
__pyx_t_3 = (((__pyx_v_m[0]) == PETSC_DECIDE) != 0);
if (__pyx_t_3) {
(__pyx_v_m[0]) = __pyx_v_nlx;
goto __pyx_L5;
}
/* "petsc4py/PETSc/petscdmstag.pxi":203
* ranges[0] = iarray_i(ranges[0], &nlx, _x)
* if m[0] == PETSC_DECIDE: m[0] = nlx
* elif m[0] != nlx: raise ValueError( # <<<<<<<<<<<<<<
* "ownership range size %d and number or processors %d" %
* (toInt(nlx), toInt(m[0])))
*/
__pyx_t_3 = (((__pyx_v_m[0]) != __pyx_v_nlx) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscdmstag.pxi":205
* elif m[0] != nlx: raise ValueError(
* "ownership range size %d and number or processors %d" %
* (toInt(nlx), toInt(m[0]))) # <<<<<<<<<<<<<<
* if dim >= 2:
* ranges[1] = iarray_i(ranges[1], &nly, _y)
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nlx); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
__pyx_t_4 = 0;
__pyx_t_5 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":204
* if m[0] == PETSC_DECIDE: m[0] = nlx
* elif m[0] != nlx: raise ValueError(
* "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<<
* (toInt(nlx), toInt(m[0])))
* if dim >= 2:
*/
__pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 204, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":203
* ranges[0] = iarray_i(ranges[0], &nlx, _x)
* if m[0] == PETSC_DECIDE: m[0] = nlx
* elif m[0] != nlx: raise ValueError( # <<<<<<<<<<<<<<
* "ownership range size %d and number or processors %d" %
* (toInt(nlx), toInt(m[0])))
*/
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(27, 203, __pyx_L1_error)
}
__pyx_L5:;
/* "petsc4py/PETSc/petscdmstag.pxi":200
* "number of dimensions %d and number ownership ranges %d" %
* (toInt(dim), toInt(rdim)))
* if dim >= 1: # <<<<<<<<<<<<<<
* ranges[0] = iarray_i(ranges[0], &nlx, _x)
* if m[0] == PETSC_DECIDE: m[0] = nlx
*/
}
/* "petsc4py/PETSc/petscdmstag.pxi":206
* "ownership range size %d and number or processors %d" %
* (toInt(nlx), toInt(m[0])))
* if dim >= 2: # <<<<<<<<<<<<<<
* ranges[1] = iarray_i(ranges[1], &nly, _y)
* if n[0] == PETSC_DECIDE: n[0] = nly
*/
__pyx_t_3 = ((__pyx_v_dim >= 2) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscdmstag.pxi":207
* (toInt(nlx), toInt(m[0])))
* if dim >= 2:
* ranges[1] = iarray_i(ranges[1], &nly, _y) # <<<<<<<<<<<<<<
* if n[0] == PETSC_DECIDE: n[0] = nly
* elif n[0] != nly: raise ValueError(
*/
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ranges, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_1, (&__pyx_v_nly), __pyx_v__y)); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__Pyx_SetItemInt(__pyx_v_ranges, 1, __pyx_t_5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(27, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":208
* if dim >= 2:
* ranges[1] = iarray_i(ranges[1], &nly, _y)
* if n[0] == PETSC_DECIDE: n[0] = nly # <<<<<<<<<<<<<<
* elif n[0] != nly: raise ValueError(
* "ownership range size %d and number or processors %d" %
*/
__pyx_t_3 = (((__pyx_v_n[0]) == PETSC_DECIDE) != 0);
if (__pyx_t_3) {
(__pyx_v_n[0]) = __pyx_v_nly;
goto __pyx_L7;
}
/* "petsc4py/PETSc/petscdmstag.pxi":209
* ranges[1] = iarray_i(ranges[1], &nly, _y)
* if n[0] == PETSC_DECIDE: n[0] = nly
* elif n[0] != nly: raise ValueError( # <<<<<<<<<<<<<<
* "ownership range size %d and number or processors %d" %
* (toInt(nly), toInt(n[0])))
*/
__pyx_t_3 = (((__pyx_v_n[0]) != __pyx_v_nly) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscdmstag.pxi":211
* elif n[0] != nly: raise ValueError(
* "ownership range size %d and number or processors %d" %
* (toInt(nly), toInt(n[0]))) # <<<<<<<<<<<<<<
* if dim >= 3:
* ranges[2] = iarray_i(ranges[2], &nlz, _z)
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nly); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_n[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
__pyx_t_5 = 0;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":210
* if n[0] == PETSC_DECIDE: n[0] = nly
* elif n[0] != nly: raise ValueError(
* "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<<
* (toInt(nly), toInt(n[0])))
* if dim >= 3:
*/
__pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 210, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":209
* ranges[1] = iarray_i(ranges[1], &nly, _y)
* if n[0] == PETSC_DECIDE: n[0] = nly
* elif n[0] != nly: raise ValueError( # <<<<<<<<<<<<<<
* "ownership range size %d and number or processors %d" %
* (toInt(nly), toInt(n[0])))
*/
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 209, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(27, 209, __pyx_L1_error)
}
__pyx_L7:;
/* "petsc4py/PETSc/petscdmstag.pxi":206
* "ownership range size %d and number or processors %d" %
* (toInt(nlx), toInt(m[0])))
* if dim >= 2: # <<<<<<<<<<<<<<
* ranges[1] = iarray_i(ranges[1], &nly, _y)
* if n[0] == PETSC_DECIDE: n[0] = nly
*/
}
/* "petsc4py/PETSc/petscdmstag.pxi":212
* "ownership range size %d and number or processors %d" %
* (toInt(nly), toInt(n[0])))
* if dim >= 3: # <<<<<<<<<<<<<<
* ranges[2] = iarray_i(ranges[2], &nlz, _z)
* if p[0] == PETSC_DECIDE: p[0] = nlz
*/
__pyx_t_3 = ((__pyx_v_dim >= 3) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscdmstag.pxi":213
* (toInt(nly), toInt(n[0])))
* if dim >= 3:
* ranges[2] = iarray_i(ranges[2], &nlz, _z) # <<<<<<<<<<<<<<
* if p[0] == PETSC_DECIDE: p[0] = nlz
* elif p[0] != nlz: raise ValueError(
*/
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ranges, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_4, (&__pyx_v_nlz), __pyx_v__z)); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(__Pyx_SetItemInt(__pyx_v_ranges, 2, __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(27, 213, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":214
* if dim >= 3:
* ranges[2] = iarray_i(ranges[2], &nlz, _z)
* if p[0] == PETSC_DECIDE: p[0] = nlz # <<<<<<<<<<<<<<
* elif p[0] != nlz: raise ValueError(
* "ownership range size %d and number or processors %d" %
*/
__pyx_t_3 = (((__pyx_v_p[0]) == PETSC_DECIDE) != 0);
if (__pyx_t_3) {
(__pyx_v_p[0]) = __pyx_v_nlz;
goto __pyx_L9;
}
/* "petsc4py/PETSc/petscdmstag.pxi":215
* ranges[2] = iarray_i(ranges[2], &nlz, _z)
* if p[0] == PETSC_DECIDE: p[0] = nlz
* elif p[0] != nlz: raise ValueError( # <<<<<<<<<<<<<<
* "ownership range size %d and number or processors %d" %
* (toInt(nlz), toInt(p[0])))
*/
__pyx_t_3 = (((__pyx_v_p[0]) != __pyx_v_nlz) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/petscdmstag.pxi":217
* elif p[0] != nlz: raise ValueError(
* "ownership range size %d and number or processors %d" %
* (toInt(nlz), toInt(p[0]))) # <<<<<<<<<<<<<<
* return tuple(ranges)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nlz); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_p[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
__pyx_t_1 = 0;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":216
* if p[0] == PETSC_DECIDE: p[0] = nlz
* elif p[0] != nlz: raise ValueError(
* "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<<
* (toInt(nlz), toInt(p[0])))
* return tuple(ranges)
*/
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":215
* ranges[2] = iarray_i(ranges[2], &nlz, _z)
* if p[0] == PETSC_DECIDE: p[0] = nlz
* elif p[0] != nlz: raise ValueError( # <<<<<<<<<<<<<<
* "ownership range size %d and number or processors %d" %
* (toInt(nlz), toInt(p[0])))
*/
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(27, 215, __pyx_L1_error)
}
__pyx_L9:;
/* "petsc4py/PETSc/petscdmstag.pxi":212
* "ownership range size %d and number or processors %d" %
* (toInt(nly), toInt(n[0])))
* if dim >= 3: # <<<<<<<<<<<<<<
* ranges[2] = iarray_i(ranges[2], &nlz, _z)
* if p[0] == PETSC_DECIDE: p[0] = nlz
*/
}
/* "petsc4py/PETSc/petscdmstag.pxi":218
* "ownership range size %d and number or processors %d" %
* (toInt(nlz), toInt(p[0])))
* return tuple(ranges) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_ranges); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmstag.pxi":187
* elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3))
*
* cdef inline tuple asStagOwnershipRanges(object ownership_ranges, # <<<<<<<<<<<<<<
* PetscInt dim,
* PetscInt *m, PetscInt *n, PetscInt *p,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.asStagOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_ranges);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmstag.pxi":221
*
*
* cdef inline tuple toStagOwnershipRanges(PetscInt dim, # <<<<<<<<<<<<<<
* PetscInt m, PetscInt n, PetscInt p,
* const PetscInt *lx,
*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagOwnershipRanges(PetscInt __pyx_v_dim, PetscInt __pyx_v_m, PetscInt __pyx_v_n, PetscInt __pyx_v_p, PetscInt const *__pyx_v_lx, PetscInt const *__pyx_v_ly, PetscInt const *__pyx_v_lz) {
PyObject *__pyx_v_ranges = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("toStagOwnershipRanges", 0);
/* "petsc4py/PETSc/petscdmstag.pxi":227
* const PetscInt *lz):
* # Returns tuple of arrays containing ownership ranges as Python arrays
* ranges = [array_i(m, lx)] # <<<<<<<<<<<<<<
* if dim > 1:
* ranges.append(array_i(n, ly))
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_m, __pyx_v_lx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 227, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 227, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__pyx_t_1 = 0;
__pyx_v_ranges = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":228
* # Returns tuple of arrays containing ownership ranges as Python arrays
* ranges = [array_i(m, lx)]
* if dim > 1: # <<<<<<<<<<<<<<
* ranges.append(array_i(n, ly))
* if dim > 2:
*/
__pyx_t_3 = ((__pyx_v_dim > 1) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscdmstag.pxi":229
* ranges = [array_i(m, lx)]
* if dim > 1:
* ranges.append(array_i(n, ly)) # <<<<<<<<<<<<<<
* if dim > 2:
* ranges.append(array_i(p, lz))
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_n, __pyx_v_ly)); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyList_Append(__pyx_v_ranges, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(27, 229, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":228
* # Returns tuple of arrays containing ownership ranges as Python arrays
* ranges = [array_i(m, lx)]
* if dim > 1: # <<<<<<<<<<<<<<
* ranges.append(array_i(n, ly))
* if dim > 2:
*/
}
/* "petsc4py/PETSc/petscdmstag.pxi":230
* if dim > 1:
* ranges.append(array_i(n, ly))
* if dim > 2: # <<<<<<<<<<<<<<
* ranges.append(array_i(p, lz))
* return tuple(ranges)
*/
__pyx_t_3 = ((__pyx_v_dim > 2) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscdmstag.pxi":231
* ranges.append(array_i(n, ly))
* if dim > 2:
* ranges.append(array_i(p, lz)) # <<<<<<<<<<<<<<
* return tuple(ranges)
*
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_p, __pyx_v_lz)); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 231, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyList_Append(__pyx_v_ranges, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(27, 231, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmstag.pxi":230
* if dim > 1:
* ranges.append(array_i(n, ly))
* if dim > 2: # <<<<<<<<<<<<<<
* ranges.append(array_i(p, lz))
* return tuple(ranges)
*/
}
/* "petsc4py/PETSc/petscdmstag.pxi":232
* if dim > 2:
* ranges.append(array_i(p, lz))
* return tuple(ranges) # <<<<<<<<<<<<<<
*
* cdef inline object toStagBoundary(PetscDMBoundaryType btype):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = PyList_AsTuple(__pyx_v_ranges); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 232, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmstag.pxi":221
*
*
* cdef inline tuple toStagOwnershipRanges(PetscInt dim, # <<<<<<<<<<<<<<
* PetscInt m, PetscInt n, PetscInt p,
* const PetscInt *lx,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.toStagOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_ranges);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmstag.pxi":234
* return tuple(ranges)
*
* cdef inline object toStagBoundary(PetscDMBoundaryType btype): # <<<<<<<<<<<<<<
* if btype == DM_BOUNDARY_NONE: return "none"
* elif btype == DM_BOUNDARY_PERIODIC: return "periodic"
*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagBoundary(DMBoundaryType __pyx_v_btype) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("toStagBoundary", 0);
/* "petsc4py/PETSc/petscdmstag.pxi":235
*
* cdef inline object toStagBoundary(PetscDMBoundaryType btype):
* if btype == DM_BOUNDARY_NONE: return "none" # <<<<<<<<<<<<<<
* elif btype == DM_BOUNDARY_PERIODIC: return "periodic"
* elif btype == DM_BOUNDARY_GHOSTED: return "ghosted"
*/
__pyx_t_1 = ((__pyx_v_btype == DM_BOUNDARY_NONE) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_n_s_none);
__pyx_r = __pyx_n_s_none;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":236
* cdef inline object toStagBoundary(PetscDMBoundaryType btype):
* if btype == DM_BOUNDARY_NONE: return "none"
* elif btype == DM_BOUNDARY_PERIODIC: return "periodic" # <<<<<<<<<<<<<<
* elif btype == DM_BOUNDARY_GHOSTED: return "ghosted"
*
*/
__pyx_t_1 = ((__pyx_v_btype == DM_BOUNDARY_PERIODIC) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_n_s_periodic);
__pyx_r = __pyx_n_s_periodic;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":237
* if btype == DM_BOUNDARY_NONE: return "none"
* elif btype == DM_BOUNDARY_PERIODIC: return "periodic"
* elif btype == DM_BOUNDARY_GHOSTED: return "ghosted" # <<<<<<<<<<<<<<
*
* cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz):
*/
__pyx_t_1 = ((__pyx_v_btype == DM_BOUNDARY_GHOSTED) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_n_s_ghosted);
__pyx_r = __pyx_n_s_ghosted;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":234
* return tuple(ranges)
*
* cdef inline object toStagBoundary(PetscDMBoundaryType btype): # <<<<<<<<<<<<<<
* if btype == DM_BOUNDARY_NONE: return "none"
* elif btype == DM_BOUNDARY_PERIODIC: return "periodic"
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmstag.pxi":239
* elif btype == DM_BOUNDARY_GHOSTED: return "ghosted"
*
* cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz): # <<<<<<<<<<<<<<
* if dim == 1: return (toStagBoundary(btx), )
* if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty))
*/
static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagBoundaryTypes(PetscInt __pyx_v_dim, DMBoundaryType __pyx_v_btx, DMBoundaryType __pyx_v_bty, DMBoundaryType __pyx_v_btz) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("toStagBoundaryTypes", 0);
/* "petsc4py/PETSc/petscdmstag.pxi":240
*
* cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz):
* if dim == 1: return (toStagBoundary(btx), ) # <<<<<<<<<<<<<<
* if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty))
* if dim == 3: return (toStagBoundary(btx), toStagBoundary(bty), toStagBoundary(btz))
*/
__pyx_t_1 = ((__pyx_v_dim == 1) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_btx); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 240, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 240, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__pyx_t_2 = 0;
__pyx_r = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":241
* cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz):
* if dim == 1: return (toStagBoundary(btx), )
* if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty)) # <<<<<<<<<<<<<<
* if dim == 3: return (toStagBoundary(btx), toStagBoundary(bty), toStagBoundary(btz))
*
*/
__pyx_t_1 = ((__pyx_v_dim == 2) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_btx); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 241, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_bty); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 241, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 241, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__pyx_t_3 = 0;
__pyx_t_2 = 0;
__pyx_r = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":242
* if dim == 1: return (toStagBoundary(btx), )
* if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty))
* if dim == 3: return (toStagBoundary(btx), toStagBoundary(bty), toStagBoundary(btz)) # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__pyx_t_1 = ((__pyx_v_dim == 3) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_btx); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_bty); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_btz); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
__pyx_t_4 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/petscdmstag.pxi":239
* elif btype == DM_BOUNDARY_GHOSTED: return "ghosted"
*
* cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz): # <<<<<<<<<<<<<<
* if dim == 1: return (toStagBoundary(btx), )
* if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty))
*/
/* function exit code */
__pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.toStagBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmcomposite.pxi":27
* cdef object access
*
* def __cinit__(self, DM dm, Vec gvec, locs=None): # <<<<<<<<<<<<<<
* self.dm = dm.dm
* CHKERR( PetscINCREF(<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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,&__pyx_n_s_gvec,&__pyx_n_s_locs,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gvec)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(28, 27, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_locs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(28, 27, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_dm = ((struct PyPetscDMObject *)values[0]);
__pyx_v_gvec = ((struct PyPetscVecObject *)values[1]);
__pyx_v_locs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 27, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc._DMComposite_access.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(28, 27, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(28, 27, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access___cinit__(((struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)__pyx_v_self), __pyx_v_dm, __pyx_v_gvec, __pyx_v_locs);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
__pyx_L0:;
__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;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__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(28, 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(28, 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);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
/* "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(28, 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_6 = __Pyx_PyInt_From_long(((long)__pyx_v_self->nlocs)); if (unlikely(!__pyx_t_6)) __PYX_ERR(28, 34, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_int_0, __pyx_t_6, __pyx_int_1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(28, 34, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF_SET(__pyx_v_locs, __pyx_t_7);
__pyx_t_7 = 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_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_locs, (&__pyx_v_self->nlocs), (&__pyx_v_self->locs))); if (unlikely(!__pyx_t_7)) __PYX_ERR(28, 35, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_v_self->locs_mem);
__Pyx_DECREF(__pyx_v_self->locs_mem);
__pyx_v_self->locs_mem = __pyx_t_7;
__pyx_t_7 = 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_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_self->nlocs)); if (unlikely(!__pyx_t_7)) __PYX_ERR(28, 36, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_7, NULL, ((void **)(&__pyx_v_self->vecs)))); if (unlikely(!__pyx_t_6)) __PYX_ERR(28, 36, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GIVEREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_v_self->vecs_mem);
__Pyx_DECREF(__pyx_v_self->vecs_mem);
__pyx_v_self->vecs_mem = __pyx_t_6;
__pyx_t_6 = 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_6);
__Pyx_XDECREF(__pyx_t_7);
__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) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__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) {
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__dealloc__", 0);
/* "petsc4py/PETSc/petscdmcomposite.pxi":40
*
* def __dealloc__(self):
* CHKERR( DMDestroy(&self.dm) ) # <<<<<<<<<<<<<<
* CHKERR( VecDestroy(&self.gvec) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDestroy((&__pyx_v_self->dm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 40, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmcomposite.pxi":41
* def __dealloc__(self):
* CHKERR( DMDestroy(&self.dm) )
* CHKERR( VecDestroy(&self.gvec) ) # <<<<<<<<<<<<<<
*
* def __enter__(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_self->gvec))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 41, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmcomposite.pxi":39
* self.access = None
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* CHKERR( DMDestroy(&self.dm) )
* CHKERR( VecDestroy(&self.gvec) )
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_WriteUnraisable("petsc4py.PETSc._DMComposite_access.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "petsc4py/PETSc/petscdmcomposite.pxi":43
* CHKERR( VecDestroy(&self.gvec) )
*
* def __enter__(self): # <<<<<<<<<<<<<<
* cdef Py_ssize_t i, n = self.nlocs
* CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_5__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_19_DMComposite_access_4__enter__[] = "_DMComposite_access.__enter__(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_5__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_4__enter__(((struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_4__enter__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self) {
Py_ssize_t __pyx_v_n;
Py_ssize_t __pyx_7genexpr__pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
Py_ssize_t __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__enter__", 0);
/* "petsc4py/PETSc/petscdmcomposite.pxi":44
*
* def __enter__(self):
* cdef Py_ssize_t i, n = self.nlocs # <<<<<<<<<<<<<<
* CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) )
* self.access = [ref_Vec(self.vecs[i]) for i from 0 <= i < n]
*/
__pyx_t_1 = __pyx_v_self->nlocs;
__pyx_v_n = __pyx_t_1;
/* "petsc4py/PETSc/petscdmcomposite.pxi":45
* def __enter__(self):
* cdef Py_ssize_t i, n = self.nlocs
* CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) # <<<<<<<<<<<<<<
* self.access = [ref_Vec(self.vecs[i]) for i from 0 <= i < n]
* return tuple(self.access)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetAccessArray(__pyx_v_self->dm, __pyx_v_self->gvec, __pyx_v_self->nlocs, __pyx_v_self->locs, __pyx_v_self->vecs)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 45, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmcomposite.pxi":46
* cdef Py_ssize_t i, n = self.nlocs
* CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) )
* self.access = [ref_Vec(self.vecs[i]) for i from 0 <= i < n] # <<<<<<<<<<<<<<
* return tuple(self.access)
*
*/
{ /* enter inner scope */
__pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 46, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __pyx_v_n;
for (__pyx_7genexpr__pyx_v_i = 0; __pyx_7genexpr__pyx_v_i < __pyx_t_4; __pyx_7genexpr__pyx_v_i++) {
__pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_self->vecs[__pyx_7genexpr__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(28, 46, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(28, 46, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
} /* exit inner scope */
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_v_self->access);
__Pyx_DECREF(__pyx_v_self->access);
__pyx_v_self->access = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/petscdmcomposite.pxi":47
* CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) )
* self.access = [ref_Vec(self.vecs[i]) for i from 0 <= i < n]
* return tuple(self.access) # <<<<<<<<<<<<<<
*
* def __exit__(self, *exc):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_self->access); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 47, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmcomposite.pxi":43
* CHKERR( VecDestroy(&self.gvec) )
*
* def __enter__(self): # <<<<<<<<<<<<<<
* cdef Py_ssize_t i, n = self.nlocs
* CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc._DMComposite_access.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmcomposite.pxi":49
* return tuple(self.access)
*
* def __exit__(self, *exc): # <<<<<<<<<<<<<<
* cdef Py_ssize_t i, n = self.nlocs
* for i from 0 <= i < n: (<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*/
static char __pyx_doc_8petsc4py_5PETSc_19_DMComposite_access_6__exit__[] = "_DMComposite_access.__exit__(self, *exc)";
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;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_exc = __pyx_args;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_6__exit__(((struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)__pyx_v_self), __pyx_v_exc);
/* function exit code */
__Pyx_XDECREF(__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, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 51, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
((struct PyPetscVecObject *)__pyx_t_3)->vec = NULL;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
/* "petsc4py/PETSc/petscdmcomposite.pxi":52
* cdef Py_ssize_t i, n = self.nlocs
* for i from 0 <= i < n: (<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(28, 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;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
Vec __pyx_t_9;
PetscErrorCode __pyx_t_10;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_CreateGlobalVector", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":77
* PetscDM dm,
* PetscVec *v) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<<
* cdef Vec vec
* Dm.dm = dm
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 77, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 77, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 77, __pyx_L1_error)
__pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":79
* cdef DM Dm = subtype_DM(dm)()
* cdef Vec vec
* Dm.dm = dm # <<<<<<<<<<<<<<
* 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
* PetscINCREF(Dm.obj) # <<<<<<<<<<<<<<
* context = Dm.get_attr('__create_global_vector__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":81
* Dm.dm = dm
* PetscINCREF(Dm.obj)
* context = Dm.get_attr('__create_global_vector__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (create_gvec, args, kargs) = context
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_global_vector__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 81, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_context = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":82
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 82, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":83
* context = Dm.get_attr('__create_global_vector__')
* assert context is not None and type(context) is tuple
* (create_gvec, args, kargs) = context # <<<<<<<<<<<<<<
* vec = create_gvec(Dm, *args, **kargs)
* PetscINCREF(vec.obj)
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 83, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 83, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 83, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_create_gvec = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":84
* assert context is not None and type(context) is tuple
* (create_gvec, args, kargs) = context
* vec = create_gvec(Dm, *args, **kargs) # <<<<<<<<<<<<<<
* PetscINCREF(vec.obj)
* v[0] = vec.vec
*/
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Dm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dm));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm));
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 84, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
__pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_create_gvec, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(29, 84, __pyx_L1_error)
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":85
* (create_gvec, args, kargs) = context
* vec = create_gvec(Dm, *args, **kargs)
* PetscINCREF(vec.obj) # <<<<<<<<<<<<<<
* v[0] = vec.vec
* cdef PetscDM odm = NULL
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":86
* vec = create_gvec(Dm, *args, **kargs)
* PetscINCREF(vec.obj)
* v[0] = vec.vec # <<<<<<<<<<<<<<
* cdef PetscDM odm = NULL
* CHKERR( VecGetDM(v[0], &odm) )
*/
__pyx_t_9 = __pyx_v_vec->vec;
(__pyx_v_v[0]) = __pyx_t_9;
/* "petsc4py/PETSc/petscdmshell.pxi":87
* 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_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetDM((__pyx_v_v[0]), (&__pyx_v_odm))); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 88, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":89
* cdef PetscDM odm = NULL
* CHKERR( VecGetDM(v[0], &odm) )
* if odm == NULL: # <<<<<<<<<<<<<<
* CHKERR( VecSetDM(v[0], dm) )
* return PETSC_SUCCESS
*/
__pyx_t_3 = ((__pyx_v_odm == NULL) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscdmshell.pxi":90
* CHKERR( VecGetDM(v[0], &odm) )
* if odm == NULL:
* CHKERR( VecSetDM(v[0], dm) ) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetDM((__pyx_v_v[0]), __pyx_v_dm)); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 90, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":89
* cdef PetscDM odm = NULL
* CHKERR( VecGetDM(v[0], &odm) )
* if odm == NULL: # <<<<<<<<<<<<<<
* CHKERR( VecSetDM(v[0], dm) )
* return PETSC_SUCCESS
*/
}
/* "petsc4py/PETSc/petscdmshell.pxi":91
* if odm == NULL:
* CHKERR( VecSetDM(v[0], dm) )
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode DMSHELL_CreateLocalVector(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmshell.pxi":74
*
*
* cdef PetscErrorCode DMSHELL_CreateGlobalVector( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscVec *v) except PETSC_ERR_PYTHON with gil:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateGlobalVector", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dm);
__Pyx_XDECREF((PyObject *)__pyx_v_vec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_create_gvec);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":93
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_CreateLocalVector( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscVec *v) except PETSC_ERR_PYTHON with gil:
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateLocalVector(DM __pyx_v_dm, Vec *__pyx_v_v) {
struct PyPetscDMObject *__pyx_v_Dm = 0;
struct PyPetscVecObject *__pyx_v_vec = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_create_lvec = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
DM __pyx_v_odm;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
Vec __pyx_t_9;
PetscErrorCode __pyx_t_10;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_CreateLocalVector", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":96
* PetscDM dm,
* PetscVec *v) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<<
* cdef Vec vec
* Dm.dm = dm
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 96, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 96, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 96, __pyx_L1_error)
__pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":98
* cdef DM Dm = subtype_DM(dm)()
* cdef Vec vec
* Dm.dm = dm # <<<<<<<<<<<<<<
* 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
* PetscINCREF(Dm.obj) # <<<<<<<<<<<<<<
* context = Dm.get_attr('__create_local_vector__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":100
* Dm.dm = dm
* PetscINCREF(Dm.obj)
* context = Dm.get_attr('__create_local_vector__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (create_lvec, args, kargs) = context
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_local_vector__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_context = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":101
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 101, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":102
* context = Dm.get_attr('__create_local_vector__')
* assert context is not None and type(context) is tuple
* (create_lvec, args, kargs) = context # <<<<<<<<<<<<<<
* vec = create_lvec(Dm, *args, **kargs)
* PetscINCREF(vec.obj)
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 102, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 102, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 102, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_create_lvec = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":103
* assert context is not None and type(context) is tuple
* (create_lvec, args, kargs) = context
* vec = create_lvec(Dm, *args, **kargs) # <<<<<<<<<<<<<<
* PetscINCREF(vec.obj)
* v[0] = vec.vec
*/
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Dm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dm));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm));
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 103, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
__pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_create_lvec, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(29, 103, __pyx_L1_error)
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":104
* (create_lvec, args, kargs) = context
* vec = create_lvec(Dm, *args, **kargs)
* PetscINCREF(vec.obj) # <<<<<<<<<<<<<<
* v[0] = vec.vec
* cdef PetscDM odm = NULL
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":105
* vec = create_lvec(Dm, *args, **kargs)
* PetscINCREF(vec.obj)
* v[0] = vec.vec # <<<<<<<<<<<<<<
* cdef PetscDM odm = NULL
* CHKERR( VecGetDM(v[0], &odm) )
*/
__pyx_t_9 = __pyx_v_vec->vec;
(__pyx_v_v[0]) = __pyx_t_9;
/* "petsc4py/PETSc/petscdmshell.pxi":106
* 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_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetDM((__pyx_v_v[0]), (&__pyx_v_odm))); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 107, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":108
* cdef PetscDM odm = NULL
* CHKERR( VecGetDM(v[0], &odm) )
* if odm == NULL: # <<<<<<<<<<<<<<
* CHKERR( VecSetDM(v[0], dm) )
* return PETSC_SUCCESS
*/
__pyx_t_3 = ((__pyx_v_odm == NULL) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscdmshell.pxi":109
* CHKERR( VecGetDM(v[0], &odm) )
* if odm == NULL:
* CHKERR( VecSetDM(v[0], dm) ) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetDM((__pyx_v_v[0]), __pyx_v_dm)); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 109, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":108
* cdef PetscDM odm = NULL
* CHKERR( VecGetDM(v[0], &odm) )
* if odm == NULL: # <<<<<<<<<<<<<<
* CHKERR( VecSetDM(v[0], dm) )
* return PETSC_SUCCESS
*/
}
/* "petsc4py/PETSc/petscdmshell.pxi":110
* if odm == NULL:
* CHKERR( VecSetDM(v[0], dm) )
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode DMSHELL_GlobalToLocalBegin(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmshell.pxi":93
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_CreateLocalVector( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscVec *v) except PETSC_ERR_PYTHON with gil:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dm);
__Pyx_XDECREF((PyObject *)__pyx_v_vec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_create_lvec);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":112
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_GlobalToLocalBegin( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscVec g,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_GlobalToLocalBegin(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) {
struct PyPetscDMObject *__pyx_v_Dm = 0;
struct PyPetscVecObject *__pyx_v_gvec = 0;
struct PyPetscVecObject *__pyx_v_lvec = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_begin = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_GlobalToLocalBegin", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":117
* PetscInsertMode mode,
* PetscVec l) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<<
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 117, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 117, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 117, __pyx_L1_error)
__pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":118
* PetscVec l) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)()
* cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<<
* cdef Vec lvec = ref_Vec(l)
* Dm.dm = dm
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 118, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":119
* cdef DM Dm = subtype_DM(dm)()
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<<
* Dm.dm = dm
* PetscINCREF(Dm.obj)
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":120
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l)
* Dm.dm = dm # <<<<<<<<<<<<<<
* 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
* PetscINCREF(Dm.obj) # <<<<<<<<<<<<<<
* context = Dm.get_attr('__g2l_begin__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":122
* Dm.dm = dm
* PetscINCREF(Dm.obj)
* context = Dm.get_attr('__g2l_begin__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (begin, args, kargs) = context
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__g2l_begin__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 122, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_context = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":123
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 123, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":124
* context = Dm.get_attr('__g2l_begin__')
* assert context is not None and type(context) is tuple
* (begin, args, kargs) = context # <<<<<<<<<<<<<<
* begin(Dm, gvec, mode, lvec, *args, **kargs)
* return PETSC_SUCCESS
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 124, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 124, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 124, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_begin = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":125
* assert context is not None and type(context) is tuple
* (begin, args, kargs) = context
* begin(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 125, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 125, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_Dm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dm));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm));
__Pyx_INCREF(((PyObject *)__pyx_v_gvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_gvec));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_lvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_lvec));
PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec));
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 125, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 125, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 125, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 125, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 125, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_begin, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 125, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":126
* (begin, args, kargs) = context
* begin(Dm, gvec, mode, lvec, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode DMSHELL_GlobalToLocalEnd(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmshell.pxi":112
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_GlobalToLocalBegin( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscVec g,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_GlobalToLocalBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dm);
__Pyx_XDECREF((PyObject *)__pyx_v_gvec);
__Pyx_XDECREF((PyObject *)__pyx_v_lvec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_begin);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":128
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_GlobalToLocalEnd( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscVec g,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_GlobalToLocalEnd(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) {
struct PyPetscDMObject *__pyx_v_Dm = 0;
struct PyPetscVecObject *__pyx_v_gvec = 0;
struct PyPetscVecObject *__pyx_v_lvec = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_end = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_GlobalToLocalEnd", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":133
* PetscInsertMode mode,
* PetscVec l) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<<
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 133, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 133, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 133, __pyx_L1_error)
__pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":134
* PetscVec l) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)()
* cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<<
* cdef Vec lvec = ref_Vec(l)
* Dm.dm = dm
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 134, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":135
* cdef DM Dm = subtype_DM(dm)()
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<<
* Dm.dm = dm
* PetscINCREF(Dm.obj)
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":136
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l)
* Dm.dm = dm # <<<<<<<<<<<<<<
* 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
* PetscINCREF(Dm.obj) # <<<<<<<<<<<<<<
* context = Dm.get_attr('__g2l_end__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":138
* Dm.dm = dm
* PetscINCREF(Dm.obj)
* context = Dm.get_attr('__g2l_end__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (end, args, kargs) = context
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__g2l_end__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 138, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_context = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":139
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 139, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":140
* context = Dm.get_attr('__g2l_end__')
* assert context is not None and type(context) is tuple
* (end, args, kargs) = context # <<<<<<<<<<<<<<
* end(Dm, gvec, mode, lvec, *args, **kargs)
* return PETSC_SUCCESS
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 140, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 140, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 140, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 140, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 140, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 140, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 140, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_end = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":141
* assert context is not None and type(context) is tuple
* (end, args, kargs) = context
* end(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_Dm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dm));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm));
__Pyx_INCREF(((PyObject *)__pyx_v_gvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_gvec));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_lvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_lvec));
PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec));
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 141, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_end, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":142
* (end, args, kargs) = context
* end(Dm, gvec, mode, lvec, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode DMSHELL_LocalToGlobalBegin(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmshell.pxi":128
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_GlobalToLocalEnd( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscVec g,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_GlobalToLocalEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dm);
__Pyx_XDECREF((PyObject *)__pyx_v_gvec);
__Pyx_XDECREF((PyObject *)__pyx_v_lvec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_end);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":144
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_LocalToGlobalBegin( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscVec g,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToGlobalBegin(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) {
struct PyPetscDMObject *__pyx_v_Dm = 0;
struct PyPetscVecObject *__pyx_v_gvec = 0;
struct PyPetscVecObject *__pyx_v_lvec = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_begin = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_LocalToGlobalBegin", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":149
* PetscInsertMode mode,
* PetscVec l) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<<
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 149, __pyx_L1_error)
__pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":150
* PetscVec l) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)()
* cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<<
* cdef Vec lvec = ref_Vec(l)
* Dm.dm = dm
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 150, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":151
* cdef DM Dm = subtype_DM(dm)()
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<<
* Dm.dm = dm
* PetscINCREF(Dm.obj)
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":152
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l)
* Dm.dm = dm # <<<<<<<<<<<<<<
* 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
* PetscINCREF(Dm.obj) # <<<<<<<<<<<<<<
* context = Dm.get_attr('__l2g_begin__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":154
* Dm.dm = dm
* PetscINCREF(Dm.obj)
* context = Dm.get_attr('__l2g_begin__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (begin, args, kargs) = context
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__l2g_begin__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 154, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_context = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":155
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 155, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":156
* context = Dm.get_attr('__l2g_begin__')
* assert context is not None and type(context) is tuple
* (begin, args, kargs) = context # <<<<<<<<<<<<<<
* begin(Dm, gvec, mode, lvec, *args, **kargs)
* return PETSC_SUCCESS
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 156, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 156, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 156, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_begin = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":157
* assert context is not None and type(context) is tuple
* (begin, args, kargs) = context
* begin(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_Dm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dm));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm));
__Pyx_INCREF(((PyObject *)__pyx_v_gvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_gvec));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_lvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_lvec));
PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec));
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 157, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_begin, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":158
* (begin, args, kargs) = context
* begin(Dm, gvec, mode, lvec, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode DMSHELL_LocalToGlobalEnd(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmshell.pxi":144
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_LocalToGlobalBegin( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscVec g,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_LocalToGlobalBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dm);
__Pyx_XDECREF((PyObject *)__pyx_v_gvec);
__Pyx_XDECREF((PyObject *)__pyx_v_lvec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_begin);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":160
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_LocalToGlobalEnd( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscVec g,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToGlobalEnd(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) {
struct PyPetscDMObject *__pyx_v_Dm = 0;
struct PyPetscVecObject *__pyx_v_gvec = 0;
struct PyPetscVecObject *__pyx_v_lvec = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_end = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_LocalToGlobalEnd", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":165
* PetscInsertMode mode,
* PetscVec l) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<<
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 165, __pyx_L1_error)
__pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":166
* PetscVec l) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)()
* cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<<
* cdef Vec lvec = ref_Vec(l)
* Dm.dm = dm
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":167
* cdef DM Dm = subtype_DM(dm)()
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<<
* Dm.dm = dm
* PetscINCREF(Dm.obj)
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":168
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l)
* Dm.dm = dm # <<<<<<<<<<<<<<
* 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
* PetscINCREF(Dm.obj) # <<<<<<<<<<<<<<
* context = Dm.get_attr('__l2g_end__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":170
* Dm.dm = dm
* PetscINCREF(Dm.obj)
* context = Dm.get_attr('__l2g_end__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (end, args, kargs) = context
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__l2g_end__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_context = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":171
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 171, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":172
* context = Dm.get_attr('__l2g_end__')
* assert context is not None and type(context) is tuple
* (end, args, kargs) = context # <<<<<<<<<<<<<<
* end(Dm, gvec, mode, lvec, *args, **kargs)
* return PETSC_SUCCESS
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 172, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 172, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 172, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_end = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":173
* assert context is not None and type(context) is tuple
* (end, args, kargs) = context
* end(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_Dm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dm));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm));
__Pyx_INCREF(((PyObject *)__pyx_v_gvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_gvec));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_lvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_lvec));
PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec));
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 173, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_end, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":174
* (end, args, kargs) = context
* end(Dm, gvec, mode, lvec, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode DMSHELL_LocalToLocalBegin(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmshell.pxi":160
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_LocalToGlobalEnd( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscVec g,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_LocalToGlobalEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dm);
__Pyx_XDECREF((PyObject *)__pyx_v_gvec);
__Pyx_XDECREF((PyObject *)__pyx_v_lvec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_end);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":176
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_LocalToLocalBegin( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscVec g,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToLocalBegin(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) {
struct PyPetscDMObject *__pyx_v_Dm = 0;
struct PyPetscVecObject *__pyx_v_gvec = 0;
struct PyPetscVecObject *__pyx_v_lvec = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_begin = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_LocalToLocalBegin", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":181
* PetscInsertMode mode,
* PetscVec l) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<<
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 181, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 181, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 181, __pyx_L1_error)
__pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":182
* PetscVec l) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)()
* cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<<
* cdef Vec lvec = ref_Vec(l)
* Dm.dm = dm
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 182, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":183
* cdef DM Dm = subtype_DM(dm)()
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<<
* Dm.dm = dm
* PetscINCREF(Dm.obj)
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 183, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":184
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l)
* Dm.dm = dm # <<<<<<<<<<<<<<
* 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
* PetscINCREF(Dm.obj) # <<<<<<<<<<<<<<
* context = Dm.get_attr('__l2l_begin__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":186
* Dm.dm = dm
* PetscINCREF(Dm.obj)
* context = Dm.get_attr('__l2l_begin__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (begin, args, kargs) = context
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__l2l_begin__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_context = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":187
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 187, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":188
* context = Dm.get_attr('__l2l_begin__')
* assert context is not None and type(context) is tuple
* (begin, args, kargs) = context # <<<<<<<<<<<<<<
* begin(Dm, gvec, mode, lvec, *args, **kargs)
* return PETSC_SUCCESS
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 188, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 188, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 188, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_begin = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":189
* assert context is not None and type(context) is tuple
* (begin, args, kargs) = context
* begin(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_Dm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dm));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm));
__Pyx_INCREF(((PyObject *)__pyx_v_gvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_gvec));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_lvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_lvec));
PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec));
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 189, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_begin, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":190
* (begin, args, kargs) = context
* begin(Dm, gvec, mode, lvec, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode DMSHELL_LocalToLocalEnd(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmshell.pxi":176
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_LocalToLocalBegin( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscVec g,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_LocalToLocalBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dm);
__Pyx_XDECREF((PyObject *)__pyx_v_gvec);
__Pyx_XDECREF((PyObject *)__pyx_v_lvec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_begin);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":192
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_LocalToLocalEnd( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscVec g,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToLocalEnd(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) {
struct PyPetscDMObject *__pyx_v_Dm = 0;
struct PyPetscVecObject *__pyx_v_gvec = 0;
struct PyPetscVecObject *__pyx_v_lvec = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_end = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_LocalToLocalEnd", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":197
* PetscInsertMode mode,
* PetscVec l) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<<
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 197, __pyx_L1_error)
__pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":198
* PetscVec l) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)()
* cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<<
* cdef Vec lvec = ref_Vec(l)
* Dm.dm = dm
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":199
* cdef DM Dm = subtype_DM(dm)()
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<<
* Dm.dm = dm
* PetscINCREF(Dm.obj)
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":200
* cdef Vec gvec = ref_Vec(g)
* cdef Vec lvec = ref_Vec(l)
* Dm.dm = dm # <<<<<<<<<<<<<<
* 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
* PetscINCREF(Dm.obj) # <<<<<<<<<<<<<<
* context = Dm.get_attr('__l2l_end__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":202
* Dm.dm = dm
* PetscINCREF(Dm.obj)
* context = Dm.get_attr('__l2l_end__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (end, args, kargs) = context
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__l2l_end__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_context = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":203
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 203, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":204
* context = Dm.get_attr('__l2l_end__')
* assert context is not None and type(context) is tuple
* (end, args, kargs) = context # <<<<<<<<<<<<<<
* end(Dm, gvec, mode, lvec, *args, **kargs)
* return PETSC_SUCCESS
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 204, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 204, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 204, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 204, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 204, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 204, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 204, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_end = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":205
* assert context is not None and type(context) is tuple
* (end, args, kargs) = context
* end(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_Dm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dm));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm));
__Pyx_INCREF(((PyObject *)__pyx_v_gvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_gvec));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec));
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_lvec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_lvec));
PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec));
__pyx_t_6 = 0;
__pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 205, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
__pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_end, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":206
* (end, args, kargs) = context
* end(Dm, gvec, mode, lvec, *args, **kargs)
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode DMSHELL_CreateMatrix(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmshell.pxi":192
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_LocalToLocalEnd( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscVec g,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_LocalToLocalEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dm);
__Pyx_XDECREF((PyObject *)__pyx_v_gvec);
__Pyx_XDECREF((PyObject *)__pyx_v_lvec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_end);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":208
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_CreateMatrix( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscMat *cmat) except PETSC_ERR_PYTHON with gil:
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateMatrix(DM __pyx_v_dm, Mat *__pyx_v_cmat) {
struct PyPetscDMObject *__pyx_v_Dm = 0;
struct PyPetscMatObject *__pyx_v_mat = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_matrix = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
DM __pyx_v_odm;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
Mat __pyx_t_9;
PetscErrorCode __pyx_t_10;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_CreateMatrix", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":211
* PetscDM dm,
* PetscMat *cmat) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<<
* cdef Mat mat
* Dm.dm = dm
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 211, __pyx_L1_error)
__pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":213
* cdef DM Dm = subtype_DM(dm)()
* cdef Mat mat
* Dm.dm = dm # <<<<<<<<<<<<<<
* 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
* PetscINCREF(Dm.obj) # <<<<<<<<<<<<<<
* context = Dm.get_attr('__create_matrix__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":215
* Dm.dm = dm
* PetscINCREF(Dm.obj)
* context = Dm.get_attr('__create_matrix__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (matrix, args, kargs) = context
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_matrix__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_context = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":216
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 216, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":217
* context = Dm.get_attr('__create_matrix__')
* assert context is not None and type(context) is tuple
* (matrix, args, kargs) = context # <<<<<<<<<<<<<<
* mat = matrix(Dm, *args, **kargs)
* PetscINCREF(mat.obj)
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 217, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 217, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 217, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_matrix = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":218
* assert context is not None and type(context) is tuple
* (matrix, args, kargs) = context
* mat = matrix(Dm, *args, **kargs) # <<<<<<<<<<<<<<
* PetscINCREF(mat.obj)
* cmat[0] = mat.mat
*/
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Dm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dm));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm));
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 218, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
__pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_matrix, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(29, 218, __pyx_L1_error)
__pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":219
* (matrix, args, kargs) = context
* mat = matrix(Dm, *args, **kargs)
* PetscINCREF(mat.obj) # <<<<<<<<<<<<<<
* cmat[0] = mat.mat
* cdef PetscDM odm = NULL
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":220
* mat = matrix(Dm, *args, **kargs)
* PetscINCREF(mat.obj)
* cmat[0] = mat.mat # <<<<<<<<<<<<<<
* cdef PetscDM odm = NULL
* CHKERR( MatGetDM(cmat[0], &odm) )
*/
__pyx_t_9 = __pyx_v_mat->mat;
(__pyx_v_cmat[0]) = __pyx_t_9;
/* "petsc4py/PETSc/petscdmshell.pxi":221
* 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_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetDM((__pyx_v_cmat[0]), (&__pyx_v_odm))); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 222, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":223
* cdef PetscDM odm = NULL
* CHKERR( MatGetDM(cmat[0], &odm) )
* if odm == NULL: # <<<<<<<<<<<<<<
* CHKERR( MatSetDM(cmat[0], dm) )
* return PETSC_SUCCESS
*/
__pyx_t_3 = ((__pyx_v_odm == NULL) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscdmshell.pxi":224
* CHKERR( MatGetDM(cmat[0], &odm) )
* if odm == NULL:
* CHKERR( MatSetDM(cmat[0], dm) ) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetDM((__pyx_v_cmat[0]), __pyx_v_dm)); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 224, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":223
* cdef PetscDM odm = NULL
* CHKERR( MatGetDM(cmat[0], &odm) )
* if odm == NULL: # <<<<<<<<<<<<<<
* CHKERR( MatSetDM(cmat[0], dm) )
* return PETSC_SUCCESS
*/
}
/* "petsc4py/PETSc/petscdmshell.pxi":225
* if odm == NULL:
* CHKERR( MatSetDM(cmat[0], dm) )
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode DMSHELL_Coarsen(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmshell.pxi":208
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_CreateMatrix( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscMat *cmat) except PETSC_ERR_PYTHON with gil:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dm);
__Pyx_XDECREF((PyObject *)__pyx_v_mat);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_matrix);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":227
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_Coarsen( # <<<<<<<<<<<<<<
* PetscDM dm,
* MPI_Comm comm,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_Coarsen(DM __pyx_v_dm, MPI_Comm __pyx_v_comm, DM *__pyx_v_dmc) {
struct PyPetscDMObject *__pyx_v_Dm = 0;
struct PyPetscDMObject *__pyx_v_Dmc = 0;
struct PyPetscCommObject *__pyx_v_Comm = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_coarsen = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
DM __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_Coarsen", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":231
* MPI_Comm comm,
* PetscDM *dmc) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<<
* cdef DM Dmc
* cdef Comm Comm = new_Comm(comm)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 231, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 231, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 231, __pyx_L1_error)
__pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":233
* cdef DM Dm = subtype_DM(dm)()
* cdef DM Dmc
* cdef Comm Comm = new_Comm(comm) # <<<<<<<<<<<<<<
* Dm.dm = dm
* PetscINCREF(Dm.obj)
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_new_Comm(__pyx_v_comm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_Comm = ((struct PyPetscCommObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":234
* cdef DM Dmc
* cdef Comm Comm = new_Comm(comm)
* Dm.dm = dm # <<<<<<<<<<<<<<
* 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
* PetscINCREF(Dm.obj) # <<<<<<<<<<<<<<
* context = Dm.get_attr('__coarsen__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":236
* Dm.dm = dm
* PetscINCREF(Dm.obj)
* context = Dm.get_attr('__coarsen__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (coarsen, args, kargs) = context
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__coarsen__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 236, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_context = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":237
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 237, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":238
* context = Dm.get_attr('__coarsen__')
* assert context is not None and type(context) is tuple
* (coarsen, args, kargs) = context # <<<<<<<<<<<<<<
* Dmc = coarsen(Dm, Comm, *args, **kargs)
* PetscINCREF(Dmc.obj)
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 238, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 238, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 238, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_coarsen = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":239
* assert context is not None and type(context) is tuple
* (coarsen, args, kargs) = context
* Dmc = coarsen(Dm, Comm, *args, **kargs) # <<<<<<<<<<<<<<
* PetscINCREF(Dmc.obj)
* dmc[0] = Dmc.dm
*/
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Dm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dm));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm));
__Pyx_INCREF(((PyObject *)__pyx_v_Comm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Comm));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Comm));
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 239, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
__pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_coarsen, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 239, __pyx_L1_error)
__pyx_v_Dmc = ((struct PyPetscDMObject *)__pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":240
* (coarsen, args, kargs) = context
* Dmc = coarsen(Dm, Comm, *args, **kargs)
* PetscINCREF(Dmc.obj) # <<<<<<<<<<<<<<
* dmc[0] = Dmc.dm
* return PETSC_SUCCESS
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":241
* Dmc = coarsen(Dm, Comm, *args, **kargs)
* PetscINCREF(Dmc.obj)
* dmc[0] = Dmc.dm # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_9 = __pyx_v_Dmc->dm;
(__pyx_v_dmc[0]) = __pyx_t_9;
/* "petsc4py/PETSc/petscdmshell.pxi":242
* PetscINCREF(Dmc.obj)
* dmc[0] = Dmc.dm
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode DMSHELL_Refine(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmshell.pxi":227
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_Coarsen( # <<<<<<<<<<<<<<
* PetscDM dm,
* MPI_Comm comm,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_Coarsen", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dm);
__Pyx_XDECREF((PyObject *)__pyx_v_Dmc);
__Pyx_XDECREF((PyObject *)__pyx_v_Comm);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_coarsen);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":244
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_Refine( # <<<<<<<<<<<<<<
* PetscDM dm,
* MPI_Comm comm,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_Refine(DM __pyx_v_dm, MPI_Comm __pyx_v_comm, DM *__pyx_v_dmf) {
struct PyPetscDMObject *__pyx_v_Dm = 0;
struct PyPetscDMObject *__pyx_v_Dmf = 0;
struct PyPetscCommObject *__pyx_v_Comm = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_refine = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
DM __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_Refine", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":248
* MPI_Comm comm,
* PetscDM *dmf) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<<
* cdef DM Dmf
* cdef Comm Comm = new_Comm(comm)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 248, __pyx_L1_error)
__pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":250
* cdef DM Dm = subtype_DM(dm)()
* cdef DM Dmf
* cdef Comm Comm = new_Comm(comm) # <<<<<<<<<<<<<<
* Dm.dm = dm
* PetscINCREF(Dm.obj)
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_new_Comm(__pyx_v_comm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 250, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_Comm = ((struct PyPetscCommObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":251
* cdef DM Dmf
* cdef Comm Comm = new_Comm(comm)
* Dm.dm = dm # <<<<<<<<<<<<<<
* 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
* PetscINCREF(Dm.obj) # <<<<<<<<<<<<<<
* context = Dm.get_attr('__refine__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":253
* Dm.dm = dm
* PetscINCREF(Dm.obj)
* context = Dm.get_attr('__refine__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (refine, args, kargs) = context
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__refine__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_context = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":254
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 254, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":255
* context = Dm.get_attr('__refine__')
* assert context is not None and type(context) is tuple
* (refine, args, kargs) = context # <<<<<<<<<<<<<<
* Dmf = refine(Dm, Comm, *args, **kargs)
* PetscINCREF(Dmf.obj)
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 255, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 255, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 255, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_refine = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":256
* assert context is not None and type(context) is tuple
* (refine, args, kargs) = context
* Dmf = refine(Dm, Comm, *args, **kargs) # <<<<<<<<<<<<<<
* PetscINCREF(Dmf.obj)
* dmf[0] = Dmf.dm
*/
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Dm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dm));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm));
__Pyx_INCREF(((PyObject *)__pyx_v_Comm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Comm));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Comm));
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 256, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
__pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_refine, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 256, __pyx_L1_error)
__pyx_v_Dmf = ((struct PyPetscDMObject *)__pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":257
* (refine, args, kargs) = context
* Dmf = refine(Dm, Comm, *args, **kargs)
* PetscINCREF(Dmf.obj) # <<<<<<<<<<<<<<
* dmf[0] = Dmf.dm
* return PETSC_SUCCESS
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":258
* Dmf = refine(Dm, Comm, *args, **kargs)
* PetscINCREF(Dmf.obj)
* dmf[0] = Dmf.dm # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_9 = __pyx_v_Dmf->dm;
(__pyx_v_dmf[0]) = __pyx_t_9;
/* "petsc4py/PETSc/petscdmshell.pxi":259
* PetscINCREF(Dmf.obj)
* dmf[0] = Dmf.dm
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode DMSHELL_CreateInterpolation(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmshell.pxi":244
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_Refine( # <<<<<<<<<<<<<<
* PetscDM dm,
* MPI_Comm comm,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_Refine", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dm);
__Pyx_XDECREF((PyObject *)__pyx_v_Dmf);
__Pyx_XDECREF((PyObject *)__pyx_v_Comm);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_refine);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":261
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_CreateInterpolation( # <<<<<<<<<<<<<<
* PetscDM dmc,
* PetscDM dmf,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateInterpolation(DM __pyx_v_dmc, DM __pyx_v_dmf, Mat *__pyx_v_cmat, Vec *__pyx_v_cvec) {
struct PyPetscDMObject *__pyx_v_Dmc = 0;
struct PyPetscDMObject *__pyx_v_Dmf = 0;
struct PyPetscMatObject *__pyx_v_mat = 0;
struct PyPetscVecObject *__pyx_v_vec = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_interpolation = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
Mat __pyx_t_9;
Vec __pyx_t_10;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_CreateInterpolation", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":266
* PetscMat *cmat,
* PetscVec *cvec) except PETSC_ERR_PYTHON with gil:
* cdef DM Dmc = subtype_DM(dmc)() # <<<<<<<<<<<<<<
* cdef DM Dmf = subtype_DM(dmf)()
* cdef Mat mat
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 266, __pyx_L1_error)
__pyx_v_Dmc = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":267
* PetscVec *cvec) except PETSC_ERR_PYTHON with gil:
* cdef DM Dmc = subtype_DM(dmc)()
* cdef DM Dmf = subtype_DM(dmf)() # <<<<<<<<<<<<<<
* cdef Mat mat
* cdef Vec vec
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 267, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 267, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 267, __pyx_L1_error)
__pyx_v_Dmf = ((struct PyPetscDMObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":270
* cdef Mat mat
* cdef Vec vec
* Dmc.dm = dmc # <<<<<<<<<<<<<<
* PetscINCREF(Dmc.obj)
* Dmf.dm = dmf
*/
__pyx_v_Dmc->dm = __pyx_v_dmc;
/* "petsc4py/PETSc/petscdmshell.pxi":271
* cdef Vec vec
* Dmc.dm = dmc
* PetscINCREF(Dmc.obj) # <<<<<<<<<<<<<<
* Dmf.dm = dmf
* PetscINCREF(Dmf.obj)
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":272
* Dmc.dm = dmc
* PetscINCREF(Dmc.obj)
* Dmf.dm = dmf # <<<<<<<<<<<<<<
* PetscINCREF(Dmf.obj)
* context = Dmc.get_attr('__create_interpolation__')
*/
__pyx_v_Dmf->dm = __pyx_v_dmf;
/* "petsc4py/PETSc/petscdmshell.pxi":273
* PetscINCREF(Dmc.obj)
* Dmf.dm = dmf
* PetscINCREF(Dmf.obj) # <<<<<<<<<<<<<<
* context = Dmc.get_attr('__create_interpolation__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":274
* Dmf.dm = dmf
* PetscINCREF(Dmf.obj)
* context = Dmc.get_attr('__create_interpolation__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (interpolation, args, kargs) = context
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dmc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dmc), ((char *)"__create_interpolation__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 274, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":275
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 275, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":276
* context = Dmc.get_attr('__create_interpolation__')
* assert context is not None and type(context) is tuple
* (interpolation, args, kargs) = context # <<<<<<<<<<<<<<
* mat, vec = interpolation(Dmc, Dmf, *args, **kargs)
* PetscINCREF(mat.obj)
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 276, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_2 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 276, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 276, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_interpolation = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":277
* assert context is not None and type(context) is tuple
* (interpolation, args, kargs) = context
* mat, vec = interpolation(Dmc, Dmf, *args, **kargs) # <<<<<<<<<<<<<<
* PetscINCREF(mat.obj)
* cmat[0] = mat.mat
*/
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Dmc));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dmc));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dmc));
__Pyx_INCREF(((PyObject *)__pyx_v_Dmf));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dmf));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Dmf));
__pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 277, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_2 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
__pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_interpolation, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
PyObject* sequence = __pyx_t_6;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 277, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(29, 277, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L8_unpacking_done;
__pyx_L7_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 277, __pyx_L1_error)
__pyx_L8_unpacking_done:;
}
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(29, 277, __pyx_L1_error)
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(29, 277, __pyx_L1_error)
__pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2);
__pyx_t_2 = 0;
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":278
* (interpolation, args, kargs) = context
* mat, vec = interpolation(Dmc, Dmf, *args, **kargs)
* PetscINCREF(mat.obj) # <<<<<<<<<<<<<<
* cmat[0] = mat.mat
* if cvec == NULL:
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":279
* mat, vec = interpolation(Dmc, Dmf, *args, **kargs)
* PetscINCREF(mat.obj)
* cmat[0] = mat.mat # <<<<<<<<<<<<<<
* if cvec == NULL:
* return PETSC_SUCCESS
*/
__pyx_t_9 = __pyx_v_mat->mat;
(__pyx_v_cmat[0]) = __pyx_t_9;
/* "petsc4py/PETSc/petscdmshell.pxi":280
* PetscINCREF(mat.obj)
* cmat[0] = mat.mat
* if cvec == NULL: # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
* if vec is None:
*/
__pyx_t_3 = ((__pyx_v_cvec == NULL) != 0);
if (__pyx_t_3) {
/* "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
* 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_3 = (((PyObject *)__pyx_v_vec) == Py_None);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* "petsc4py/PETSc/petscdmshell.pxi":283
* return PETSC_SUCCESS
* if vec is None:
* cvec[0] = NULL # <<<<<<<<<<<<<<
* else:
* 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:
* PetscINCREF(vec.obj) # <<<<<<<<<<<<<<
* cvec[0] = vec.vec
* return PETSC_SUCCESS
*/
/*else*/ {
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":286
* else:
* PetscINCREF(vec.obj)
* cvec[0] = vec.vec # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_10 = __pyx_v_vec->vec;
(__pyx_v_cvec[0]) = __pyx_t_10;
}
__pyx_L10:;
/* "petsc4py/PETSc/petscdmshell.pxi":287
* PetscINCREF(vec.obj)
* cvec[0] = vec.vec
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode DMSHELL_CreateInjection(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmshell.pxi":261
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_CreateInterpolation( # <<<<<<<<<<<<<<
* PetscDM dmc,
* PetscDM dmf,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dmc);
__Pyx_XDECREF((PyObject *)__pyx_v_Dmf);
__Pyx_XDECREF((PyObject *)__pyx_v_mat);
__Pyx_XDECREF((PyObject *)__pyx_v_vec);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_interpolation);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":289
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_CreateInjection( # <<<<<<<<<<<<<<
* PetscDM dmc,
* PetscDM dmf,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateInjection(DM __pyx_v_dmc, DM __pyx_v_dmf, Mat *__pyx_v_cmat) {
struct PyPetscDMObject *__pyx_v_Dmc = 0;
struct PyPetscDMObject *__pyx_v_Dmf = 0;
struct PyPetscMatObject *__pyx_v_mat = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_injection = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
Mat __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_CreateInjection", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":293
* PetscDM dmf,
* PetscMat *cmat) except PETSC_ERR_PYTHON with gil:
* cdef DM Dmc = subtype_DM(dmc)() # <<<<<<<<<<<<<<
* cdef DM Dmf = subtype_DM(dmf)()
* cdef Mat mat
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 293, __pyx_L1_error)
__pyx_v_Dmc = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":294
* PetscMat *cmat) except PETSC_ERR_PYTHON with gil:
* cdef DM Dmc = subtype_DM(dmc)()
* cdef DM Dmf = subtype_DM(dmf)() # <<<<<<<<<<<<<<
* cdef Mat mat
* Dmc.dm = dmc
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 294, __pyx_L1_error)
__pyx_v_Dmf = ((struct PyPetscDMObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":296
* cdef DM Dmf = subtype_DM(dmf)()
* cdef Mat mat
* Dmc.dm = dmc # <<<<<<<<<<<<<<
* PetscINCREF(Dmc.obj)
* Dmf.dm = dmf
*/
__pyx_v_Dmc->dm = __pyx_v_dmc;
/* "petsc4py/PETSc/petscdmshell.pxi":297
* cdef Mat mat
* Dmc.dm = dmc
* PetscINCREF(Dmc.obj) # <<<<<<<<<<<<<<
* Dmf.dm = dmf
* PetscINCREF(Dmf.obj)
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":298
* Dmc.dm = dmc
* PetscINCREF(Dmc.obj)
* Dmf.dm = dmf # <<<<<<<<<<<<<<
* PetscINCREF(Dmf.obj)
* context = Dmc.get_attr('__create_injection__')
*/
__pyx_v_Dmf->dm = __pyx_v_dmf;
/* "petsc4py/PETSc/petscdmshell.pxi":299
* PetscINCREF(Dmc.obj)
* Dmf.dm = dmf
* PetscINCREF(Dmf.obj) # <<<<<<<<<<<<<<
* context = Dmc.get_attr('__create_injection__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":300
* Dmf.dm = dmf
* PetscINCREF(Dmf.obj)
* context = Dmc.get_attr('__create_injection__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (injection, args, kargs) = context
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dmc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dmc), ((char *)"__create_injection__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 300, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":301
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 301, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":302
* context = Dmc.get_attr('__create_injection__')
* assert context is not None and type(context) is tuple
* (injection, args, kargs) = context # <<<<<<<<<<<<<<
* mat = injection(Dmc, Dmf, *args, **kargs)
* PetscINCREF(mat.obj)
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 302, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_2 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 302, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 302, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_injection = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":303
* assert context is not None and type(context) is tuple
* (injection, args, kargs) = context
* mat = injection(Dmc, Dmf, *args, **kargs) # <<<<<<<<<<<<<<
* PetscINCREF(mat.obj)
* cmat[0] = mat.mat
*/
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Dmc));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dmc));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dmc));
__Pyx_INCREF(((PyObject *)__pyx_v_Dmf));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dmf));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Dmf));
__pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 303, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_2 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
__pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_injection, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(29, 303, __pyx_L1_error)
__pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":304
* (injection, args, kargs) = context
* mat = injection(Dmc, Dmf, *args, **kargs)
* PetscINCREF(mat.obj) # <<<<<<<<<<<<<<
* cmat[0] = mat.mat
* return PETSC_SUCCESS
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":305
* mat = injection(Dmc, Dmf, *args, **kargs)
* PetscINCREF(mat.obj)
* cmat[0] = mat.mat # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_9 = __pyx_v_mat->mat;
(__pyx_v_cmat[0]) = __pyx_t_9;
/* "petsc4py/PETSc/petscdmshell.pxi":306
* PetscINCREF(mat.obj)
* cmat[0] = mat.mat
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode DMSHELL_CreateRestriction(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmshell.pxi":289
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_CreateInjection( # <<<<<<<<<<<<<<
* PetscDM dmc,
* PetscDM dmf,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateInjection", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dmc);
__Pyx_XDECREF((PyObject *)__pyx_v_Dmf);
__Pyx_XDECREF((PyObject *)__pyx_v_mat);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_injection);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":308
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_CreateRestriction( # <<<<<<<<<<<<<<
* PetscDM dmf,
* PetscDM dmc,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateRestriction(DM __pyx_v_dmf, DM __pyx_v_dmc, Mat *__pyx_v_cmat) {
struct PyPetscDMObject *__pyx_v_Dmf = 0;
struct PyPetscDMObject *__pyx_v_Dmc = 0;
struct PyPetscMatObject *__pyx_v_mat = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_restriction = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
Mat __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_CreateRestriction", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":312
* PetscDM dmc,
* PetscMat *cmat) except PETSC_ERR_PYTHON with gil:
* cdef DM Dmf = subtype_DM(dmf)() # <<<<<<<<<<<<<<
* cdef DM Dmc = subtype_DM(dmc)()
* cdef Mat mat
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 312, __pyx_L1_error)
__pyx_v_Dmf = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":313
* PetscMat *cmat) except PETSC_ERR_PYTHON with gil:
* cdef DM Dmf = subtype_DM(dmf)()
* cdef DM Dmc = subtype_DM(dmc)() # <<<<<<<<<<<<<<
* cdef Mat mat
* Dmf.dm = dmf
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 313, __pyx_L1_error)
__pyx_v_Dmc = ((struct PyPetscDMObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":315
* cdef DM Dmc = subtype_DM(dmc)()
* cdef Mat mat
* Dmf.dm = dmf # <<<<<<<<<<<<<<
* PetscINCREF(Dmf.obj)
* Dmc.dm = dmc
*/
__pyx_v_Dmf->dm = __pyx_v_dmf;
/* "petsc4py/PETSc/petscdmshell.pxi":316
* cdef Mat mat
* Dmf.dm = dmf
* PetscINCREF(Dmf.obj) # <<<<<<<<<<<<<<
* Dmc.dm = dmc
* PetscINCREF(Dmc.obj)
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":317
* Dmf.dm = dmf
* PetscINCREF(Dmf.obj)
* Dmc.dm = dmc # <<<<<<<<<<<<<<
* PetscINCREF(Dmc.obj)
* context = Dmf.get_attr('__create_restriction__')
*/
__pyx_v_Dmc->dm = __pyx_v_dmc;
/* "petsc4py/PETSc/petscdmshell.pxi":318
* PetscINCREF(Dmf.obj)
* Dmc.dm = dmc
* PetscINCREF(Dmc.obj) # <<<<<<<<<<<<<<
* context = Dmf.get_attr('__create_restriction__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":319
* Dmc.dm = dmc
* PetscINCREF(Dmc.obj)
* context = Dmf.get_attr('__create_restriction__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (restriction, args, kargs) = context
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dmf->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dmf), ((char *)"__create_restriction__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 319, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":320
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 320, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":321
* context = Dmf.get_attr('__create_restriction__')
* assert context is not None and type(context) is tuple
* (restriction, args, kargs) = context # <<<<<<<<<<<<<<
* mat = restriction(Dmf, Dmc, *args, **kargs)
* PetscINCREF(mat.obj)
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 321, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_2 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 321, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 321, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_restriction = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":322
* assert context is not None and type(context) is tuple
* (restriction, args, kargs) = context
* mat = restriction(Dmf, Dmc, *args, **kargs) # <<<<<<<<<<<<<<
* PetscINCREF(mat.obj)
* cmat[0] = mat.mat
*/
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Dmf));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dmf));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dmf));
__Pyx_INCREF(((PyObject *)__pyx_v_Dmc));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dmc));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Dmc));
__pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 322, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_2 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
__pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_restriction, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(29, 322, __pyx_L1_error)
__pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":323
* (restriction, args, kargs) = context
* mat = restriction(Dmf, Dmc, *args, **kargs)
* PetscINCREF(mat.obj) # <<<<<<<<<<<<<<
* cmat[0] = mat.mat
* return PETSC_SUCCESS
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":324
* mat = restriction(Dmf, Dmc, *args, **kargs)
* PetscINCREF(mat.obj)
* cmat[0] = mat.mat # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_9 = __pyx_v_mat->mat;
(__pyx_v_cmat[0]) = __pyx_t_9;
/* "petsc4py/PETSc/petscdmshell.pxi":325
* PetscINCREF(mat.obj)
* cmat[0] = mat.mat
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*
* cdef PetscErrorCode DMSHELL_CreateFieldDecomposition(
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmshell.pxi":308
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_CreateRestriction( # <<<<<<<<<<<<<<
* PetscDM dmf,
* PetscDM dmc,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dmf);
__Pyx_XDECREF((PyObject *)__pyx_v_Dmc);
__Pyx_XDECREF((PyObject *)__pyx_v_mat);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_restriction);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":327
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_CreateFieldDecomposition( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscInt *clen,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateFieldDecomposition(DM __pyx_v_dm, PetscInt *__pyx_v_clen, char ***__pyx_v_namelist, IS **__pyx_v_islist, DM **__pyx_v_dmlist) {
struct PyPetscDMObject *__pyx_v_Dm = 0;
int __pyx_v_i;
char const *__pyx_v_cname;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_decomp = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PyObject *__pyx_v_names = NULL;
PyObject *__pyx_v_ises = NULL;
PyObject *__pyx_v_dms = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
PyObject *__pyx_t_9 = NULL;
Py_ssize_t __pyx_t_10;
PetscErrorCode __pyx_t_11;
Py_ssize_t __pyx_t_12;
int __pyx_t_13;
IS __pyx_t_14;
DM __pyx_t_15;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_CreateFieldDecomposition", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":333
* PetscIS **islist,
* PetscDM **dmlist) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<<
* cdef int i
* cdef const char *cname = NULL
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 333, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 333, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 333, __pyx_L1_error)
__pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":335
* cdef DM Dm = subtype_DM(dm)()
* cdef int i
* cdef const char *cname = NULL # <<<<<<<<<<<<<<
* Dm.dm = dm
* PetscINCREF(Dm.obj)
*/
__pyx_v_cname = NULL;
/* "petsc4py/PETSc/petscdmshell.pxi":336
* cdef int i
* cdef const char *cname = NULL
* Dm.dm = dm # <<<<<<<<<<<<<<
* 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
* PetscINCREF(Dm.obj) # <<<<<<<<<<<<<<
* context = Dm.get_attr('__create_field_decomp__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":338
* Dm.dm = dm
* PetscINCREF(Dm.obj)
* context = Dm.get_attr('__create_field_decomp__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (decomp, args, kargs) = context
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_field_decomp__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 338, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_context = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":339
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 339, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":340
* context = Dm.get_attr('__create_field_decomp__')
* assert context is not None and type(context) is tuple
* (decomp, args, kargs) = context # <<<<<<<<<<<<<<
* names, ises, dms = decomp(Dm, *args, **kargs)
*
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 340, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 340, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 340, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 340, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_decomp = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":341
* assert context is not None and type(context) is tuple
* (decomp, args, kargs) = context
* names, ises, dms = decomp(Dm, *args, **kargs) # <<<<<<<<<<<<<<
*
* if clen != NULL:
*/
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Dm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dm));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm));
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 341, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
__pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_decomp, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
PyObject* sequence = __pyx_t_6;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 341, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_2 = PyList_GET_ITEM(sequence, 1);
__pyx_t_7 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_7);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_9)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 2; __pyx_t_7 = __pyx_t_8(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_9), 3) < 0) __PYX_ERR(29, 341, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L8_unpacking_done;
__pyx_L7_unpacking_failed:;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 341, __pyx_L1_error)
__pyx_L8_unpacking_done:;
}
__pyx_v_names = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_ises = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_dms = __pyx_t_7;
__pyx_t_7 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":343
* names, ises, dms = decomp(Dm, *args, **kargs)
*
* if clen != NULL: # <<<<<<<<<<<<<<
* if names is not None:
* clen[0] = <PetscInt>len(names)
*/
__pyx_t_3 = ((__pyx_v_clen != NULL) != 0);
if (__pyx_t_3) {
/* "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_3 = (__pyx_v_names != Py_None);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* "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_10 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 345, __pyx_L1_error)
(__pyx_v_clen[0]) = ((PetscInt)__pyx_t_10);
/* "petsc4py/PETSc/petscdmshell.pxi":344
*
* if clen != NULL:
* if names is not None: # <<<<<<<<<<<<<<
* clen[0] = <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_4 = (__pyx_v_ises != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
/* "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_10 = PyObject_Length(__pyx_v_ises); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 347, __pyx_L1_error)
(__pyx_v_clen[0]) = ((PetscInt)__pyx_t_10);
/* "petsc4py/PETSc/petscdmshell.pxi":346
* if names is not None:
* clen[0] = <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_3 = (__pyx_v_dms != Py_None);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* "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_10 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 349, __pyx_L1_error)
(__pyx_v_clen[0]) = ((PetscInt)__pyx_t_10);
/* "petsc4py/PETSc/petscdmshell.pxi":348
* elif ises is not None:
* clen[0] = <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_3 = ((__pyx_v_namelist != NULL) != 0);
if (__pyx_t_3) {
} else {
__pyx_t_4 = __pyx_t_3;
goto __pyx_L12_bool_binop_done;
}
__pyx_t_3 = (__pyx_v_names != Py_None);
__pyx_t_5 = (__pyx_t_3 != 0);
__pyx_t_4 = __pyx_t_5;
__pyx_L12_bool_binop_done:;
if (__pyx_t_4) {
/* "petsc4py/PETSc/petscdmshell.pxi":354
*
* if namelist != NULL and names is not None:
* CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) # <<<<<<<<<<<<<<
* for i in range(len(names)):
* names[i] = str2bytes(names[i], &cname)
*/
__pyx_t_10 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 354, __pyx_L1_error)
__pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_10 * (sizeof(char **))), __pyx_v_namelist)); if (unlikely(__pyx_t_11 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 354, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":355
* if namelist != NULL and names is not None:
* CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) )
* for i in range(len(names)): # <<<<<<<<<<<<<<
* names[i] = str2bytes(names[i], &cname)
* CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) )
*/
__pyx_t_10 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 355, __pyx_L1_error)
__pyx_t_12 = __pyx_t_10;
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_6 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_6, (&__pyx_v_cname)); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(__Pyx_SetItemInt(__pyx_v_names, __pyx_v_i, __pyx_t_7, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(29, 356, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":357
* for i in range(len(names)):
* names[i] = str2bytes(names[i], &cname)
* CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) # <<<<<<<<<<<<<<
*
* if islist != NULL and ises is not None:
*/
__pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscStrallocpy(__pyx_v_cname, (&((__pyx_v_namelist[0])[__pyx_v_i])))); if (unlikely(__pyx_t_11 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 357, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscdmshell.pxi":353
* clen[0] = 0
*
* if namelist != NULL and names is not None: # <<<<<<<<<<<<<<
* CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) )
* for i in range(len(names)):
*/
}
/* "petsc4py/PETSc/petscdmshell.pxi":359
* CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) )
*
* if islist != NULL and ises is not None: # <<<<<<<<<<<<<<
* CHKERR( PetscMalloc(len(ises)*sizeof(PetscIS), islist) )
* for i in range(len(ises)):
*/
__pyx_t_5 = ((__pyx_v_islist != NULL) != 0);
if (__pyx_t_5) {
} else {
__pyx_t_4 = __pyx_t_5;
goto __pyx_L17_bool_binop_done;
}
__pyx_t_5 = (__pyx_v_ises != Py_None);
__pyx_t_3 = (__pyx_t_5 != 0);
__pyx_t_4 = __pyx_t_3;
__pyx_L17_bool_binop_done:;
if (__pyx_t_4) {
/* "petsc4py/PETSc/petscdmshell.pxi":360
*
* if islist != NULL and ises is not None:
* CHKERR( PetscMalloc(len(ises)*sizeof(PetscIS), islist) ) # <<<<<<<<<<<<<<
* for i in range(len(ises)):
* islist[0][i] = (<IS?>ises[i]).iset
*/
__pyx_t_10 = PyObject_Length(__pyx_v_ises); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 360, __pyx_L1_error)
__pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_10 * (sizeof(IS))), __pyx_v_islist)); if (unlikely(__pyx_t_11 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 360, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":361
* if islist != NULL and ises is not None:
* CHKERR( PetscMalloc(len(ises)*sizeof(PetscIS), islist) )
* for i in range(len(ises)): # <<<<<<<<<<<<<<
* islist[0][i] = (<IS?>ises[i]).iset
* PetscINCREF((<IS?>ises[i]).obj)
*/
__pyx_t_10 = PyObject_Length(__pyx_v_ises); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 361, __pyx_L1_error)
__pyx_t_12 = __pyx_t_10;
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 # <<<<<<<<<<<<<<
* PetscINCREF((<IS?>ises[i]).obj)
*
*/
__pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 362, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(29, 362, __pyx_L1_error)
__pyx_t_14 = ((struct PyPetscISObject *)__pyx_t_7)->iset;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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
* PetscINCREF((<IS?>ises[i]).obj) # <<<<<<<<<<<<<<
*
* if dmlist != NULL and dms is not None:
*/
__pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 363, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(29, 363, __pyx_L1_error)
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscISObject *)__pyx_t_7)->__pyx_base.obj));
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
/* "petsc4py/PETSc/petscdmshell.pxi":359
* CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) )
*
* if islist != NULL and ises is not None: # <<<<<<<<<<<<<<
* CHKERR( PetscMalloc(len(ises)*sizeof(PetscIS), islist) )
* for i in range(len(ises)):
*/
}
/* "petsc4py/PETSc/petscdmshell.pxi":365
* 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_3 = ((__pyx_v_dmlist != NULL) != 0);
if (__pyx_t_3) {
} else {
__pyx_t_4 = __pyx_t_3;
goto __pyx_L22_bool_binop_done;
}
__pyx_t_3 = (__pyx_v_dms != Py_None);
__pyx_t_5 = (__pyx_t_3 != 0);
__pyx_t_4 = __pyx_t_5;
__pyx_L22_bool_binop_done:;
if (__pyx_t_4) {
/* "petsc4py/PETSc/petscdmshell.pxi":366
*
* if dmlist != NULL and dms is not None:
* CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) # <<<<<<<<<<<<<<
* for i in range(len(dms)):
* dmlist[0][i] = (<DM?>dms[i]).dm
*/
__pyx_t_10 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 366, __pyx_L1_error)
__pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_10 * (sizeof(DM))), __pyx_v_dmlist)); if (unlikely(__pyx_t_11 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 366, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":367
* if dmlist != NULL and dms is not None:
* CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) )
* for i in range(len(dms)): # <<<<<<<<<<<<<<
* dmlist[0][i] = (<DM?>dms[i]).dm
* PetscINCREF((<DM?>dms[i]).obj)
*/
__pyx_t_10 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(29, 367, __pyx_L1_error)
__pyx_t_12 = __pyx_t_10;
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 # <<<<<<<<<<<<<<
* PetscINCREF((<DM?>dms[i]).obj)
* return PETSC_SUCCESS
*/
__pyx_t_7 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 368, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(29, 368, __pyx_L1_error)
__pyx_t_15 = ((struct PyPetscDMObject *)__pyx_t_7)->dm;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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
* PetscINCREF((<DM?>dms[i]).obj) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_7 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(29, 369, __pyx_L1_error)
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscDMObject *)__pyx_t_7)->__pyx_base.obj));
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
/* "petsc4py/PETSc/petscdmshell.pxi":365
* 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
* 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_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateFieldDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dm);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_decomp);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_XDECREF(__pyx_v_names);
__Pyx_XDECREF(__pyx_v_ises);
__Pyx_XDECREF(__pyx_v_dms);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":372
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_CreateDomainDecomposition( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscInt *clen,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateDomainDecomposition(DM __pyx_v_dm, PetscInt *__pyx_v_clen, char ***__pyx_v_namelist, IS **__pyx_v_innerislist, IS **__pyx_v_outerislist, DM **__pyx_v_dmlist) {
struct PyPetscDMObject *__pyx_v_Dm = 0;
int __pyx_v_i;
char const *__pyx_v_cname;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_decomp = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PyObject *__pyx_v_names = NULL;
PyObject *__pyx_v_innerises = NULL;
PyObject *__pyx_v_outerises = NULL;
PyObject *__pyx_v_dms = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
Py_ssize_t __pyx_t_11;
PetscErrorCode __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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_CreateDomainDecomposition", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":379
* PetscIS **outerislist,
* PetscDM **dmlist) except PETSC_ERR_PYTHON with gil:
* cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<<
* cdef int i
* cdef const char *cname = NULL
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 379, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 379, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 379, __pyx_L1_error)
__pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":381
* cdef DM Dm = subtype_DM(dm)()
* cdef int i
* cdef const char *cname = NULL # <<<<<<<<<<<<<<
* Dm.dm = dm
* PetscINCREF(Dm.obj)
*/
__pyx_v_cname = NULL;
/* "petsc4py/PETSc/petscdmshell.pxi":382
* cdef int i
* cdef const char *cname = NULL
* Dm.dm = dm # <<<<<<<<<<<<<<
* 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
* PetscINCREF(Dm.obj) # <<<<<<<<<<<<<<
* context = Dm.get_attr('__create_domain_decomp__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":384
* Dm.dm = dm
* PetscINCREF(Dm.obj)
* context = Dm.get_attr('__create_domain_decomp__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (decomp, args, kargs) = context
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_domain_decomp__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 384, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_context = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":385
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 385, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":386
* context = Dm.get_attr('__create_domain_decomp__')
* assert context is not None and type(context) is tuple
* (decomp, args, kargs) = context # <<<<<<<<<<<<<<
* names, innerises, outerises, dms = decomp(Dm, *args, **kargs)
*
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 386, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 386, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 386, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_decomp = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":387
* assert context is not None and type(context) is tuple
* (decomp, args, kargs) = context
* names, innerises, outerises, dms = decomp(Dm, *args, **kargs) # <<<<<<<<<<<<<<
*
* if clen != NULL:
*/
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_Dm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dm));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm));
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 387, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
__pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_decomp, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
PyObject* sequence = __pyx_t_6;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 4)) {
if (size > 4) __Pyx_RaiseTooManyValuesError(4);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 387, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 3);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_2 = PyList_GET_ITEM(sequence, 1);
__pyx_t_7 = PyList_GET_ITEM(sequence, 2);
__pyx_t_9 = PyList_GET_ITEM(sequence, 3);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_9);
#else
{
Py_ssize_t i;
PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_7,&__pyx_t_9};
for (i=0; i < 4; i++) {
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(29, 387, __pyx_L1_error)
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
}
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
Py_ssize_t index = -1;
PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_7,&__pyx_t_9};
__pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(29, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_10)->tp_iternext;
for (index=0; index < 4; index++) {
PyObject* item = __pyx_t_8(__pyx_t_10); if (unlikely(!item)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_10), 4) < 0) __PYX_ERR(29, 387, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L8_unpacking_done;
__pyx_L7_unpacking_failed:;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 387, __pyx_L1_error)
__pyx_L8_unpacking_done:;
}
__pyx_v_names = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_innerises = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_outerises = __pyx_t_7;
__pyx_t_7 = 0;
__pyx_v_dms = __pyx_t_9;
__pyx_t_9 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":389
* names, innerises, outerises, dms = decomp(Dm, *args, **kargs)
*
* if clen != NULL: # <<<<<<<<<<<<<<
* if names is not None:
* clen[0] = <PetscInt>len(names)
*/
__pyx_t_3 = ((__pyx_v_clen != NULL) != 0);
if (__pyx_t_3) {
/* "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_3 = (__pyx_v_names != Py_None);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* "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_11 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 391, __pyx_L1_error)
(__pyx_v_clen[0]) = ((PetscInt)__pyx_t_11);
/* "petsc4py/PETSc/petscdmshell.pxi":390
*
* if clen != NULL:
* if names is not None: # <<<<<<<<<<<<<<
* clen[0] = <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_4 = (__pyx_v_innerises != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
/* "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_11 = PyObject_Length(__pyx_v_innerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 393, __pyx_L1_error)
(__pyx_v_clen[0]) = ((PetscInt)__pyx_t_11);
/* "petsc4py/PETSc/petscdmshell.pxi":392
* if names is not None:
* clen[0] = <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_3 = (__pyx_v_outerises != Py_None);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* "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_11 = PyObject_Length(__pyx_v_outerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 395, __pyx_L1_error)
(__pyx_v_clen[0]) = ((PetscInt)__pyx_t_11);
/* "petsc4py/PETSc/petscdmshell.pxi":394
* elif innerises is not None:
* clen[0] = <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_4 = (__pyx_v_dms != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
/* "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_11 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 397, __pyx_L1_error)
(__pyx_v_clen[0]) = ((PetscInt)__pyx_t_11);
/* "petsc4py/PETSc/petscdmshell.pxi":396
* elif outerises is not None:
* clen[0] = <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_4 = ((__pyx_v_namelist != NULL) != 0);
if (__pyx_t_4) {
} else {
__pyx_t_3 = __pyx_t_4;
goto __pyx_L12_bool_binop_done;
}
__pyx_t_4 = (__pyx_v_names != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
__pyx_t_3 = __pyx_t_5;
__pyx_L12_bool_binop_done:;
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscdmshell.pxi":402
*
* if namelist != NULL and names is not None:
* CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) # <<<<<<<<<<<<<<
* for i in range(len(names)):
* names[i] = str2bytes(names[i], &cname)
*/
__pyx_t_11 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 402, __pyx_L1_error)
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_11 * (sizeof(char **))), __pyx_v_namelist)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 402, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":403
* if namelist != NULL and names is not None:
* CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) )
* for i in range(len(names)): # <<<<<<<<<<<<<<
* names[i] = str2bytes(names[i], &cname)
* CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) )
*/
__pyx_t_11 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 403, __pyx_L1_error)
__pyx_t_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/petscdmshell.pxi":404
* CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) )
* for i in range(len(names)):
* names[i] = str2bytes(names[i], &cname) # <<<<<<<<<<<<<<
* CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) )
*
*/
__pyx_t_6 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_6, (&__pyx_v_cname)); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(__Pyx_SetItemInt(__pyx_v_names, __pyx_v_i, __pyx_t_9, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(29, 404, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":405
* for i in range(len(names)):
* names[i] = str2bytes(names[i], &cname)
* CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) # <<<<<<<<<<<<<<
*
* if innerislist != NULL and innerises is not None:
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscStrallocpy(__pyx_v_cname, (&((__pyx_v_namelist[0])[__pyx_v_i])))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 405, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscdmshell.pxi":401
* clen[0] = 0
*
* if namelist != NULL and names is not None: # <<<<<<<<<<<<<<
* CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) )
* for i in range(len(names)):
*/
}
/* "petsc4py/PETSc/petscdmshell.pxi":407
* CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) )
*
* if innerislist != NULL and innerises is not None: # <<<<<<<<<<<<<<
* CHKERR( PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist) )
* for i in range(len(innerises)):
*/
__pyx_t_5 = ((__pyx_v_innerislist != NULL) != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L17_bool_binop_done;
}
__pyx_t_5 = (__pyx_v_innerises != Py_None);
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L17_bool_binop_done:;
if (__pyx_t_3) {
/* "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_11 = PyObject_Length(__pyx_v_innerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 408, __pyx_L1_error)
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_11 * (sizeof(IS))), __pyx_v_innerislist)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 408, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":409
* if innerislist != NULL and innerises is not None:
* CHKERR( PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist) )
* for i in range(len(innerises)): # <<<<<<<<<<<<<<
* innerislist[0][i] = (<IS?>innerises[i]).iset
* PetscINCREF((<IS?>innerises[i]).obj)
*/
__pyx_t_11 = PyObject_Length(__pyx_v_innerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 409, __pyx_L1_error)
__pyx_t_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/petscdmshell.pxi":410
* CHKERR( PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist) )
* for i in range(len(innerises)):
* innerislist[0][i] = (<IS?>innerises[i]).iset # <<<<<<<<<<<<<<
* PetscINCREF((<IS?>innerises[i]).obj)
*
*/
__pyx_t_9 = __Pyx_GetItemInt(__pyx_v_innerises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(29, 410, __pyx_L1_error)
__pyx_t_15 = ((struct PyPetscISObject *)__pyx_t_9)->iset;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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
* PetscINCREF((<IS?>innerises[i]).obj) # <<<<<<<<<<<<<<
*
* if outerislist != NULL and outerises is not None:
*/
__pyx_t_9 = __Pyx_GetItemInt(__pyx_v_innerises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(29, 411, __pyx_L1_error)
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscISObject *)__pyx_t_9)->__pyx_base.obj));
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
/* "petsc4py/PETSc/petscdmshell.pxi":407
* CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) )
*
* if innerislist != NULL and innerises is not None: # <<<<<<<<<<<<<<
* CHKERR( PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist) )
* for i in range(len(innerises)):
*/
}
/* "petsc4py/PETSc/petscdmshell.pxi":413
* 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_4 = ((__pyx_v_outerislist != NULL) != 0);
if (__pyx_t_4) {
} else {
__pyx_t_3 = __pyx_t_4;
goto __pyx_L22_bool_binop_done;
}
__pyx_t_4 = (__pyx_v_outerises != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
__pyx_t_3 = __pyx_t_5;
__pyx_L22_bool_binop_done:;
if (__pyx_t_3) {
/* "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_11 = PyObject_Length(__pyx_v_outerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 414, __pyx_L1_error)
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_11 * (sizeof(IS))), __pyx_v_outerislist)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 414, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":415
* if outerislist != NULL and outerises is not None:
* CHKERR( PetscMalloc(len(outerises)*sizeof(PetscIS), outerislist) )
* for i in range(len(outerises)): # <<<<<<<<<<<<<<
* outerislist[0][i] = (<IS?>outerises[i]).iset
* PetscINCREF((<IS?>outerises[i]).obj)
*/
__pyx_t_11 = PyObject_Length(__pyx_v_outerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 415, __pyx_L1_error)
__pyx_t_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/petscdmshell.pxi":416
* CHKERR( PetscMalloc(len(outerises)*sizeof(PetscIS), outerislist) )
* for i in range(len(outerises)):
* outerislist[0][i] = (<IS?>outerises[i]).iset # <<<<<<<<<<<<<<
* PetscINCREF((<IS?>outerises[i]).obj)
*
*/
__pyx_t_9 = __Pyx_GetItemInt(__pyx_v_outerises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(29, 416, __pyx_L1_error)
__pyx_t_15 = ((struct PyPetscISObject *)__pyx_t_9)->iset;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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
* PetscINCREF((<IS?>outerises[i]).obj) # <<<<<<<<<<<<<<
*
* if dmlist != NULL and dms is not None:
*/
__pyx_t_9 = __Pyx_GetItemInt(__pyx_v_outerises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 417, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(29, 417, __pyx_L1_error)
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscISObject *)__pyx_t_9)->__pyx_base.obj));
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
/* "petsc4py/PETSc/petscdmshell.pxi":413
* 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
* 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_5 = ((__pyx_v_dmlist != NULL) != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L27_bool_binop_done;
}
__pyx_t_5 = (__pyx_v_dms != Py_None);
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L27_bool_binop_done:;
if (__pyx_t_3) {
/* "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_11 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 420, __pyx_L1_error)
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_11 * (sizeof(DM))), __pyx_v_dmlist)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 420, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":421
* if dmlist != NULL and dms is not None:
* CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) )
* for i in range(len(dms)): # <<<<<<<<<<<<<<
* dmlist[0][i] = (<DM?>dms[i]).dm
* PetscINCREF((<DM?>dms[i]).obj)
*/
__pyx_t_11 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(29, 421, __pyx_L1_error)
__pyx_t_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/petscdmshell.pxi":422
* CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) )
* for i in range(len(dms)):
* dmlist[0][i] = (<DM?>dms[i]).dm # <<<<<<<<<<<<<<
* PetscINCREF((<DM?>dms[i]).obj)
* return PETSC_SUCCESS
*/
__pyx_t_9 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 422, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(29, 422, __pyx_L1_error)
__pyx_t_16 = ((struct PyPetscDMObject *)__pyx_t_9)->dm;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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
* PetscINCREF((<DM?>dms[i]).obj) # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*
*/
__pyx_t_9 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 423, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(29, 423, __pyx_L1_error)
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscDMObject *)__pyx_t_9)->__pyx_base.obj));
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
/* "petsc4py/PETSc/petscdmshell.pxi":419
* 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
* 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_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateDomainDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dm);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_decomp);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_XDECREF(__pyx_v_names);
__Pyx_XDECREF(__pyx_v_innerises);
__Pyx_XDECREF(__pyx_v_outerises);
__Pyx_XDECREF(__pyx_v_dms);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":426
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_CreateDomainDecompositionScatters( # <<<<<<<<<<<<<<
* PetscDM dm,
* PetscInt clen,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateDomainDecompositionScatters(DM __pyx_v_dm, PetscInt __pyx_v_clen, DM *__pyx_v_subdms, VecScatter **__pyx_v_iscat, VecScatter **__pyx_v_oscat, VecScatter **__pyx_v_gscat) {
struct PyPetscDMObject *__pyx_v_Dm = 0;
int __pyx_v_i;
CYTHON_UNUSED char const *__pyx_v_cname;
struct PyPetscDMObject *__pyx_v_subdm = 0;
PyObject *__pyx_v_psubdms = NULL;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_scatters = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PyObject *__pyx_v_iscatter = NULL;
PyObject *__pyx_v_oscatter = NULL;
PyObject *__pyx_v_gscatter = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PetscInt __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
int __pyx_t_6;
int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *(*__pyx_t_10)(PyObject *);
PyObject *__pyx_t_11 = NULL;
Py_ssize_t __pyx_t_12;
PetscErrorCode __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;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_CreateDomainDecompositionScatters", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":434
* PetscScatter** gscat) except PETSC_ERR_PYTHON with gil:
*
* cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<<
* cdef int i
* cdef const char *cname = NULL
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 434, __pyx_L1_error)
__pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":436
* cdef DM Dm = subtype_DM(dm)()
* cdef int i
* cdef const char *cname = NULL # <<<<<<<<<<<<<<
* cdef DM subdm = None
*
*/
__pyx_v_cname = NULL;
/* "petsc4py/PETSc/petscdmshell.pxi":437
* cdef int i
* cdef const char *cname = NULL
* cdef DM subdm = None # <<<<<<<<<<<<<<
*
* Dm.dm = dm
*/
__Pyx_INCREF(Py_None);
__pyx_v_subdm = ((struct PyPetscDMObject *)Py_None);
/* "petsc4py/PETSc/petscdmshell.pxi":439
* cdef DM subdm = None
*
* Dm.dm = dm # <<<<<<<<<<<<<<
* PetscINCREF(Dm.obj)
*
*/
__pyx_v_Dm->dm = __pyx_v_dm;
/* "petsc4py/PETSc/petscdmshell.pxi":440
*
* Dm.dm = dm
* PetscINCREF(Dm.obj) # <<<<<<<<<<<<<<
*
* psubdms = []
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":442
* PetscINCREF(Dm.obj)
*
* psubdms = [] # <<<<<<<<<<<<<<
* for i from 0 <= i < clen:
* subdm = subtype_DM(subdms[i])()
*/
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 442, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_psubdms = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":443
*
* psubdms = []
* for i from 0 <= i < clen: # <<<<<<<<<<<<<<
* subdm = subtype_DM(subdms[i])()
* subdm.dm = subdms[i]
*/
__pyx_t_3 = __pyx_v_clen;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
/* "petsc4py/PETSc/petscdmshell.pxi":444
* psubdms = []
* for i from 0 <= i < clen:
* subdm = subtype_DM(subdms[i])() # <<<<<<<<<<<<<<
* subdm.dm = subdms[i]
* PetscINCREF(subdm.obj)
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_subdms[__pyx_v_i]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 444, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 444, __pyx_L1_error)
__Pyx_DECREF_SET(__pyx_v_subdm, ((struct PyPetscDMObject *)__pyx_t_1));
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":445
* for i from 0 <= i < clen:
* subdm = subtype_DM(subdms[i])()
* subdm.dm = subdms[i] # <<<<<<<<<<<<<<
* PetscINCREF(subdm.obj)
* psubdms.append(subdm)
*/
__pyx_v_subdm->dm = (__pyx_v_subdms[__pyx_v_i]);
/* "petsc4py/PETSc/petscdmshell.pxi":446
* subdm = subtype_DM(subdms[i])()
* subdm.dm = subdms[i]
* PetscINCREF(subdm.obj) # <<<<<<<<<<<<<<
* psubdms.append(subdm)
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_subdm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":447
* subdm.dm = subdms[i]
* PetscINCREF(subdm.obj)
* psubdms.append(subdm) # <<<<<<<<<<<<<<
*
* context = Dm.get_attr('__create_domain_decomp_scatters__')
*/
__pyx_t_4 = __Pyx_PyList_Append(__pyx_v_psubdms, ((PyObject *)__pyx_v_subdm)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 447, __pyx_L1_error)
}
/* "petsc4py/PETSc/petscdmshell.pxi":449
* psubdms.append(subdm)
*
* context = Dm.get_attr('__create_domain_decomp_scatters__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (scatters, args, kargs) = context
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_domain_decomp_scatters__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 449, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_context = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":450
*
* context = Dm.get_attr('__create_domain_decomp_scatters__')
* assert context is not None and type(context) is tuple # <<<<<<<<<<<<<<
* (scatters, args, kargs) = context
* (iscatter, oscatter, gscatter) = scatters(Dm, psubdms, *args, **kargs)
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(__pyx_assertions_enabled())) {
__pyx_t_6 = (__pyx_v_context != Py_None);
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
} else {
__pyx_t_5 = __pyx_t_7;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_6 = (__pyx_t_7 != 0);
__pyx_t_5 = __pyx_t_6;
__pyx_L5_bool_binop_done:;
if (unlikely(!__pyx_t_5)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 450, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":451
* context = Dm.get_attr('__create_domain_decomp_scatters__')
* assert context is not None and type(context) is tuple
* (scatters, args, kargs) = context # <<<<<<<<<<<<<<
* (iscatter, oscatter, gscatter) = scatters(Dm, psubdms, *args, **kargs)
*
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 451, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_2 = PyList_GET_ITEM(sequence, 1);
__pyx_t_8 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_8);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 451, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 451, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 451, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_9 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 451, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_2 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_8);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(29, 451, __pyx_L1_error)
__pyx_t_10 = NULL;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L8_unpacking_done;
__pyx_L7_unpacking_failed:;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_10 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 451, __pyx_L1_error)
__pyx_L8_unpacking_done:;
}
__pyx_v_scatters = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_args = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_kargs = __pyx_t_8;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":452
* assert context is not None and type(context) is tuple
* (scatters, args, kargs) = context
* (iscatter, oscatter, gscatter) = scatters(Dm, psubdms, *args, **kargs) # <<<<<<<<<<<<<<
*
* assert len(iscatter) == clen
*/
__pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(((PyObject *)__pyx_v_Dm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_Dm));
PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_Dm));
__Pyx_INCREF(__pyx_v_psubdms);
__Pyx_GIVEREF(__pyx_v_psubdms);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_psubdms);
__pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PyNumber_Add(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 452, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_2 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
} else {
__pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_scatters, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
PyObject* sequence = __pyx_t_8;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 452, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_9 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_9);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(29, 452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
#endif
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(29, 452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_10 = Py_TYPE(__pyx_t_11)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_11); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_9 = __pyx_t_10(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L9_unpacking_failed;
__Pyx_GOTREF(__pyx_t_9);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_11), 3) < 0) __PYX_ERR(29, 452, __pyx_L1_error)
__pyx_t_10 = NULL;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
goto __pyx_L10_unpacking_done;
__pyx_L9_unpacking_failed:;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_10 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 452, __pyx_L1_error)
__pyx_L10_unpacking_done:;
}
__pyx_v_iscatter = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_oscatter = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_gscatter = __pyx_t_9;
__pyx_t_9 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":454
* (iscatter, oscatter, gscatter) = scatters(Dm, psubdms, *args, **kargs)
*
* assert len(iscatter) == clen # <<<<<<<<<<<<<<
* assert len(oscatter) == clen
* assert len(gscatter) == clen
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(__pyx_assertions_enabled())) {
__pyx_t_12 = PyObject_Length(__pyx_v_iscatter); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(29, 454, __pyx_L1_error)
if (unlikely(!((__pyx_t_12 == __pyx_v_clen) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 454, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":455
*
* assert len(iscatter) == clen
* assert len(oscatter) == clen # <<<<<<<<<<<<<<
* assert len(gscatter) == clen
*
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(__pyx_assertions_enabled())) {
__pyx_t_12 = PyObject_Length(__pyx_v_oscatter); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(29, 455, __pyx_L1_error)
if (unlikely(!((__pyx_t_12 == __pyx_v_clen) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 455, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":456
* assert len(iscatter) == clen
* assert len(oscatter) == clen
* assert len(gscatter) == clen # <<<<<<<<<<<<<<
*
* CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), iscat) )
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(__pyx_assertions_enabled())) {
__pyx_t_12 = PyObject_Length(__pyx_v_gscatter); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(29, 456, __pyx_L1_error)
if (unlikely(!((__pyx_t_12 == __pyx_v_clen) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 456, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":458
* assert len(gscatter) == clen
*
* CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), iscat) ) # <<<<<<<<<<<<<<
* CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), oscat) )
* CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), gscat) )
*/
__pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_v_clen * (sizeof(VecScatter))), __pyx_v_iscat)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 458, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":459
*
* CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), iscat) )
* CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), oscat) ) # <<<<<<<<<<<<<<
* CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), gscat) )
*
*/
__pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_v_clen * (sizeof(VecScatter))), __pyx_v_oscat)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 459, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":460
* CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), iscat) )
* CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), oscat) )
* CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), gscat) ) # <<<<<<<<<<<<<<
*
* for i in range(clen):
*/
__pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_v_clen * (sizeof(VecScatter))), __pyx_v_gscat)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(29, 460, __pyx_L1_error)
/* "petsc4py/PETSc/petscdmshell.pxi":462
* CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), gscat) )
*
* for i in range(clen): # <<<<<<<<<<<<<<
* iscat[0][i] = (<Scatter?>iscatter[i]).sct
* PetscINCREF((<Scatter?>iscatter[i]).obj)
*/
__pyx_t_3 = __pyx_v_clen;
__pyx_t_14 = __pyx_t_3;
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":463
*
* for i in range(clen):
* iscat[0][i] = (<Scatter?>iscatter[i]).sct # <<<<<<<<<<<<<<
* PetscINCREF((<Scatter?>iscatter[i]).obj)
*
*/
__pyx_t_8 = __Pyx_GetItemInt(__pyx_v_iscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 463, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(29, 463, __pyx_L1_error)
__pyx_t_16 = ((struct PyPetscScatterObject *)__pyx_t_8)->sct;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
((__pyx_v_iscat[0])[__pyx_v_i]) = __pyx_t_16;
/* "petsc4py/PETSc/petscdmshell.pxi":464
* for i in range(clen):
* iscat[0][i] = (<Scatter?>iscatter[i]).sct
* PetscINCREF((<Scatter?>iscatter[i]).obj) # <<<<<<<<<<<<<<
*
* oscat[0][i] = (<Scatter?>oscatter[i]).sct
*/
__pyx_t_8 = __Pyx_GetItemInt(__pyx_v_iscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(29, 464, __pyx_L1_error)
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscScatterObject *)__pyx_t_8)->__pyx_base.obj));
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":466
* PetscINCREF((<Scatter?>iscatter[i]).obj)
*
* oscat[0][i] = (<Scatter?>oscatter[i]).sct # <<<<<<<<<<<<<<
* PetscINCREF((<Scatter?>oscatter[i]).obj)
*
*/
__pyx_t_8 = __Pyx_GetItemInt(__pyx_v_oscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 466, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(29, 466, __pyx_L1_error)
__pyx_t_16 = ((struct PyPetscScatterObject *)__pyx_t_8)->sct;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
((__pyx_v_oscat[0])[__pyx_v_i]) = __pyx_t_16;
/* "petsc4py/PETSc/petscdmshell.pxi":467
*
* oscat[0][i] = (<Scatter?>oscatter[i]).sct
* PetscINCREF((<Scatter?>oscatter[i]).obj) # <<<<<<<<<<<<<<
*
* gscat[0][i] = (<Scatter?>gscatter[i]).sct
*/
__pyx_t_8 = __Pyx_GetItemInt(__pyx_v_oscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(29, 467, __pyx_L1_error)
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscScatterObject *)__pyx_t_8)->__pyx_base.obj));
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":469
* PetscINCREF((<Scatter?>oscatter[i]).obj)
*
* gscat[0][i] = (<Scatter?>gscatter[i]).sct # <<<<<<<<<<<<<<
* PetscINCREF((<Scatter?>gscatter[i]).obj)
*
*/
__pyx_t_8 = __Pyx_GetItemInt(__pyx_v_gscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 469, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(29, 469, __pyx_L1_error)
__pyx_t_16 = ((struct PyPetscScatterObject *)__pyx_t_8)->sct;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
((__pyx_v_gscat[0])[__pyx_v_i]) = __pyx_t_16;
/* "petsc4py/PETSc/petscdmshell.pxi":470
*
* gscat[0][i] = (<Scatter?>gscatter[i]).sct
* PetscINCREF((<Scatter?>gscatter[i]).obj) # <<<<<<<<<<<<<<
*
* return PETSC_SUCCESS
*/
__pyx_t_8 = __Pyx_GetItemInt(__pyx_v_gscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(29, 470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(29, 470, __pyx_L1_error)
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscScatterObject *)__pyx_t_8)->__pyx_base.obj));
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
/* "petsc4py/PETSc/petscdmshell.pxi":472
* 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_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateDomainDecompositionScatters", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_Dm);
__Pyx_XDECREF((PyObject *)__pyx_v_subdm);
__Pyx_XDECREF(__pyx_v_psubdms);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_scatters);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_XDECREF(__pyx_v_iscatter);
__Pyx_XDECREF(__pyx_v_oscatter);
__Pyx_XDECREF(__pyx_v_gscatter);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscdmshell.pxi":474
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_CreateSubDM( # <<<<<<<<<<<<<<
* PetscDM cdm,
* PetscInt numFields,
*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateSubDM(DM __pyx_v_cdm, PetscInt __pyx_v_numFields, PetscInt const *__pyx_v_cfields, IS *__pyx_v_ciset, DM *__pyx_v_csubdm) {
struct PyPetscDMObject *__pyx_v_dm = 0;
struct PyPetscISObject *__pyx_v_iset = 0;
struct PyPetscDMObject *__pyx_v_subdm = 0;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_v_create_subdm = NULL;
PyObject *__pyx_v_args = NULL;
PyObject *__pyx_v_kargs = NULL;
PyArrayObject *__pyx_v_fields = NULL;
PetscErrorCode __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *(*__pyx_t_8)(PyObject *);
IS __pyx_t_9;
DM __pyx_t_10;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
#endif
__Pyx_RefNannySetupContext("DMSHELL_CreateSubDM", 0);
/* "petsc4py/PETSc/petscdmshell.pxi":480
* PetscIS *ciset,
* PetscDM *csubdm) except PETSC_ERR_PYTHON with gil:
* cdef DM dm = subtype_DM(cdm)() # <<<<<<<<<<<<<<
* cdef IS iset
* cdef DM subdm
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_cdm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 480, __pyx_L1_error)
__pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":483
* cdef IS iset
* cdef DM subdm
* dm.dm = cdm # <<<<<<<<<<<<<<
* PetscINCREF(dm.obj)
* context = dm.get_attr('__create_subdm__')
*/
__pyx_v_dm->dm = __pyx_v_cdm;
/* "petsc4py/PETSc/petscdmshell.pxi":484
* cdef DM subdm
* dm.dm = cdm
* PetscINCREF(dm.obj) # <<<<<<<<<<<<<<
* context = dm.get_attr('__create_subdm__')
* assert context is not None and type(context) is tuple
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":485
* dm.dm = cdm
* PetscINCREF(dm.obj)
* context = dm.get_attr('__create_subdm__') # <<<<<<<<<<<<<<
* assert context is not None and type(context) is tuple
* (create_subdm, args, kargs) = context
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_dm), ((char *)"__create_subdm__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 485, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_context = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":486
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L3_bool_binop_done;
}
__pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
__pyx_t_4 = (__pyx_t_5 != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L3_bool_binop_done:;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(29, 486, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/petscdmshell.pxi":487
* context = dm.get_attr('__create_subdm__')
* assert context is not None and type(context) is tuple
* (create_subdm, args, kargs) = context # <<<<<<<<<<<<<<
*
* fields = array_i(numFields, cfields)
*/
if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) {
PyObject* sequence = __pyx_v_context;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 487, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 487, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 487, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 487, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
#endif
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 487, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(29, 487, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 487, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__pyx_v_create_subdm = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_v_args = __pyx_t_1;
__pyx_t_1 = 0;
__pyx_v_kargs = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":489
* (create_subdm, args, kargs) = context
*
* fields = array_i(numFields, cfields) # <<<<<<<<<<<<<<
*
* iset, subdm = create_subdm(dm, fields, *args, **kargs)
*/
__pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_numFields, __pyx_v_cfields)); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 489, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_v_fields = ((PyArrayObject *)__pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":491
* fields = array_i(numFields, cfields)
*
* iset, subdm = create_subdm(dm, fields, *args, **kargs) # <<<<<<<<<<<<<<
*
* PetscINCREF(iset.obj)
*/
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 491, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_v_dm));
__Pyx_GIVEREF(((PyObject *)__pyx_v_dm));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_dm));
__Pyx_INCREF(((PyObject *)__pyx_v_fields));
__Pyx_GIVEREF(((PyObject *)__pyx_v_fields));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_fields));
__pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 491, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 491, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__pyx_v_kargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
__PYX_ERR(29, 491, __pyx_L1_error)
}
if (likely(PyDict_CheckExact(__pyx_v_kargs))) {
__pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 491, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
__pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 491, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_create_subdm, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 491, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
PyObject* sequence = __pyx_t_6;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(29, 491, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_2 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 491, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 491, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 491, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(29, 491, __pyx_L1_error)
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L8_unpacking_done;
__pyx_L7_unpacking_failed:;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(29, 491, __pyx_L1_error)
__pyx_L8_unpacking_done:;
}
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(29, 491, __pyx_L1_error)
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(29, 491, __pyx_L1_error)
__pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
__pyx_v_subdm = ((struct PyPetscDMObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/petscdmshell.pxi":493
* iset, subdm = create_subdm(dm, fields, *args, **kargs)
*
* PetscINCREF(iset.obj) # <<<<<<<<<<<<<<
* PetscINCREF(subdm.obj)
* ciset[0] = iset.iset
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_iset->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":494
*
* PetscINCREF(iset.obj)
* PetscINCREF(subdm.obj) # <<<<<<<<<<<<<<
* ciset[0] = iset.iset
* csubdm[0] = subdm.dm
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_subdm->__pyx_base.obj));
/* "petsc4py/PETSc/petscdmshell.pxi":495
* PetscINCREF(iset.obj)
* PetscINCREF(subdm.obj)
* ciset[0] = iset.iset # <<<<<<<<<<<<<<
* csubdm[0] = subdm.dm
* return PETSC_SUCCESS
*/
__pyx_t_9 = __pyx_v_iset->iset;
(__pyx_v_ciset[0]) = __pyx_t_9;
/* "petsc4py/PETSc/petscdmshell.pxi":496
* PetscINCREF(subdm.obj)
* ciset[0] = iset.iset
* csubdm[0] = subdm.dm # <<<<<<<<<<<<<<
* return PETSC_SUCCESS
*/
__pyx_t_10 = __pyx_v_subdm->dm;
(__pyx_v_csubdm[0]) = __pyx_t_10;
/* "petsc4py/PETSc/petscdmshell.pxi":497
* ciset[0] = iset.iset
* csubdm[0] = subdm.dm
* return PETSC_SUCCESS # <<<<<<<<<<<<<<
*/
__pyx_r = PETSC_SUCCESS;
goto __pyx_L0;
/* "petsc4py/PETSc/petscdmshell.pxi":474
* return PETSC_SUCCESS
*
* cdef PetscErrorCode DMSHELL_CreateSubDM( # <<<<<<<<<<<<<<
* PetscDM cdm,
* PetscInt numFields,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateSubDM", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = PETSC_ERR_PYTHON;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_dm);
__Pyx_XDECREF((PyObject *)__pyx_v_iset);
__Pyx_XDECREF((PyObject *)__pyx_v_subdm);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XDECREF(__pyx_v_create_subdm);
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_XDECREF((PyObject *)__pyx_v_fields);
__Pyx_RefNannyFinishContext();
#ifdef WITH_THREAD
__Pyx_PyGILState_Release(__pyx_gilstate_save);
#endif
return __pyx_r;
}
/* "petsc4py/PETSc/petscpyappctx.pxi":3
* cdef set appctx_registry = set()
*
* cdef inline object registerAppCtx(void *appctx): # <<<<<<<<<<<<<<
* cdef object key = <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_PyInt_FromSize_t(((Py_uintptr_t)__pyx_v_appctx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 4, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_key = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpyappctx.pxi":5
* cdef inline object registerAppCtx(void *appctx):
* cdef object key = <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(30, 5, __pyx_L1_error)
}
__pyx_t_2 = PySet_Add(__pyx_v_8petsc4py_5PETSc_appctx_registry, __pyx_v_key); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(30, 5, __pyx_L1_error)
/* "petsc4py/PETSc/petscpyappctx.pxi":3
* cdef set appctx_registry = set()
*
* cdef inline object registerAppCtx(void *appctx): # <<<<<<<<<<<<<<
* cdef object key = <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_t_3;
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_PyInt_FromSize_t(((Py_uintptr_t)__pyx_v_appctx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_key = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/petscpyappctx.pxi":9
* cdef inline object toAppCtx(void *appctx):
* cdef object key = <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(30, 9, __pyx_L1_error)
}
__pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_key, __pyx_v_8petsc4py_5PETSc_appctx_registry, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(30, 9, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "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_3 = ((__pyx_v_appctx != NULL) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/petscpyappctx.pxi":13
* else:
* if appctx != NULL:
* return PyLong_FromVoidPtr(appctx) # <<<<<<<<<<<<<<
* else:
* return None
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyLong_FromVoidPtr(__pyx_v_appctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/petscpyappctx.pxi":12
* return <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":7
* _traceback_ = []
*
* def __init__(self, int ierr=0): # <<<<<<<<<<<<<<
* self.ierr = ierr
* RuntimeError.__init__(self, self.ierr)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5Error___init__[] = "Error.__init__(self, int ierr=0)";
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Error_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Error___init__};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
int __pyx_v_ierr;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ierr,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ierr);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 7, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_self = values[0];
if (values[1]) {
__pyx_v_ierr = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_ierr == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 7, __pyx_L3_error)
} else {
__pyx_v_ierr = ((int)((int)0));
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 7, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_ierr) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
/* "petsc4py/PETSc/Error.pyx":8
*
* def __init__(self, int ierr=0):
* self.ierr = ierr # <<<<<<<<<<<<<<
* RuntimeError.__init__(self, self.ierr)
*
*/
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ierr, __pyx_t_1) < 0) __PYX_ERR(1, 8, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Error.pyx":9
* def __init__(self, int ierr=0):
* self.ierr = ierr
* RuntimeError.__init__(self, self.ierr) # <<<<<<<<<<<<<<
*
* def __nonzero__(self):
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_RuntimeError, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ierr); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
__pyx_t_5 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
__pyx_t_5 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_self, __pyx_t_3};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_self, __pyx_t_3};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
#endif
{
__pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_4) {
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
}
__Pyx_INCREF(__pyx_v_self);
__Pyx_GIVEREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_self);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Error.pyx":7
* _traceback_ = []
*
* def __init__(self, int ierr=0): # <<<<<<<<<<<<<<
* self.ierr = ierr
* RuntimeError.__init__(self, self.ierr)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__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":11
* RuntimeError.__init__(self, self.ierr)
*
* def __nonzero__(self): # <<<<<<<<<<<<<<
* cdef int ierr = self.ierr
* return ierr != 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_3__nonzero__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5Error_2__nonzero__[] = "Error.__nonzero__(self)";
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_3__nonzero__ = {"__nonzero__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Error_3__nonzero__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Error_2__nonzero__};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_3__nonzero__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__nonzero__") < 0)) __PYX_ERR(1, 11, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_self = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__nonzero__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 11, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Error.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5Error_2__nonzero__(__pyx_self, __pyx_v_self);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_2__nonzero__(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("__nonzero__", 0);
/* "petsc4py/PETSc/Error.pyx":12
*
* def __nonzero__(self):
* cdef int ierr = self.ierr # <<<<<<<<<<<<<<
* return ierr != 0
*
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ierr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ierr = __pyx_t_2;
/* "petsc4py/PETSc/Error.pyx":13
* def __nonzero__(self):
* cdef int ierr = self.ierr
* return ierr != 0 # <<<<<<<<<<<<<<
*
* def __repr__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_ierr != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Error.pyx":11
* RuntimeError.__init__(self, self.ierr)
*
* def __nonzero__(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.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Error.pyx":15
* 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5Error_4__repr__[] = "Error.__repr__(self)";
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_5__repr__ = {"__repr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Error_5__repr__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Error_4__repr__};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_5__repr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__repr__") < 0)) __PYX_ERR(1, 15, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_self = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 15, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":16
*
* def __repr__(self):
* return 'PETSc.Error(%d)' % self.ierr # <<<<<<<<<<<<<<
*
* def __str__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ierr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_PETSc_Error_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __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":15
* 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":18
* 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5Error_6__str__[] = "Error.__str__(self)";
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_7__str__ = {"__str__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Error_7__str__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Error_6__str__};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_7__str__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__str__") < 0)) __PYX_ERR(1, 18, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_self = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 18, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":19
*
* 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":20
* 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)) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Error.pyx":21
* 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":22
* 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":20
* 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":23
* MPI_Comm_size(PETSC_COMM_WORLD, &csize)
* MPI_Comm_rank(PETSC_COMM_WORLD, &crank)
* width, rank = len(str(csize-1)), crank # <<<<<<<<<<<<<<
* tblist = ['error code %d' % self.ierr]
* for entry in self._traceback_:
*/
__pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_csize - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 23, __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":24
* MPI_Comm_rank(PETSC_COMM_WORLD, &crank)
* width, rank = len(str(csize-1)), crank
* tblist = ['error code %d' % self.ierr] # <<<<<<<<<<<<<<
* for entry in self._traceback_:
* tbline = '[%*d] %s' % (width, rank, entry)
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ierr); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_error_code_d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__pyx_t_2 = 0;
__pyx_v_tblist = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Error.pyx":25
* width, rank = len(str(csize-1)), crank
* tblist = ['error code %d' % self.ierr]
* for entry in self._traceback_: # <<<<<<<<<<<<<<
* tbline = '[%*d] %s' % (width, rank, entry)
* tblist.append(tbline)
*/
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_traceback); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
__pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
__pyx_t_6 = NULL;
} else {
__pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 25, __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))) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 25, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
} else {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 25, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
}
} else {
__pyx_t_3 = __pyx_t_6(__pyx_t_2);
if (unlikely(!__pyx_t_3)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(1, 25, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_3);
}
__Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Error.pyx":26
* tblist = ['error code %d' % self.ierr]
* for entry in self._traceback_:
* tbline = '[%*d] %s' % (width, rank, entry) # <<<<<<<<<<<<<<
* tblist.append(tbline)
* return '\n'.join(tblist)
*/
__pyx_t_3 = PyInt_FromSsize_t(__pyx_v_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 26, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_rank); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 26, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 26, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
__Pyx_INCREF(__pyx_v_entry);
__Pyx_GIVEREF(__pyx_v_entry);
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_entry);
__pyx_t_3 = 0;
__pyx_t_7 = 0;
__pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_d_s, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 26, __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":27
* for entry in self._traceback_:
* tbline = '[%*d] %s' % (width, rank, entry)
* tblist.append(tbline) # <<<<<<<<<<<<<<
* return '\n'.join(tblist)
*
*/
__pyx_t_9 = __Pyx_PyList_Append(__pyx_v_tblist, __pyx_v_tbline); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 27, __pyx_L1_error)
/* "petsc4py/PETSc/Error.pyx":25
* 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":28
* tbline = '[%*d] %s' % (width, rank, entry)
* tblist.append(tbline)
* return '\n'.join(tblist) # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__13, __pyx_v_tblist); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 28, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Error.pyx":18
* 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":8
* cdef object _prefix
*
* def __init__(self, prefix=None): # <<<<<<<<<<<<<<
* self.opt = NULL
* self.prefix = prefix
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_7Options_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_7Options_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 0;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(31, 8, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_prefix = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 8, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
/* "petsc4py/PETSc/Options.pyx":9
*
* def __init__(self, prefix=None):
* self.opt = NULL # <<<<<<<<<<<<<<
* self.prefix = prefix
*
*/
__pyx_v_self->opt = NULL;
/* "petsc4py/PETSc/Options.pyx":10
* def __init__(self, prefix=None):
* self.opt = NULL
* self.prefix = prefix # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix, __pyx_v_prefix) < 0) __PYX_ERR(31, 10, __pyx_L1_error)
/* "petsc4py/PETSc/Options.pyx":8
* cdef object _prefix
*
* def __init__(self, prefix=None): # <<<<<<<<<<<<<<
* self.opt = NULL
* self.prefix = prefix
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Options.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":12
* self.prefix = prefix
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* if self.opt == NULL: return
* CHKERR( PetscOptionsDestroy(&self.opt) )
*/
/* Python wrapper */
static void __pyx_pw_8petsc4py_5PETSc_7Options_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8petsc4py_5PETSc_7Options_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__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) {
__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("__dealloc__", 0);
/* "petsc4py/PETSc/Options.pyx":13
*
* def __dealloc__(self):
* if self.opt == NULL: return # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsDestroy(&self.opt) )
*
*/
__pyx_t_1 = ((__pyx_v_self->opt == NULL) != 0);
if (__pyx_t_1) {
goto __pyx_L0;
}
/* "petsc4py/PETSc/Options.pyx":14
* def __dealloc__(self):
* if self.opt == NULL: return
* CHKERR( PetscOptionsDestroy(&self.opt) ) # <<<<<<<<<<<<<<
*
* def __contains__(self, item):
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsDestroy((&__pyx_v_self->opt))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 14, __pyx_L1_error)
/* "petsc4py/PETSc/Options.pyx":12
* self.prefix = prefix
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* if self.opt == NULL: return
* CHKERR( PetscOptionsDestroy(&self.opt) )
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_WriteUnraisable("petsc4py.PETSc.Options.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "petsc4py/PETSc/Options.pyx":16
* CHKERR( PetscOptionsDestroy(&self.opt) )
*
* def __contains__(self, item): # <<<<<<<<<<<<<<
* return self.hasName(item)
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_7Options_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_7Options_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_4__contains__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), ((PyObject *)__pyx_v_item));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_7Options_4__contains__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__contains__", 0);
/* "petsc4py/PETSc/Options.pyx":17
*
* def __contains__(self, item):
* return self.hasName(item) # <<<<<<<<<<<<<<
*
* def __getitem__(self, item):
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_hasName); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_item);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(31, 17, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
goto __pyx_L0;
/* "petsc4py/PETSc/Options.pyx":16
* CHKERR( PetscOptionsDestroy(&self.opt) )
*
* def __contains__(self, item): # <<<<<<<<<<<<<<
* return self.hasName(item)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Options.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":19
* return self.hasName(item)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
* return self.getString(item)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_6__getitem__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), ((PyObject *)__pyx_v_item));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_6__getitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
/* "petsc4py/PETSc/Options.pyx":20
*
* def __getitem__(self, item):
* return self.getString(item) # <<<<<<<<<<<<<<
*
* def __setitem__(self, item, value):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getString); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 20, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_item);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 20, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Options.pyx":19
* return self.hasName(item)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
* return self.getString(item)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Options.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":22
* return self.getString(item)
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
* self.setValue(item, value)
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_7Options_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_7Options_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_8__setitem__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_7Options_8__setitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
/* "petsc4py/PETSc/Options.pyx":23
*
* def __setitem__(self, item, value):
* self.setValue(item, value) # <<<<<<<<<<<<<<
*
* def __delitem__(self, item):
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
__pyx_t_4 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
__pyx_t_4 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_item, __pyx_v_value};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 23, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_item, __pyx_v_value};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 23, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
__pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__pyx_t_3) {
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
}
__Pyx_INCREF(__pyx_v_item);
__Pyx_GIVEREF(__pyx_v_item);
PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_item);
__Pyx_INCREF(__pyx_v_value);
__Pyx_GIVEREF(__pyx_v_value);
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_value);
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Options.pyx":22
* return self.getString(item)
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
* self.setValue(item, value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.Options.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":25
* self.setValue(item, value)
*
* def __delitem__(self, item): # <<<<<<<<<<<<<<
* self.delValue(item)
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_7Options_11__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_7Options_11__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__delitem__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_10__delitem__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), ((PyObject *)__pyx_v_item));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_7Options_10__delitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__delitem__", 0);
/* "petsc4py/PETSc/Options.pyx":26
*
* def __delitem__(self, item):
* self.delValue(item) # <<<<<<<<<<<<<<
*
* property prefix:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_delValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 26, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_item);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 26, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Options.pyx":25
* self.setValue(item, value)
*
* def __delitem__(self, item): # <<<<<<<<<<<<<<
* self.delValue(item)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Options.__delitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":29
*
* property prefix:
* def __get__(self): # <<<<<<<<<<<<<<
* return self._prefix
* def __set__(self, prefix):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_6prefix_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_6prefix_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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":30
* property prefix:
* def __get__(self):
* return self._prefix # <<<<<<<<<<<<<<
* def __set__(self, prefix):
* self._prefix = getprefix(prefix)
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->_prefix);
__pyx_r = __pyx_v_self->_prefix;
goto __pyx_L0;
/* "petsc4py/PETSc/Options.pyx":29
*
* property prefix:
* def __get__(self): # <<<<<<<<<<<<<<
* return self._prefix
* def __set__(self, prefix):
*/
/* function exit code */
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":31
* def __get__(self):
* return self._prefix
* def __set__(self, prefix): # <<<<<<<<<<<<<<
* self._prefix = getprefix(prefix)
* def __del__(self):
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_prefix); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_prefix) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__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":32
* return self._prefix
* def __set__(self, prefix):
* self._prefix = getprefix(prefix) # <<<<<<<<<<<<<<
* def __del__(self):
* self._prefix = None
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getprefix(__pyx_v_prefix, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 32, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->_prefix);
__Pyx_DECREF(__pyx_v_self->_prefix);
__pyx_v_self->_prefix = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Options.pyx":31
* def __get__(self):
* return self._prefix
* def __set__(self, prefix): # <<<<<<<<<<<<<<
* self._prefix = getprefix(prefix)
* def __del__(self):
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Options.prefix.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":33
* def __set__(self, prefix):
* self._prefix = getprefix(prefix)
* def __del__(self): # <<<<<<<<<<<<<<
* self._prefix = None
* #
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_5__del__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
__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":34
* self._prefix = getprefix(prefix)
* def __del__(self):
* self._prefix = None # <<<<<<<<<<<<<<
* #
*
*/
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_GOTREF(__pyx_v_self->_prefix);
__Pyx_DECREF(__pyx_v_self->_prefix);
__pyx_v_self->_prefix = Py_None;
/* "petsc4py/PETSc/Options.pyx":33
* def __set__(self, prefix):
* self._prefix = getprefix(prefix)
* def __del__(self): # <<<<<<<<<<<<<<
* self._prefix = None
* #
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":37
* #
*
* def create(self): # <<<<<<<<<<<<<<
* if self.opt != NULL: return
* CHKERR( PetscOptionsCreate(&self.opt) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_13create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_12create[] = "Options.create(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_13create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("create (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("create", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "create", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_12create(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_12create(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("create", 0);
/* "petsc4py/PETSc/Options.pyx":38
*
* def create(self):
* if self.opt != NULL: return # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsCreate(&self.opt) )
* return self
*/
__pyx_t_1 = ((__pyx_v_self->opt != NULL) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/Options.pyx":39
* def create(self):
* if self.opt != NULL: return
* CHKERR( PetscOptionsCreate(&self.opt) ) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsCreate((&__pyx_v_self->opt))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 39, __pyx_L1_error)
/* "petsc4py/PETSc/Options.pyx":40
* if self.opt != NULL: return
* CHKERR( PetscOptionsCreate(&self.opt) )
* return self # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Options.pyx":37
* #
*
* def create(self): # <<<<<<<<<<<<<<
* if self.opt != NULL: return
* CHKERR( PetscOptionsCreate(&self.opt) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Options.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":42
* return self
*
* def destroy(self): # <<<<<<<<<<<<<<
* if self.opt == NULL: return
* CHKERR( PetscOptionsDestroy(&self.opt) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_15destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_14destroy[] = "Options.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_15destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_14destroy(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_14destroy(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/Options.pyx":43
*
* def destroy(self):
* if self.opt == NULL: return # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsDestroy(&self.opt) )
* return self
*/
__pyx_t_1 = ((__pyx_v_self->opt == NULL) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/Options.pyx":44
* def destroy(self):
* if self.opt == NULL: return
* CHKERR( PetscOptionsDestroy(&self.opt) ) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsDestroy((&__pyx_v_self->opt))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 44, __pyx_L1_error)
/* "petsc4py/PETSc/Options.pyx":45
* if self.opt == NULL: return
* CHKERR( PetscOptionsDestroy(&self.opt) )
* return self # <<<<<<<<<<<<<<
*
* def clear(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Options.pyx":42
* return self
*
* def destroy(self): # <<<<<<<<<<<<<<
* if self.opt == NULL: return
* CHKERR( PetscOptionsDestroy(&self.opt) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Options.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":47
* return self
*
* def clear(self): # <<<<<<<<<<<<<<
* if self.opt == NULL: return
* CHKERR( PetscOptionsClear(self.opt) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_17clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_16clear[] = "Options.clear(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_17clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("clear (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("clear", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clear", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_16clear(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_16clear(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("clear", 0);
/* "petsc4py/PETSc/Options.pyx":48
*
* def clear(self):
* if self.opt == NULL: return # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsClear(self.opt) )
* return self
*/
__pyx_t_1 = ((__pyx_v_self->opt == NULL) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/Options.pyx":49
* def clear(self):
* if self.opt == NULL: return
* CHKERR( PetscOptionsClear(self.opt) ) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsClear(__pyx_v_self->opt)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 49, __pyx_L1_error)
/* "petsc4py/PETSc/Options.pyx":50
* if self.opt == NULL: return
* CHKERR( PetscOptionsClear(self.opt) )
* return self # <<<<<<<<<<<<<<
*
* def view(self, Viewer viewer=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Options.pyx":47
* return self
*
* def clear(self): # <<<<<<<<<<<<<<
* if self.opt == NULL: return
* CHKERR( PetscOptionsClear(self.opt) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Options.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":52
* return self
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_19view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_18view[] = "Options.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_19view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(31, 52, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 52, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Options.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(31, 52, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_18view(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/Options.pyx":53
*
* def view(self, Viewer viewer=None):
* cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<<
* if viewer is not None: vwr = viewer.vwr
* CHKERR( PetscOptionsView(self.opt, vwr) )
*/
__pyx_v_vwr = NULL;
/* "petsc4py/PETSc/Options.pyx":54
* def view(self, Viewer viewer=None):
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsView(self.opt, vwr) )
*
*/
__pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
}
/* "petsc4py/PETSc/Options.pyx":55
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
* CHKERR( PetscOptionsView(self.opt, vwr) ) # <<<<<<<<<<<<<<
*
* def prefixPush(self, prefix):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsView(__pyx_v_self->opt, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 55, __pyx_L1_error)
/* "petsc4py/PETSc/Options.pyx":52
* return self
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Options.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":57
* CHKERR( PetscOptionsView(self.opt, vwr) )
*
* def prefixPush(self, prefix): # <<<<<<<<<<<<<<
* prefix = getprefix(prefix)
* cdef const char *cprefix = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_21prefixPush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_20prefixPush[] = "Options.prefixPush(self, prefix)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_21prefixPush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prefixPush") < 0)) __PYX_ERR(31, 57, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_prefix = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("prefixPush", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 57, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_20prefixPush(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix) {
char const *__pyx_v_cprefix;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("prefixPush", 0);
__Pyx_INCREF(__pyx_v_prefix);
/* "petsc4py/PETSc/Options.pyx":58
*
* def prefixPush(self, prefix):
* prefix = getprefix(prefix) # <<<<<<<<<<<<<<
* cdef const char *cprefix = NULL
* prefix = str2bytes(prefix, &cprefix)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getprefix(__pyx_v_prefix, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Options.pyx":59
* def prefixPush(self, prefix):
* prefix = getprefix(prefix)
* cdef const char *cprefix = NULL # <<<<<<<<<<<<<<
* prefix = str2bytes(prefix, &cprefix)
* CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) )
*/
__pyx_v_cprefix = NULL;
/* "petsc4py/PETSc/Options.pyx":60
* prefix = getprefix(prefix)
* cdef const char *cprefix = NULL
* prefix = str2bytes(prefix, &cprefix) # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cprefix)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 60, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Options.pyx":61
* cdef const char *cprefix = NULL
* prefix = str2bytes(prefix, &cprefix)
* CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) ) # <<<<<<<<<<<<<<
*
* def prefixPop(self):
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsPrefixPush(__pyx_v_self->opt, __pyx_v_cprefix)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 61, __pyx_L1_error)
/* "petsc4py/PETSc/Options.pyx":57
* CHKERR( PetscOptionsView(self.opt, vwr) )
*
* def prefixPush(self, prefix): # <<<<<<<<<<<<<<
* prefix = getprefix(prefix)
* cdef const char *cprefix = NULL
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Options.prefixPush", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_prefix);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":63
* CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) )
*
* def prefixPop(self): # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsPrefixPop(self.opt) )
* #
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_23prefixPop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_22prefixPop[] = "Options.prefixPop(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_23prefixPop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("prefixPop (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("prefixPop", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "prefixPop", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_22prefixPop(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_22prefixPop(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("prefixPop", 0);
/* "petsc4py/PETSc/Options.pyx":64
*
* def prefixPop(self):
* CHKERR( PetscOptionsPrefixPop(self.opt) ) # <<<<<<<<<<<<<<
* #
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsPrefixPop(__pyx_v_self->opt)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 64, __pyx_L1_error)
/* "petsc4py/PETSc/Options.pyx":63
* CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) )
*
* def prefixPop(self): # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsPrefixPop(self.opt) )
* #
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Options.prefixPop", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":67
* #
*
* def hasName(self, name): # <<<<<<<<<<<<<<
* cdef const char *pr = NULL
* cdef const char *nm = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_25hasName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_24hasName[] = "Options.hasName(self, name)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_25hasName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hasName") < 0)) __PYX_ERR(31, 67, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_name = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("hasName", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 67, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_24hasName(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name) {
char const *__pyx_v_pr;
char const *__pyx_v_nm;
CYTHON_UNUSED PyObject *__pyx_v_tmp = NULL;
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("hasName", 0);
/* "petsc4py/PETSc/Options.pyx":68
*
* def hasName(self, name):
* cdef const char *pr = NULL # <<<<<<<<<<<<<<
* cdef const char *nm = NULL
* tmp = getpair(self.prefix, name, &pr, &nm)
*/
__pyx_v_pr = NULL;
/* "petsc4py/PETSc/Options.pyx":69
* def hasName(self, name):
* cdef const char *pr = NULL
* cdef const char *nm = NULL # <<<<<<<<<<<<<<
* tmp = getpair(self.prefix, name, &pr, &nm)
* cdef PetscBool flag = PETSC_FALSE
*/
__pyx_v_nm = NULL;
/* "petsc4py/PETSc/Options.pyx":70
* cdef const char *pr = NULL
* cdef const char *nm = NULL
* tmp = getpair(self.prefix, name, &pr, &nm) # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsHasName(self.opt, pr, nm, &flag) )
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 70, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getpair(__pyx_t_1, __pyx_v_name, (&__pyx_v_pr), (&__pyx_v_nm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 70, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_tmp = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Options.pyx":71
* cdef const char *nm = NULL
* tmp = getpair(self.prefix, name, &pr, &nm)
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsHasName(self.opt, pr, nm, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/Options.pyx":72
* tmp = getpair(self.prefix, name, &pr, &nm)
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsHasName(self.opt, pr, nm, &flag) ) # <<<<<<<<<<<<<<
* return toBool(flag)
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsHasName(__pyx_v_self->opt, __pyx_v_pr, __pyx_v_nm, (&__pyx_v_flag))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 72, __pyx_L1_error)
/* "petsc4py/PETSc/Options.pyx":73
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscOptionsHasName(self.opt, pr, nm, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def setValue(self, name, value):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 73, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Options.pyx":67
* #
*
* def hasName(self, name): # <<<<<<<<<<<<<<
* cdef const char *pr = NULL
* cdef const char *nm = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Options.hasName", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":75
* return toBool(flag)
*
* def setValue(self, name, value): # <<<<<<<<<<<<<<
* cdef const char *pr = NULL
* cdef const char *nm = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_27setValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_26setValue[] = "Options.setValue(self, name, value)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_27setValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_value = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValue", 1, 2, 2, 1); __PYX_ERR(31, 75, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValue") < 0)) __PYX_ERR(31, 75, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_name = values[0];
__pyx_v_value = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValue", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 75, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Options.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_26setValue(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_value);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_26setValue(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
char const *__pyx_v_pr;
char const *__pyx_v_nm;
CYTHON_UNUSED PyObject *__pyx_v_tmp = NULL;
PyObject *__pyx_v_option = NULL;
char const *__pyx_v_key;
char const *__pyx_v_val;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PetscErrorCode __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setValue", 0);
__Pyx_INCREF(__pyx_v_value);
/* "petsc4py/PETSc/Options.pyx":76
*
* def setValue(self, name, value):
* cdef const char *pr = NULL # <<<<<<<<<<<<<<
* cdef const char *nm = NULL
* tmp = getpair(self.prefix, name, &pr, &nm)
*/
__pyx_v_pr = NULL;
/* "petsc4py/PETSc/Options.pyx":77
* def setValue(self, name, value):
* cdef const char *pr = NULL
* cdef const char *nm = NULL # <<<<<<<<<<<<<<
* tmp = getpair(self.prefix, name, &pr, &nm)
* if pr == NULL:
*/
__pyx_v_nm = NULL;
/* "petsc4py/PETSc/Options.pyx":78
* cdef const char *pr = NULL
* cdef const char *nm = NULL
* tmp = getpair(self.prefix, name, &pr, &nm) # <<<<<<<<<<<<<<
* if pr == NULL:
* option = bytes2str(nm)
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 78, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getpair(__pyx_t_1, __pyx_v_name, (&__pyx_v_pr), (&__pyx_v_nm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 78, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_tmp = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Options.pyx":79
* cdef const char *nm = NULL
* tmp = getpair(self.prefix, name, &pr, &nm)
* if pr == NULL: # <<<<<<<<<<<<<<
* option = bytes2str(nm)
* else:
*/
__pyx_t_3 = ((__pyx_v_pr == NULL) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Options.pyx":80
* tmp = getpair(self.prefix, name, &pr, &nm)
* if pr == NULL:
* option = bytes2str(nm) # <<<<<<<<<<<<<<
* else:
* option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1]))
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_nm); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 80, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_option = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Options.pyx":79
* cdef const char *nm = NULL
* tmp = getpair(self.prefix, name, &pr, &nm)
* if pr == NULL: # <<<<<<<<<<<<<<
* option = bytes2str(nm)
* else:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Options.pyx":82
* option = bytes2str(nm)
* else:
* option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) # <<<<<<<<<<<<<<
* if type(value) is bool:
* value = str(value).lower()
*/
/*else*/ {
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_pr); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 82, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str((&(__pyx_v_nm[1]))); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 82, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 82, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 82, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_option = __pyx_t_1;
__pyx_t_1 = 0;
}
__pyx_L3:;
/* "petsc4py/PETSc/Options.pyx":83
* else:
* option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1]))
* if type(value) is bool: # <<<<<<<<<<<<<<
* value = str(value).lower()
* elif value is not None :
*/
__pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_value)) == ((PyObject*)&PyBool_Type));
__pyx_t_5 = (__pyx_t_3 != 0);
if (__pyx_t_5) {
/* "petsc4py/PETSc/Options.pyx":84
* option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1]))
* if type(value) is bool:
* value = str(value).lower() # <<<<<<<<<<<<<<
* elif value is not None :
* value = str(value)
*/
__pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Options.pyx":83
* else:
* option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1]))
* if type(value) is bool: # <<<<<<<<<<<<<<
* value = str(value).lower()
* elif value is not None :
*/
goto __pyx_L4;
}
/* "petsc4py/PETSc/Options.pyx":85
* if type(value) is bool:
* value = str(value).lower()
* elif value is not None : # <<<<<<<<<<<<<<
* value = str(value)
* cdef const char *key = NULL
*/
__pyx_t_5 = (__pyx_v_value != Py_None);
__pyx_t_3 = (__pyx_t_5 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Options.pyx":86
* value = str(value).lower()
* elif value is not None :
* value = str(value) # <<<<<<<<<<<<<<
* cdef const char *key = NULL
* cdef const char *val = NULL
*/
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 86, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Options.pyx":85
* if type(value) is bool:
* value = str(value).lower()
* elif value is not None : # <<<<<<<<<<<<<<
* value = str(value)
* cdef const char *key = NULL
*/
}
__pyx_L4:;
/* "petsc4py/PETSc/Options.pyx":87
* elif value is not None :
* value = str(value)
* cdef const char *key = NULL # <<<<<<<<<<<<<<
* cdef const char *val = NULL
* option = str2bytes(option, &key)
*/
__pyx_v_key = NULL;
/* "petsc4py/PETSc/Options.pyx":88
* value = str(value)
* cdef const char *key = NULL
* cdef const char *val = NULL # <<<<<<<<<<<<<<
* option = str2bytes(option, &key)
* value = str2bytes(value, &val)
*/
__pyx_v_val = NULL;
/* "petsc4py/PETSc/Options.pyx":89
* cdef const char *key = NULL
* cdef const char *val = NULL
* option = str2bytes(option, &key) # <<<<<<<<<<<<<<
* value = str2bytes(value, &val)
* CHKERR( PetscOptionsSetValue(self.opt, key, val) )
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_option, (&__pyx_v_key)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_option, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Options.pyx":90
* cdef const char *val = NULL
* option = str2bytes(option, &key)
* value = str2bytes(value, &val) # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsSetValue(self.opt, key, val) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_value, (&__pyx_v_val)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Options.pyx":91
* option = str2bytes(option, &key)
* value = str2bytes(value, &val)
* CHKERR( PetscOptionsSetValue(self.opt, key, val) ) # <<<<<<<<<<<<<<
*
* def delValue(self, name):
*/
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsSetValue(__pyx_v_self->opt, __pyx_v_key, __pyx_v_val)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 91, __pyx_L1_error)
/* "petsc4py/PETSc/Options.pyx":75
* return toBool(flag)
*
* def setValue(self, name, value): # <<<<<<<<<<<<<<
* cdef const char *pr = NULL
* cdef const char *nm = NULL
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("petsc4py.PETSc.Options.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmp);
__Pyx_XDECREF(__pyx_v_option);
__Pyx_XDECREF(__pyx_v_value);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":93
* CHKERR( PetscOptionsSetValue(self.opt, key, val) )
*
* def delValue(self, name): # <<<<<<<<<<<<<<
* cdef const char *pr = NULL
* cdef const char *nm = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_29delValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_28delValue[] = "Options.delValue(self, name)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_29delValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delValue") < 0)) __PYX_ERR(31, 93, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_name = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("delValue", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 93, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Options.delValue", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_28delValue(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_28delValue(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name) {
char const *__pyx_v_pr;
char const *__pyx_v_nm;
CYTHON_UNUSED PyObject *__pyx_v_tmp = NULL;
PyObject *__pyx_v_option = NULL;
char const *__pyx_v_key;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PetscErrorCode __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("delValue", 0);
/* "petsc4py/PETSc/Options.pyx":94
*
* def delValue(self, name):
* cdef const char *pr = NULL # <<<<<<<<<<<<<<
* cdef const char *nm = NULL
* tmp = getpair(self.prefix, name, &pr, &nm)
*/
__pyx_v_pr = NULL;
/* "petsc4py/PETSc/Options.pyx":95
* def delValue(self, name):
* cdef const char *pr = NULL
* cdef const char *nm = NULL # <<<<<<<<<<<<<<
* tmp = getpair(self.prefix, name, &pr, &nm)
* if pr == NULL:
*/
__pyx_v_nm = NULL;
/* "petsc4py/PETSc/Options.pyx":96
* cdef const char *pr = NULL
* cdef const char *nm = NULL
* tmp = getpair(self.prefix, name, &pr, &nm) # <<<<<<<<<<<<<<
* if pr == NULL:
* option = bytes2str(nm)
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 96, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getpair(__pyx_t_1, __pyx_v_name, (&__pyx_v_pr), (&__pyx_v_nm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 96, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_tmp = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Options.pyx":97
* cdef const char *nm = NULL
* tmp = getpair(self.prefix, name, &pr, &nm)
* if pr == NULL: # <<<<<<<<<<<<<<
* option = bytes2str(nm)
* else:
*/
__pyx_t_3 = ((__pyx_v_pr == NULL) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Options.pyx":98
* tmp = getpair(self.prefix, name, &pr, &nm)
* if pr == NULL:
* option = bytes2str(nm) # <<<<<<<<<<<<<<
* else:
* option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1]))
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_nm); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 98, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_option = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Options.pyx":97
* cdef const char *nm = NULL
* tmp = getpair(self.prefix, name, &pr, &nm)
* if pr == NULL: # <<<<<<<<<<<<<<
* option = bytes2str(nm)
* else:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Options.pyx":100
* option = bytes2str(nm)
* else:
* option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) # <<<<<<<<<<<<<<
* cdef const char *key = NULL
* option = str2bytes(option, &key)
*/
/*else*/ {
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_pr); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str((&(__pyx_v_nm[1]))); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_option = __pyx_t_1;
__pyx_t_1 = 0;
}
__pyx_L3:;
/* "petsc4py/PETSc/Options.pyx":101
* else:
* option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1]))
* cdef const char *key = NULL # <<<<<<<<<<<<<<
* option = str2bytes(option, &key)
* CHKERR( PetscOptionsClearValue(self.opt, key) )
*/
__pyx_v_key = NULL;
/* "petsc4py/PETSc/Options.pyx":102
* option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1]))
* cdef const char *key = NULL
* option = str2bytes(option, &key) # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsClearValue(self.opt, key) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_option, (&__pyx_v_key)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_option, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Options.pyx":103
* cdef const char *key = NULL
* option = str2bytes(option, &key)
* CHKERR( PetscOptionsClearValue(self.opt, key) ) # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsClearValue(__pyx_v_self->opt, __pyx_v_key)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 103, __pyx_L1_error)
/* "petsc4py/PETSc/Options.pyx":93
* CHKERR( PetscOptionsSetValue(self.opt, key, val) )
*
* def delValue(self, name): # <<<<<<<<<<<<<<
* cdef const char *pr = NULL
* cdef const char *nm = NULL
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("petsc4py.PETSc.Options.delValue", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmp);
__Pyx_XDECREF(__pyx_v_option);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":107
* #
*
* def getBool(self, name, default=None): # <<<<<<<<<<<<<<
* return getopt(self.opt, OPT_BOOL, self.prefix, name, default)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_31getBool(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_30getBool[] = "Options.getBool(self, name, default=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_31getBool(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_default = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_default,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getBool") < 0)) __PYX_ERR(31, 107, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_default = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getBool", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 107, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Options.getBool", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_30getBool(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_30getBool(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getBool", 0);
/* "petsc4py/PETSc/Options.pyx":108
*
* def getBool(self, name, default=None):
* return getopt(self.opt, OPT_BOOL, self.prefix, name, default) # <<<<<<<<<<<<<<
*
* def getInt(self, name, default=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getopt(__pyx_v_self->opt, __pyx_e_8petsc4py_5PETSc_OPT_BOOL, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Options.pyx":107
* #
*
* def getBool(self, name, default=None): # <<<<<<<<<<<<<<
* return getopt(self.opt, OPT_BOOL, self.prefix, name, default)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Options.getBool", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":110
* return getopt(self.opt, OPT_BOOL, self.prefix, name, default)
*
* def getInt(self, name, default=None): # <<<<<<<<<<<<<<
* return getopt(self.opt, OPT_INT, self.prefix, name, default)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_33getInt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_32getInt[] = "Options.getInt(self, name, default=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_33getInt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_default = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_default,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getInt") < 0)) __PYX_ERR(31, 110, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_default = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getInt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 110, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Options.getInt", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_32getInt(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_32getInt(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getInt", 0);
/* "petsc4py/PETSc/Options.pyx":111
*
* def getInt(self, name, default=None):
* return getopt(self.opt, OPT_INT, self.prefix, name, default) # <<<<<<<<<<<<<<
*
* def getReal(self, name, default=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 111, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getopt(__pyx_v_self->opt, __pyx_e_8petsc4py_5PETSc_OPT_INT, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 111, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Options.pyx":110
* return getopt(self.opt, OPT_BOOL, self.prefix, name, default)
*
* def getInt(self, name, default=None): # <<<<<<<<<<<<<<
* return getopt(self.opt, OPT_INT, self.prefix, name, default)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Options.getInt", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":113
* return getopt(self.opt, OPT_INT, self.prefix, name, default)
*
* def getReal(self, name, default=None): # <<<<<<<<<<<<<<
* return getopt(self.opt, OPT_REAL, self.prefix, name, default)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_35getReal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_34getReal[] = "Options.getReal(self, name, default=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_35getReal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_default = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_default,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getReal") < 0)) __PYX_ERR(31, 113, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_default = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getReal", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 113, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Options.getReal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_34getReal(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_34getReal(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getReal", 0);
/* "petsc4py/PETSc/Options.pyx":114
*
* def getReal(self, name, default=None):
* return getopt(self.opt, OPT_REAL, self.prefix, name, default) # <<<<<<<<<<<<<<
*
* def getScalar(self, name, default=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 114, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getopt(__pyx_v_self->opt, __pyx_e_8petsc4py_5PETSc_OPT_REAL, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 114, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Options.pyx":113
* return getopt(self.opt, OPT_INT, self.prefix, name, default)
*
* def getReal(self, name, default=None): # <<<<<<<<<<<<<<
* return getopt(self.opt, OPT_REAL, self.prefix, name, default)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Options.getReal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":116
* return getopt(self.opt, OPT_REAL, self.prefix, name, default)
*
* def getScalar(self, name, default=None): # <<<<<<<<<<<<<<
* return getopt(self.opt, OPT_SCALAR, self.prefix, name, default)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_37getScalar(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_36getScalar[] = "Options.getScalar(self, name, default=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_37getScalar(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_default = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_default,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getScalar") < 0)) __PYX_ERR(31, 116, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_default = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getScalar", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 116, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Options.getScalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_36getScalar(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_36getScalar(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getScalar", 0);
/* "petsc4py/PETSc/Options.pyx":117
*
* def getScalar(self, name, default=None):
* return getopt(self.opt, OPT_SCALAR, self.prefix, name, default) # <<<<<<<<<<<<<<
*
* def getString(self, name, default=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 117, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getopt(__pyx_v_self->opt, __pyx_e_8petsc4py_5PETSc_OPT_SCALAR, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 117, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Options.pyx":116
* return getopt(self.opt, OPT_REAL, self.prefix, name, default)
*
* def getScalar(self, name, default=None): # <<<<<<<<<<<<<<
* return getopt(self.opt, OPT_SCALAR, self.prefix, name, default)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Options.getScalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":119
* return getopt(self.opt, OPT_SCALAR, self.prefix, name, default)
*
* def getString(self, name, default=None): # <<<<<<<<<<<<<<
* return getopt(self.opt, OPT_STRING, self.prefix, name, default)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_39getString(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_38getString[] = "Options.getString(self, name, default=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_39getString(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_default = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_default,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getString") < 0)) __PYX_ERR(31, 119, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_default = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getString", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 119, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Options.getString", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_38getString(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_38getString(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getString", 0);
/* "petsc4py/PETSc/Options.pyx":120
*
* def getString(self, name, default=None):
* return getopt(self.opt, OPT_STRING, self.prefix, name, default) # <<<<<<<<<<<<<<
*
* #
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getopt(__pyx_v_self->opt, __pyx_e_8petsc4py_5PETSc_OPT_STRING, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Options.pyx":119
* return getopt(self.opt, OPT_SCALAR, self.prefix, name, default)
*
* def getString(self, name, default=None): # <<<<<<<<<<<<<<
* return getopt(self.opt, OPT_STRING, self.prefix, name, default)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Options.getString", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":124
* #
*
* def insertString(self, string): # <<<<<<<<<<<<<<
* cdef const char *cstring = NULL
* string = str2bytes(string, &cstring)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_41insertString(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_40insertString[] = "Options.insertString(self, string)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_41insertString(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_string = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_string,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_string)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insertString") < 0)) __PYX_ERR(31, 124, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_string = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("insertString", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 124, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Options.insertString", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_40insertString(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_string);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_40insertString(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_string) {
char const *__pyx_v_cstring;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("insertString", 0);
__Pyx_INCREF(__pyx_v_string);
/* "petsc4py/PETSc/Options.pyx":125
*
* def insertString(self, string):
* cdef const char *cstring = NULL # <<<<<<<<<<<<<<
* string = str2bytes(string, &cstring)
* CHKERR( PetscOptionsInsertString(self.opt, cstring) )
*/
__pyx_v_cstring = NULL;
/* "petsc4py/PETSc/Options.pyx":126
* def insertString(self, string):
* cdef const char *cstring = NULL
* string = str2bytes(string, &cstring) # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsInsertString(self.opt, cstring) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_string, (&__pyx_v_cstring)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_string, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Options.pyx":127
* cdef const char *cstring = NULL
* string = str2bytes(string, &cstring)
* CHKERR( PetscOptionsInsertString(self.opt, cstring) ) # <<<<<<<<<<<<<<
*
* def getAll(self):
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsInsertString(__pyx_v_self->opt, __pyx_v_cstring)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 127, __pyx_L1_error)
/* "petsc4py/PETSc/Options.pyx":124
* #
*
* def insertString(self, string): # <<<<<<<<<<<<<<
* cdef const char *cstring = NULL
* string = str2bytes(string, &cstring)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Options.insertString", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_string);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Options.pyx":129
* CHKERR( PetscOptionsInsertString(self.opt, cstring) )
*
* def getAll(self): # <<<<<<<<<<<<<<
* cdef char *allopts = NULL
* CHKERR( PetscOptionsGetAll(self.opt, &allopts) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_43getAll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Options_42getAll[] = "Options.getAll(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_43getAll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getAll (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getAll", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAll", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_42getAll(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_42getAll(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) {
char *__pyx_v_allopts;
PyObject *__pyx_v_options = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getAll", 0);
/* "petsc4py/PETSc/Options.pyx":130
*
* def getAll(self):
* cdef char *allopts = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscOptionsGetAll(self.opt, &allopts) )
* options = bytes2str(allopts)
*/
__pyx_v_allopts = NULL;
/* "petsc4py/PETSc/Options.pyx":131
* def getAll(self):
* cdef char *allopts = NULL
* CHKERR( PetscOptionsGetAll(self.opt, &allopts) ) # <<<<<<<<<<<<<<
* options = bytes2str(allopts)
* CHKERR( PetscFree(allopts) )
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetAll(__pyx_v_self->opt, (&__pyx_v_allopts))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 131, __pyx_L1_error)
/* "petsc4py/PETSc/Options.pyx":132
* cdef char *allopts = NULL
* CHKERR( PetscOptionsGetAll(self.opt, &allopts) )
* options = bytes2str(allopts) # <<<<<<<<<<<<<<
* CHKERR( PetscFree(allopts) )
* return parseopt(options, self.prefix)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_allopts); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_options = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Options.pyx":133
* CHKERR( PetscOptionsGetAll(self.opt, &allopts) )
* options = bytes2str(allopts)
* CHKERR( PetscFree(allopts) ) # <<<<<<<<<<<<<<
* return parseopt(options, self.prefix)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_allopts)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 133, __pyx_L1_error)
/* "petsc4py/PETSc/Options.pyx":134
* options = bytes2str(allopts)
* CHKERR( PetscFree(allopts) )
* return parseopt(options, self.prefix) # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 134, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_parseopt(__pyx_v_options, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 134, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Options.pyx":129
* CHKERR( PetscOptionsInsertString(self.opt, cstring) )
*
* def getAll(self): # <<<<<<<<<<<<<<
* cdef char *allopts = NULL
* CHKERR( PetscOptionsGetAll(self.opt, &allopts) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Options.getAll", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_options);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Sys.pyx":6
*
* @classmethod
* def getVersion(cls, devel=False, date=False, author=False): # <<<<<<<<<<<<<<
* cdef char cversion[256]
* cdef PetscInt major=0, minor=0, micro=0, release=0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_1getVersion(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_getVersion[] = "Sys.getVersion(type cls, devel=False, date=False, author=False)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_1getVersion(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_devel = 0;
PyObject *__pyx_v_date = 0;
PyObject *__pyx_v_author = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_devel,&__pyx_n_s_date,&__pyx_n_s_author,0};
PyObject* values[3] = {0,0,0};
values[0] = ((PyObject *)Py_False);
values[1] = ((PyObject *)Py_False);
values[2] = ((PyObject *)Py_False);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_devel);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_date);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_author);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getVersion") < 0)) __PYX_ERR(32, 6, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_devel = values[0];
__pyx_v_date = values[1];
__pyx_v_author = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getVersion", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 6, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_getVersion(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_devel, PyObject *__pyx_v_date, PyObject *__pyx_v_author) {
char __pyx_v_cversion[0x100];
PetscInt __pyx_v_major;
PetscInt __pyx_v_minor;
PetscInt __pyx_v_micro;
PetscInt __pyx_v_release;
PyObject *__pyx_v_out = NULL;
PyObject *__pyx_v_version = NULL;
PyObject *__pyx_v_vstr = NULL;
PyObject *__pyx_8genexpr1__pyx_v_s = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_t_7;
int __pyx_t_8;
Py_ssize_t __pyx_t_9;
PyObject *(*__pyx_t_10)(PyObject *);
PyObject *__pyx_t_11 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getVersion", 0);
__Pyx_INCREF(__pyx_v_date);
__Pyx_INCREF(__pyx_v_author);
/* "petsc4py/PETSc/Sys.pyx":8
* def getVersion(cls, devel=False, date=False, author=False):
* cdef char cversion[256]
* cdef PetscInt major=0, minor=0, micro=0, release=0 # <<<<<<<<<<<<<<
* CHKERR( PetscGetVersion(cversion, sizeof(cversion)) )
* CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) )
*/
__pyx_v_major = 0;
__pyx_v_minor = 0;
__pyx_v_micro = 0;
__pyx_v_release = 0;
/* "petsc4py/PETSc/Sys.pyx":9
* cdef char cversion[256]
* cdef PetscInt major=0, minor=0, micro=0, release=0
* CHKERR( PetscGetVersion(cversion, sizeof(cversion)) ) # <<<<<<<<<<<<<<
* CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) )
* out = version = (toInt(major), toInt(minor), toInt(micro))
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGetVersion(__pyx_v_cversion, (sizeof(__pyx_v_cversion)))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 9, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":10
* cdef PetscInt major=0, minor=0, micro=0, release=0
* CHKERR( PetscGetVersion(cversion, sizeof(cversion)) )
* CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) ) # <<<<<<<<<<<<<<
* out = version = (toInt(major), toInt(minor), toInt(micro))
* if devel or date or author:
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGetVersionNumber((&__pyx_v_major), (&__pyx_v_minor), (&__pyx_v_micro), (&__pyx_v_release))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 10, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":11
* CHKERR( PetscGetVersion(cversion, sizeof(cversion)) )
* CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) )
* out = version = (toInt(major), toInt(minor), toInt(micro)) # <<<<<<<<<<<<<<
* if devel or date or author:
* out = [version]
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_major); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 11, __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, 11, __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, 11, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 11, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
__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":12
* CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) )
* out = version = (toInt(major), toInt(minor), toInt(micro))
* if devel or date or author: # <<<<<<<<<<<<<<
* out = [version]
* if devel:
*/
__pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_devel); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(32, 12, __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, 12, __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, 12, __pyx_L1_error)
__pyx_t_6 = __pyx_t_7;
__pyx_L4_bool_binop_done:;
if (__pyx_t_6) {
/* "petsc4py/PETSc/Sys.pyx":13
* 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, 13, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_version);
__Pyx_GIVEREF(__pyx_v_version);
PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_version);
__Pyx_DECREF_SET(__pyx_v_out, __pyx_t_5);
__pyx_t_5 = 0;
/* "petsc4py/PETSc/Sys.pyx":14
* 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, 14, __pyx_L1_error)
if (__pyx_t_6) {
/* "petsc4py/PETSc/Sys.pyx":15
* out = [version]
* if devel:
* out.append(not <bint>release) # <<<<<<<<<<<<<<
* if date:
* vstr = bytes2str(cversion)
*/
__pyx_t_5 = __Pyx_PyBool_FromLong((!((__pyx_v_release != 0) != 0))); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 15, __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, 15, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/Sys.pyx":14
* if devel or date or author:
* out = [version]
* if devel: # <<<<<<<<<<<<<<
* out.append(not <bint>release)
* if date:
*/
}
/* "petsc4py/PETSc/Sys.pyx":16
* 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, 16, __pyx_L1_error)
if (__pyx_t_6) {
/* "petsc4py/PETSc/Sys.pyx":17
* 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, 17, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_v_vstr = __pyx_t_5;
__pyx_t_5 = 0;
/* "petsc4py/PETSc/Sys.pyx":18
* if date:
* vstr = bytes2str(cversion)
* if release != 0: # <<<<<<<<<<<<<<
* date = vstr.split(",", 1)[-1].strip()
* else:
*/
__pyx_t_6 = ((__pyx_v_release != 0) != 0);
if (__pyx_t_6) {
/* "petsc4py/PETSc/Sys.pyx":19
* vstr = bytes2str(cversion)
* if release != 0:
* date = vstr.split(",", 1)[-1].strip() # <<<<<<<<<<<<<<
* else:
* date = vstr.split("GIT Date:")[-1].strip()
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_vstr, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 19, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 19, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 19, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 19, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 19, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF_SET(__pyx_v_date, __pyx_t_5);
__pyx_t_5 = 0;
/* "petsc4py/PETSc/Sys.pyx":18
* if date:
* vstr = bytes2str(cversion)
* if release != 0: # <<<<<<<<<<<<<<
* date = vstr.split(",", 1)[-1].strip()
* else:
*/
goto __pyx_L9;
}
/* "petsc4py/PETSc/Sys.pyx":21
* date = vstr.split(",", 1)[-1].strip()
* else:
* date = vstr.split("GIT Date:")[-1].strip() # <<<<<<<<<<<<<<
* out.append(date)
* if author:
*/
/*else*/ {
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_vstr, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 21, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_kp_s_GIT_Date) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_GIT_Date);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 21, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 21, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 21, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 21, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF_SET(__pyx_v_date, __pyx_t_5);
__pyx_t_5 = 0;
}
__pyx_L9:;
/* "petsc4py/PETSc/Sys.pyx":22
* 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, 22, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":16
* if devel:
* out.append(not <bint>release)
* if date: # <<<<<<<<<<<<<<
* vstr = bytes2str(cversion)
* if release != 0:
*/
}
/* "petsc4py/PETSc/Sys.pyx":23
* 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, 23, __pyx_L1_error)
if (__pyx_t_6) {
/* "petsc4py/PETSc/Sys.pyx":24
* 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, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_s__13) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s__13);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_author, __pyx_t_5);
__pyx_t_5 = 0;
/* "petsc4py/PETSc/Sys.pyx":25
* 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, 25, __pyx_L13_error)
__Pyx_GOTREF(__pyx_t_5);
if (likely(PyList_CheckExact(__pyx_v_author)) || PyTuple_CheckExact(__pyx_v_author)) {
__pyx_t_4 = __pyx_v_author; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
__pyx_t_10 = NULL;
} else {
__pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_author); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 25, __pyx_L13_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 25, __pyx_L13_error)
}
for (;;) {
if (likely(!__pyx_t_10)) {
if (likely(PyList_CheckExact(__pyx_t_4))) {
if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(32, 25, __pyx_L13_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 25, __pyx_L13_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
} else {
if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(32, 25, __pyx_L13_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 25, __pyx_L13_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
}
} else {
__pyx_t_3 = __pyx_t_10(__pyx_t_4);
if (unlikely(!__pyx_t_3)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(32, 25, __pyx_L13_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_3);
}
__Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_s, __pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_8genexpr1__pyx_v_s); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(32, 25, __pyx_L13_error)
if (__pyx_t_6) {
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_s, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 25, __pyx_L13_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_11 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_11)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_3 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 25, __pyx_L13_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_3))) __PYX_ERR(32, 25, __pyx_L13_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_8genexpr1__pyx_v_s); __pyx_8genexpr1__pyx_v_s = 0;
goto __pyx_L17_exit_scope;
__pyx_L13_error:;
__Pyx_XDECREF(__pyx_8genexpr1__pyx_v_s); __pyx_8genexpr1__pyx_v_s = 0;
goto __pyx_L1_error;
__pyx_L17_exit_scope:;
} /* exit inner scope */
__pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 25, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_author, __pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Sys.pyx":26
* 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, 26, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":23
* 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":12
* CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) )
* out = version = (toInt(major), toInt(minor), toInt(micro))
* if devel or date or author: # <<<<<<<<<<<<<<
* out = [version]
* if devel:
*/
}
/* "petsc4py/PETSc/Sys.pyx":27
* author = tuple([s.strip() for s in author if s])
* out.append(author)
* return tuple(out) # <<<<<<<<<<<<<<
*
* @classmethod
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 27, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Sys.pyx":6
*
* @classmethod
* def getVersion(cls, devel=False, date=False, author=False): # <<<<<<<<<<<<<<
* cdef char cversion[256]
* cdef PetscInt major=0, minor=0, micro=0, release=0
*/
/* 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_11);
__Pyx_AddTraceback("petsc4py.PETSc.Sys.getVersion", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_out);
__Pyx_XDECREF(__pyx_v_version);
__Pyx_XDECREF(__pyx_v_vstr);
__Pyx_XDECREF(__pyx_8genexpr1__pyx_v_s);
__Pyx_XDECREF(__pyx_v_date);
__Pyx_XDECREF(__pyx_v_author);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Sys.pyx":30
*
* @classmethod
* def getVersionInfo(cls): # <<<<<<<<<<<<<<
* version, dev, date, author = cls.getVersion(True, True, True)
* return dict(major = version[0],
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_3getVersionInfo(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_2getVersionInfo[] = "Sys.getVersionInfo(type cls)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_3getVersionInfo(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getVersionInfo (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getVersionInfo", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVersionInfo", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_2getVersionInfo(((PyTypeObject*)__pyx_v_cls));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_2getVersionInfo(PyTypeObject *__pyx_v_cls) {
PyObject *__pyx_v_version = NULL;
PyObject *__pyx_v_dev = NULL;
PyObject *__pyx_v_date = NULL;
PyObject *__pyx_v_author = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *(*__pyx_t_7)(PyObject *);
int __pyx_t_8;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getVersionInfo", 0);
/* "petsc4py/PETSc/Sys.pyx":31
* @classmethod
* def getVersionInfo(cls):
* version, dev, date, author = cls.getVersion(True, True, True) # <<<<<<<<<<<<<<
* return dict(major = version[0],
* minor = version[1],
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_getVersion); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 31, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 31, __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, 31, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 3);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
__pyx_t_4 = PyList_GET_ITEM(sequence, 2);
__pyx_t_5 = PyList_GET_ITEM(sequence, 3);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
#else
{
Py_ssize_t i;
PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5};
for (i=0; i < 4; i++) {
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(32, 31, __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, 31, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
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, 31, __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, 31, __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":32
* def getVersionInfo(cls):
* 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, 32, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_version, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 32, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_major, __pyx_t_5) < 0) __PYX_ERR(32, 32, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/Sys.pyx":33
* version, dev, date, author = cls.getVersion(True, True, True)
* return dict(major = version[0],
* minor = version[1], # <<<<<<<<<<<<<<
* subminor = version[2],
* release = not dev,
*/
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_version, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 33, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_minor, __pyx_t_5) < 0) __PYX_ERR(32, 32, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/Sys.pyx":34
* return dict(major = version[0],
* minor = version[1],
* subminor = version[2], # <<<<<<<<<<<<<<
* release = not dev,
* date = date,
*/
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_version, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 34, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_subminor, __pyx_t_5) < 0) __PYX_ERR(32, 32, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/Sys.pyx":35
* 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, 35, __pyx_L1_error)
__pyx_t_5 = __Pyx_PyBool_FromLong((!__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 35, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_release, __pyx_t_5) < 0) __PYX_ERR(32, 32, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/Sys.pyx":36
* subminor = version[2],
* release = not dev,
* date = date, # <<<<<<<<<<<<<<
* authorinfo = author)
*
*/
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_date, __pyx_v_date) < 0) __PYX_ERR(32, 32, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":37
* release = not dev,
* date = date,
* authorinfo = author) # <<<<<<<<<<<<<<
*
* # --- xxx ---
*/
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_authorinfo, __pyx_v_author) < 0) __PYX_ERR(32, 32, __pyx_L1_error)
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Sys.pyx":30
*
* @classmethod
* def getVersionInfo(cls): # <<<<<<<<<<<<<<
* version, dev, date, author = cls.getVersion(True, True, True)
* return dict(major = version[0],
*/
/* 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":42
*
* @classmethod
* def isInitialized(cls): # <<<<<<<<<<<<<<
* return toBool(PetscInitializeCalled)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_5isInitialized(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_4isInitialized[] = "Sys.isInitialized(type cls)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_5isInitialized(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isInitialized (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("isInitialized", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isInitialized", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_4isInitialized(((PyTypeObject*)__pyx_v_cls));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_4isInitialized(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("isInitialized", 0);
/* "petsc4py/PETSc/Sys.pyx":43
* @classmethod
* def isInitialized(cls):
* 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, 43, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Sys.pyx":42
*
* @classmethod
* def isInitialized(cls): # <<<<<<<<<<<<<<
* return toBool(PetscInitializeCalled)
*
*/
/* 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":46
*
* @classmethod
* def isFinalized(cls): # <<<<<<<<<<<<<<
* return toBool(PetscFinalizeCalled)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_7isFinalized(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_6isFinalized[] = "Sys.isFinalized(type cls)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_7isFinalized(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isFinalized (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("isFinalized", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isFinalized", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_6isFinalized(((PyTypeObject*)__pyx_v_cls));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_6isFinalized(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("isFinalized", 0);
/* "petsc4py/PETSc/Sys.pyx":47
* @classmethod
* def isFinalized(cls):
* 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, 47, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Sys.pyx":46
*
* @classmethod
* def isFinalized(cls): # <<<<<<<<<<<<<<
* return toBool(PetscFinalizeCalled)
*
*/
/* 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":52
*
* @classmethod
* def getDefaultComm(cls): # <<<<<<<<<<<<<<
* cdef Comm comm = Comm()
* comm.comm = PETSC_COMM_DEFAULT
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_9getDefaultComm(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_8getDefaultComm[] = "Sys.getDefaultComm(type cls)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_9getDefaultComm(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDefaultComm (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDefaultComm", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDefaultComm", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_8getDefaultComm(((PyTypeObject*)__pyx_v_cls));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_8getDefaultComm(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) {
struct PyPetscCommObject *__pyx_v_comm = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDefaultComm", 0);
/* "petsc4py/PETSc/Sys.pyx":53
* @classmethod
* def getDefaultComm(cls):
* cdef Comm comm = Comm() # <<<<<<<<<<<<<<
* comm.comm = PETSC_COMM_DEFAULT
* return comm
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 53, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_comm = ((struct PyPetscCommObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Sys.pyx":54
* def getDefaultComm(cls):
* 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":55
* 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":52
*
* @classmethod
* def getDefaultComm(cls): # <<<<<<<<<<<<<<
* cdef Comm comm = Comm()
* comm.comm = PETSC_COMM_DEFAULT
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Sys.getDefaultComm", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_comm);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Sys.pyx":58
*
* @classmethod
* def setDefaultComm(cls, comm): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD)
* if ccomm == MPI_COMM_NULL:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_11setDefaultComm(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_10setDefaultComm[] = "Sys.setDefaultComm(type cls, comm)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_11setDefaultComm(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDefaultComm") < 0)) __PYX_ERR(32, 58, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDefaultComm", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 58, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_10setDefaultComm(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) {
MPI_Comm __pyx_v_ccomm;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setDefaultComm", 0);
/* "petsc4py/PETSc/Sys.pyx":59
* @classmethod
* def setDefaultComm(cls, comm):
* 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(PyErr_Occurred())) __PYX_ERR(32, 59, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Sys.pyx":60
* def setDefaultComm(cls, comm):
* 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) != 0);
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/Sys.pyx":61
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD)
* if ccomm == MPI_COMM_NULL:
* raise ValueError("null communicator") # <<<<<<<<<<<<<<
* global PETSC_COMM_DEFAULT
* PETSC_COMM_DEFAULT = ccomm
*/
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 61, __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, 61, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":60
* def setDefaultComm(cls, comm):
* 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":63
* 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":58
*
* @classmethod
* def setDefaultComm(cls, comm): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD)
* if ccomm == MPI_COMM_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.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":68
*
* @classmethod
* def Print(cls, *args, **kargs): # <<<<<<<<<<<<<<
* cdef object comm = kargs.get('comm', None)
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_13Print(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_12Print[] = "Sys.Print(type cls, *args, **kargs)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_13Print(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("Print (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "Print", 1))) return NULL;
__pyx_v_kargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kargs);
__Pyx_INCREF(__pyx_args);
__pyx_v_args = __pyx_args;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_12Print(((PyTypeObject*)__pyx_v_cls), __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_12Print(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
PyObject *__pyx_v_comm = 0;
MPI_Comm __pyx_v_ccomm;
PyObject *__pyx_v_sep = 0;
PyObject *__pyx_v_end = 0;
PyObject *__pyx_v_format = NULL;
PyObject *__pyx_v_message = NULL;
char const *__pyx_v_m;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
MPI_Comm __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
Py_ssize_t __pyx_t_6;
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":69
* @classmethod
* def Print(cls, *args, **kargs):
* cdef object comm = kargs.get('comm', None) # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef object sep = kargs.get('sep', ' ')
*/
__pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kargs, __pyx_n_s_comm, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 69, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_comm = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Sys.pyx":70
* def Print(cls, *args, **kargs):
* cdef object comm = kargs.get('comm', None)
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<<
* cdef object sep = kargs.get('sep', ' ')
* cdef object end = kargs.get('end', '\n')
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 70, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_2;
/* "petsc4py/PETSc/Sys.pyx":71
* cdef object comm = kargs.get('comm', None)
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef object sep = kargs.get('sep', ' ') # <<<<<<<<<<<<<<
* cdef object end = kargs.get('end', '\n')
* if comm_rank(ccomm) == 0:
*/
__pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kargs, __pyx_n_s_sep, __pyx_kp_s_); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 71, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_sep = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Sys.pyx":72
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef object sep = kargs.get('sep', ' ')
* cdef object end = kargs.get('end', '\n') # <<<<<<<<<<<<<<
* if comm_rank(ccomm) == 0:
* if not args: args = ('',)
*/
__pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kargs, __pyx_n_s_end, __pyx_kp_s__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 72, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_end = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Sys.pyx":73
* cdef object sep = kargs.get('sep', ' ')
* cdef object end = kargs.get('end', '\n')
* if comm_rank(ccomm) == 0: # <<<<<<<<<<<<<<
* if not args: args = ('',)
* format = ['%s', sep] * len(args)
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_comm_rank(__pyx_v_ccomm); if (unlikely(__pyx_t_3 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(32, 73, __pyx_L1_error)
__pyx_t_4 = ((__pyx_t_3 == 0) != 0);
if (__pyx_t_4) {
/* "petsc4py/PETSc/Sys.pyx":74
* cdef object end = kargs.get('end', '\n')
* if comm_rank(ccomm) == 0:
* if not args: args = ('',) # <<<<<<<<<<<<<<
* format = ['%s', sep] * len(args)
* format[-1] = end
*/
__pyx_t_4 = (PyTuple_GET_SIZE(__pyx_v_args) != 0);
__pyx_t_5 = ((!__pyx_t_4) != 0);
if (__pyx_t_5) {
__Pyx_INCREF(__pyx_tuple__17);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_tuple__17);
}
/* "petsc4py/PETSc/Sys.pyx":75
* if comm_rank(ccomm) == 0:
* if not args: args = ('',)
* format = ['%s', sep] * len(args) # <<<<<<<<<<<<<<
* format[-1] = end
* message = ''.join(format) % args
*/
__pyx_t_6 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(32, 75, __pyx_L1_error)
__pyx_t_1 = PyList_New(2 * ((__pyx_t_6<0) ? 0:__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 75, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
{ Py_ssize_t __pyx_temp;
for (__pyx_temp=0; __pyx_temp < __pyx_t_6; __pyx_temp++) {
__Pyx_INCREF(__pyx_kp_s_s);
__Pyx_GIVEREF(__pyx_kp_s_s);
PyList_SET_ITEM(__pyx_t_1, __pyx_temp * 2, __pyx_kp_s_s);
__Pyx_INCREF(__pyx_v_sep);
__Pyx_GIVEREF(__pyx_v_sep);
PyList_SET_ITEM(__pyx_t_1, __pyx_temp * 2 + 1, __pyx_v_sep);
}
}
__pyx_v_format = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Sys.pyx":76
* if not args: args = ('',)
* format = ['%s', sep] * len(args)
* format[-1] = end # <<<<<<<<<<<<<<
* message = ''.join(format) % args
* else:
*/
if (unlikely(__Pyx_SetItemInt(__pyx_v_format, -1L, __pyx_v_end, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(32, 76, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":77
* format = ['%s', sep] * len(args)
* format[-1] = end
* message = ''.join(format) % args # <<<<<<<<<<<<<<
* else:
* message = ''
*/
__pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 77, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = PyNumber_Remainder(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 77, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_message = __pyx_t_7;
__pyx_t_7 = 0;
/* "petsc4py/PETSc/Sys.pyx":73
* cdef object sep = kargs.get('sep', ' ')
* cdef object end = kargs.get('end', '\n')
* if comm_rank(ccomm) == 0: # <<<<<<<<<<<<<<
* if not args: args = ('',)
* format = ['%s', sep] * len(args)
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Sys.pyx":79
* message = ''.join(format) % args
* else:
* message = '' # <<<<<<<<<<<<<<
* cdef const char *m = NULL
* message = str2bytes(message, &m)
*/
/*else*/ {
__Pyx_INCREF(__pyx_kp_s__7);
__pyx_v_message = __pyx_kp_s__7;
}
__pyx_L3:;
/* "petsc4py/PETSc/Sys.pyx":80
* else:
* message = ''
* cdef const char *m = NULL # <<<<<<<<<<<<<<
* message = str2bytes(message, &m)
* CHKERR( PetscPrintf(ccomm, '%s', m) )
*/
__pyx_v_m = NULL;
/* "petsc4py/PETSc/Sys.pyx":81
* 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, 81, __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":82
* 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, 82, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":68
*
* @classmethod
* def Print(cls, *args, **kargs): # <<<<<<<<<<<<<<
* cdef object comm = kargs.get('comm', None)
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* 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_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_comm);
__Pyx_XDECREF(__pyx_v_sep);
__Pyx_XDECREF(__pyx_v_end);
__Pyx_XDECREF(__pyx_v_format);
__Pyx_XDECREF(__pyx_v_message);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Sys.pyx":85
*
* @classmethod
* def syncPrint(cls, *args, **kargs): # <<<<<<<<<<<<<<
* cdef object comm = kargs.get('comm', None)
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_15syncPrint(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_14syncPrint[] = "Sys.syncPrint(type cls, *args, **kargs)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_15syncPrint(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("syncPrint (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "syncPrint", 1))) return NULL;
__pyx_v_kargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kargs);
__Pyx_INCREF(__pyx_args);
__pyx_v_args = __pyx_args;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_14syncPrint(((PyTypeObject*)__pyx_v_cls), __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_14syncPrint(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
PyObject *__pyx_v_comm = 0;
MPI_Comm __pyx_v_ccomm;
PyObject *__pyx_v_sep = 0;
PyObject *__pyx_v_end = 0;
PyObject *__pyx_v_flush = 0;
PyObject *__pyx_v_format = NULL;
PyObject *__pyx_v_message = NULL;
char const *__pyx_v_m;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
MPI_Comm __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
Py_ssize_t __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PetscErrorCode __pyx_t_7;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("syncPrint", 0);
__Pyx_INCREF(__pyx_v_args);
/* "petsc4py/PETSc/Sys.pyx":86
* @classmethod
* def syncPrint(cls, *args, **kargs):
* cdef object comm = kargs.get('comm', None) # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef object sep = kargs.get('sep', ' ')
*/
__pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kargs, __pyx_n_s_comm, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 86, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_comm = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Sys.pyx":87
* def syncPrint(cls, *args, **kargs):
* cdef object comm = kargs.get('comm', None)
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<<
* cdef object sep = kargs.get('sep', ' ')
* cdef object end = kargs.get('end', '\n')
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 87, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_2;
/* "petsc4py/PETSc/Sys.pyx":88
* cdef object comm = kargs.get('comm', None)
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef object sep = kargs.get('sep', ' ') # <<<<<<<<<<<<<<
* cdef object end = kargs.get('end', '\n')
* cdef object flush = kargs.get('flush', False)
*/
__pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kargs, __pyx_n_s_sep, __pyx_kp_s_); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 88, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_sep = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Sys.pyx":89
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef object sep = kargs.get('sep', ' ')
* cdef object end = kargs.get('end', '\n') # <<<<<<<<<<<<<<
* cdef object flush = kargs.get('flush', False)
* if not args: args = ('',)
*/
__pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kargs, __pyx_n_s_end, __pyx_kp_s__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_end = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Sys.pyx":90
* cdef object sep = kargs.get('sep', ' ')
* cdef object end = kargs.get('end', '\n')
* cdef object flush = kargs.get('flush', False) # <<<<<<<<<<<<<<
* if not args: args = ('',)
* format = ['%s', sep] * len(args)
*/
__pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kargs, __pyx_n_s_flush, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_flush = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Sys.pyx":91
* cdef object end = kargs.get('end', '\n')
* cdef object flush = kargs.get('flush', False)
* if not args: args = ('',) # <<<<<<<<<<<<<<
* format = ['%s', sep] * len(args)
* format[-1] = end
*/
__pyx_t_3 = (PyTuple_GET_SIZE(__pyx_v_args) != 0);
__pyx_t_4 = ((!__pyx_t_3) != 0);
if (__pyx_t_4) {
__Pyx_INCREF(__pyx_tuple__17);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_tuple__17);
}
/* "petsc4py/PETSc/Sys.pyx":92
* cdef object flush = kargs.get('flush', False)
* if not args: args = ('',)
* format = ['%s', sep] * len(args) # <<<<<<<<<<<<<<
* format[-1] = end
* message = ''.join(format) % args
*/
__pyx_t_5 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(32, 92, __pyx_L1_error)
__pyx_t_1 = PyList_New(2 * ((__pyx_t_5<0) ? 0:__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 92, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
{ Py_ssize_t __pyx_temp;
for (__pyx_temp=0; __pyx_temp < __pyx_t_5; __pyx_temp++) {
__Pyx_INCREF(__pyx_kp_s_s);
__Pyx_GIVEREF(__pyx_kp_s_s);
PyList_SET_ITEM(__pyx_t_1, __pyx_temp * 2, __pyx_kp_s_s);
__Pyx_INCREF(__pyx_v_sep);
__Pyx_GIVEREF(__pyx_v_sep);
PyList_SET_ITEM(__pyx_t_1, __pyx_temp * 2 + 1, __pyx_v_sep);
}
}
__pyx_v_format = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Sys.pyx":93
* if not args: args = ('',)
* format = ['%s', sep] * len(args)
* format[-1] = end # <<<<<<<<<<<<<<
* message = ''.join(format) % args
* cdef const char *m = NULL
*/
if (unlikely(__Pyx_SetItemInt(__pyx_v_format, -1L, __pyx_v_end, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(32, 93, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":94
* format = ['%s', sep] * len(args)
* format[-1] = end
* message = ''.join(format) % args # <<<<<<<<<<<<<<
* cdef const char *m = NULL
* message = str2bytes(message, &m)
*/
__pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 94, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = PyNumber_Remainder(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(32, 94, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_message = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/Sys.pyx":95
* 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":96
* 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, 96, __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":97
* 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, 97, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":98
* message = str2bytes(message, &m)
* CHKERR( PetscSynchronizedPrintf(ccomm, '%s', m) )
* if flush: CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) # <<<<<<<<<<<<<<
*
* @classmethod
*/
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_flush); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(32, 98, __pyx_L1_error)
if (__pyx_t_4) {
__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, 98, __pyx_L1_error)
}
/* "petsc4py/PETSc/Sys.pyx":85
*
* @classmethod
* def syncPrint(cls, *args, **kargs): # <<<<<<<<<<<<<<
* cdef object comm = kargs.get('comm', None)
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* 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_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_comm);
__Pyx_XDECREF(__pyx_v_sep);
__Pyx_XDECREF(__pyx_v_end);
__Pyx_XDECREF(__pyx_v_flush);
__Pyx_XDECREF(__pyx_v_format);
__Pyx_XDECREF(__pyx_v_message);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Sys.pyx":101
*
* @classmethod
* def syncFlush(cls, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_17syncFlush(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_16syncFlush[] = "Sys.syncFlush(type cls, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_17syncFlush(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "syncFlush") < 0)) __PYX_ERR(32, 101, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("syncFlush", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 101, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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":102
* @classmethod
* def syncFlush(cls, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(32, 102, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Sys.pyx":103
* def syncFlush(cls, comm=None):
* 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, 103, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":101
*
* @classmethod
* def syncFlush(cls, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) )
*/
/* 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":108
*
* @classmethod
* def splitOwnership(cls, size, bsize=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt bs=0, n=0, N=0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_19splitOwnership(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_18splitOwnership[] = "Sys.splitOwnership(type cls, size, bsize=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_19splitOwnership(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_size = 0;
PyObject *__pyx_v_bsize = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "splitOwnership") < 0)) __PYX_ERR(32, 108, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_bsize = values[1];
__pyx_v_comm = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("splitOwnership", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 108, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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":109
* @classmethod
* def splitOwnership(cls, size, bsize=None, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(32, 109, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Sys.pyx":110
* def splitOwnership(cls, size, bsize=None, comm=None):
* 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":111
* 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, 111, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":112
* 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) != 0);
if (__pyx_t_3) {
__pyx_v_bs = 1;
}
/* "petsc4py/PETSc/Sys.pyx":113
* 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) != 0);
if (__pyx_t_3) {
__pyx_v_n = (__pyx_v_n / __pyx_v_bs);
}
/* "petsc4py/PETSc/Sys.pyx":114
* 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) != 0);
if (__pyx_t_3) {
__pyx_v_N = (__pyx_v_N / __pyx_v_bs);
}
/* "petsc4py/PETSc/Sys.pyx":115
* 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, 115, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":116
* 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":117
* 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":118
* 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, 118, __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, 118, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(32, 118, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
__pyx_t_4 = 0;
__pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Sys.pyx":108
*
* @classmethod
* def splitOwnership(cls, size, bsize=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt bs=0, n=0, N=0
*/
/* 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":121
*
* @classmethod
* def sleep(cls, seconds=1): # <<<<<<<<<<<<<<
* cdef int s = seconds
* CHKERR( PetscSleep(s) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_21sleep(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_20sleep[] = "Sys.sleep(type cls, seconds=1)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_21sleep(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_seconds = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seconds,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)__pyx_int_1);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seconds);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sleep") < 0)) __PYX_ERR(32, 121, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_seconds = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("sleep", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 121, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_20sleep(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_seconds) {
int __pyx_v_s;
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("sleep", 0);
/* "petsc4py/PETSc/Sys.pyx":122
* @classmethod
* def sleep(cls, seconds=1):
* cdef int s = seconds # <<<<<<<<<<<<<<
* CHKERR( PetscSleep(s) )
*
*/
__pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_seconds); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(32, 122, __pyx_L1_error)
__pyx_v_s = __pyx_t_1;
/* "petsc4py/PETSc/Sys.pyx":123
* def sleep(cls, seconds=1):
* cdef int s = 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, 123, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":121
*
* @classmethod
* def sleep(cls, seconds=1): # <<<<<<<<<<<<<<
* cdef int s = seconds
* CHKERR( PetscSleep(s) )
*/
/* 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":128
*
* @classmethod
* def pushErrorHandler(cls, errhandler): # <<<<<<<<<<<<<<
* cdef PetscErrorHandlerFunction handler = NULL
* if errhandler == "python":
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_23pushErrorHandler(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_22pushErrorHandler[] = "Sys.pushErrorHandler(type cls, errhandler)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_23pushErrorHandler(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_errhandler = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_errhandler,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_errhandler)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pushErrorHandler") < 0)) __PYX_ERR(32, 128, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_errhandler = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("pushErrorHandler", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 128, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_22pushErrorHandler(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_errhandler) {
PetscErrorHandlerFunction __pyx_v_handler;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pushErrorHandler", 0);
/* "petsc4py/PETSc/Sys.pyx":129
* @classmethod
* def pushErrorHandler(cls, errhandler):
* cdef PetscErrorHandlerFunction handler = NULL # <<<<<<<<<<<<<<
* if errhandler == "python":
* handler = <PetscErrorHandlerFunction> \
*/
__pyx_v_handler = NULL;
/* "petsc4py/PETSc/Sys.pyx":130
* def pushErrorHandler(cls, errhandler):
* cdef PetscErrorHandlerFunction handler = NULL
* if errhandler == "python": # <<<<<<<<<<<<<<
* handler = <PetscErrorHandlerFunction> \
* PetscPythonErrorHandler
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_python, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(32, 130, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Sys.pyx":131
* cdef PetscErrorHandlerFunction handler = NULL
* if errhandler == "python":
* handler = <PetscErrorHandlerFunction> \ # <<<<<<<<<<<<<<
* PetscPythonErrorHandler
* elif errhandler == "debugger":
*/
__pyx_v_handler = ((PetscErrorHandlerFunction)__pyx_f_8petsc4py_5PETSc_PetscPythonErrorHandler);
/* "petsc4py/PETSc/Sys.pyx":130
* def pushErrorHandler(cls, errhandler):
* cdef PetscErrorHandlerFunction handler = NULL
* if errhandler == "python": # <<<<<<<<<<<<<<
* handler = <PetscErrorHandlerFunction> \
* PetscPythonErrorHandler
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Sys.pyx":133
* handler = <PetscErrorHandlerFunction> \
* PetscPythonErrorHandler
* elif errhandler == "debugger": # <<<<<<<<<<<<<<
* handler = PetscAttachDebuggerErrorHandler
* elif errhandler == "emacs":
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_debugger, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(32, 133, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Sys.pyx":134
* PetscPythonErrorHandler
* elif errhandler == "debugger":
* handler = PetscAttachDebuggerErrorHandler # <<<<<<<<<<<<<<
* elif errhandler == "emacs":
* handler = PetscEmacsClientErrorHandler
*/
__pyx_v_handler = PetscAttachDebuggerErrorHandler;
/* "petsc4py/PETSc/Sys.pyx":133
* handler = <PetscErrorHandlerFunction> \
* PetscPythonErrorHandler
* elif errhandler == "debugger": # <<<<<<<<<<<<<<
* handler = PetscAttachDebuggerErrorHandler
* elif errhandler == "emacs":
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Sys.pyx":135
* elif errhandler == "debugger":
* handler = PetscAttachDebuggerErrorHandler
* elif errhandler == "emacs": # <<<<<<<<<<<<<<
* handler = PetscEmacsClientErrorHandler
* elif errhandler == "traceback":
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_emacs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(32, 135, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Sys.pyx":136
* handler = PetscAttachDebuggerErrorHandler
* elif errhandler == "emacs":
* handler = PetscEmacsClientErrorHandler # <<<<<<<<<<<<<<
* elif errhandler == "traceback":
* handler = PetscTraceBackErrorHandler
*/
__pyx_v_handler = PetscEmacsClientErrorHandler;
/* "petsc4py/PETSc/Sys.pyx":135
* elif errhandler == "debugger":
* handler = PetscAttachDebuggerErrorHandler
* elif errhandler == "emacs": # <<<<<<<<<<<<<<
* handler = PetscEmacsClientErrorHandler
* elif errhandler == "traceback":
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Sys.pyx":137
* elif errhandler == "emacs":
* handler = PetscEmacsClientErrorHandler
* elif errhandler == "traceback": # <<<<<<<<<<<<<<
* handler = PetscTraceBackErrorHandler
* elif errhandler == "ignore":
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_traceback_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(32, 137, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Sys.pyx":138
* handler = PetscEmacsClientErrorHandler
* elif errhandler == "traceback":
* handler = PetscTraceBackErrorHandler # <<<<<<<<<<<<<<
* elif errhandler == "ignore":
* handler = PetscIgnoreErrorHandler
*/
__pyx_v_handler = PetscTraceBackErrorHandler;
/* "petsc4py/PETSc/Sys.pyx":137
* elif errhandler == "emacs":
* handler = PetscEmacsClientErrorHandler
* elif errhandler == "traceback": # <<<<<<<<<<<<<<
* handler = PetscTraceBackErrorHandler
* elif errhandler == "ignore":
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Sys.pyx":139
* elif errhandler == "traceback":
* handler = PetscTraceBackErrorHandler
* elif errhandler == "ignore": # <<<<<<<<<<<<<<
* handler = PetscIgnoreErrorHandler
* elif errhandler == "mpiabort":
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_ignore, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(32, 139, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Sys.pyx":140
* handler = PetscTraceBackErrorHandler
* elif errhandler == "ignore":
* handler = PetscIgnoreErrorHandler # <<<<<<<<<<<<<<
* elif errhandler == "mpiabort":
* handler = PetscMPIAbortErrorHandler
*/
__pyx_v_handler = PetscIgnoreErrorHandler;
/* "petsc4py/PETSc/Sys.pyx":139
* elif errhandler == "traceback":
* handler = PetscTraceBackErrorHandler
* elif errhandler == "ignore": # <<<<<<<<<<<<<<
* handler = PetscIgnoreErrorHandler
* elif errhandler == "mpiabort":
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Sys.pyx":141
* elif errhandler == "ignore":
* handler = PetscIgnoreErrorHandler
* elif errhandler == "mpiabort": # <<<<<<<<<<<<<<
* handler = PetscMPIAbortErrorHandler
* elif errhandler == "abort":
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_mpiabort, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(32, 141, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Sys.pyx":142
* handler = PetscIgnoreErrorHandler
* elif errhandler == "mpiabort":
* handler = PetscMPIAbortErrorHandler # <<<<<<<<<<<<<<
* elif errhandler == "abort":
* handler = PetscAbortErrorHandler
*/
__pyx_v_handler = PetscMPIAbortErrorHandler;
/* "petsc4py/PETSc/Sys.pyx":141
* elif errhandler == "ignore":
* handler = PetscIgnoreErrorHandler
* elif errhandler == "mpiabort": # <<<<<<<<<<<<<<
* handler = PetscMPIAbortErrorHandler
* elif errhandler == "abort":
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Sys.pyx":143
* elif errhandler == "mpiabort":
* handler = PetscMPIAbortErrorHandler
* elif errhandler == "abort": # <<<<<<<<<<<<<<
* handler = PetscAbortErrorHandler
* else:
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_abort, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(32, 143, __pyx_L1_error)
if (likely(__pyx_t_1)) {
/* "petsc4py/PETSc/Sys.pyx":144
* handler = PetscMPIAbortErrorHandler
* elif errhandler == "abort":
* handler = PetscAbortErrorHandler # <<<<<<<<<<<<<<
* else:
* raise ValueError(
*/
__pyx_v_handler = PetscAbortErrorHandler;
/* "petsc4py/PETSc/Sys.pyx":143
* elif errhandler == "mpiabort":
* handler = PetscMPIAbortErrorHandler
* elif errhandler == "abort": # <<<<<<<<<<<<<<
* handler = PetscAbortErrorHandler
* else:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Sys.pyx":146
* handler = PetscAbortErrorHandler
* else:
* raise ValueError( # <<<<<<<<<<<<<<
* "unknown error handler: %s" % errhandler)
* CHKERR( PetscPushErrorHandler(handler, NULL) )
*/
/*else*/ {
/* "petsc4py/PETSc/Sys.pyx":147
* else:
* raise ValueError(
* "unknown error handler: %s" % errhandler) # <<<<<<<<<<<<<<
* CHKERR( PetscPushErrorHandler(handler, NULL) )
*
*/
__pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_error_handler_s, __pyx_v_errhandler); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 147, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
/* "petsc4py/PETSc/Sys.pyx":146
* handler = PetscAbortErrorHandler
* else:
* raise ValueError( # <<<<<<<<<<<<<<
* "unknown error handler: %s" % errhandler)
* CHKERR( PetscPushErrorHandler(handler, NULL) )
*/
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(32, 146, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/Sys.pyx":148
* raise ValueError(
* "unknown error handler: %s" % errhandler)
* CHKERR( PetscPushErrorHandler(handler, NULL) ) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPushErrorHandler(__pyx_v_handler, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 148, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":128
*
* @classmethod
* def pushErrorHandler(cls, errhandler): # <<<<<<<<<<<<<<
* cdef PetscErrorHandlerFunction handler = NULL
* if errhandler == "python":
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Sys.pushErrorHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Sys.pyx":152
*
* @classmethod
* def popErrorHandler(cls): # <<<<<<<<<<<<<<
* CHKERR( PetscPopErrorHandler() )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_25popErrorHandler(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_24popErrorHandler[] = "Sys.popErrorHandler(type cls)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_25popErrorHandler(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("popErrorHandler (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("popErrorHandler", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popErrorHandler", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_24popErrorHandler(((PyTypeObject*)__pyx_v_cls));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_24popErrorHandler(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("popErrorHandler", 0);
/* "petsc4py/PETSc/Sys.pyx":153
* @classmethod
* def popErrorHandler(cls):
* CHKERR( PetscPopErrorHandler() ) # <<<<<<<<<<<<<<
*
* @classmethod
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPopErrorHandler()); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 153, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":152
*
* @classmethod
* def popErrorHandler(cls): # <<<<<<<<<<<<<<
* CHKERR( PetscPopErrorHandler() )
*
*/
/* 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":156
*
* @classmethod
* def popSignalHandler(cls): # <<<<<<<<<<<<<<
* CHKERR( PetscPopSignalHandler() )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_27popSignalHandler(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_26popSignalHandler[] = "Sys.popSignalHandler(type cls)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_27popSignalHandler(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("popSignalHandler (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("popSignalHandler", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popSignalHandler", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_26popSignalHandler(((PyTypeObject*)__pyx_v_cls));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_26popSignalHandler(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("popSignalHandler", 0);
/* "petsc4py/PETSc/Sys.pyx":157
* @classmethod
* def popSignalHandler(cls):
* CHKERR( PetscPopSignalHandler() ) # <<<<<<<<<<<<<<
*
* @classmethod
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPopSignalHandler()); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 157, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":156
*
* @classmethod
* def popSignalHandler(cls): # <<<<<<<<<<<<<<
* CHKERR( PetscPopSignalHandler() )
*
*/
/* 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":160
*
* @classmethod
* def infoAllow(cls, flag, filename=None, mode="w"): # <<<<<<<<<<<<<<
* cdef PetscBool tval = PETSC_FALSE
* cdef const char *cfilename = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_29infoAllow(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_28infoAllow[] = "Sys.infoAllow(type cls, flag, filename=None, mode='w')";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_29infoAllow(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flag = 0;
PyObject *__pyx_v_filename = 0;
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_filename,&__pyx_n_s_mode,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)__pyx_n_s_w);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "infoAllow") < 0)) __PYX_ERR(32, 160, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_flag = values[0];
__pyx_v_filename = values[1];
__pyx_v_mode = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("infoAllow", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 160, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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;
int __pyx_t_3;
PyObject *__pyx_t_4 = 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":161
* @classmethod
* def infoAllow(cls, flag, filename=None, mode="w"):
* cdef PetscBool tval = PETSC_FALSE # <<<<<<<<<<<<<<
* cdef const char *cfilename = NULL
* cdef const char *cmode = NULL
*/
__pyx_v_tval = PETSC_FALSE;
/* "petsc4py/PETSc/Sys.pyx":162
* def infoAllow(cls, flag, filename=None, mode="w"):
* 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":163
* 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":164
* 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, 164, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_v_tval = PETSC_TRUE;
}
/* "petsc4py/PETSc/Sys.pyx":165
* 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, 165, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":166
* 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);
__pyx_t_3 = (__pyx_t_1 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Sys.pyx":167
* CHKERR( PetscInfoAllow(tval) )
* if filename is not None:
* filename = str2bytes(filename, &cfilename) # <<<<<<<<<<<<<<
* mode = str2bytes(mode, &cmode)
* CHKERR( PetscInfoSetFile(cfilename, cmode) )
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_filename, (&__pyx_v_cfilename)); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Sys.pyx":168
* if filename is not None:
* filename = str2bytes(filename, &cfilename)
* mode = str2bytes(mode, &cmode) # <<<<<<<<<<<<<<
* CHKERR( PetscInfoSetFile(cfilename, cmode) )
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mode, (&__pyx_v_cmode)); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Sys.pyx":169
* 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, 169, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":166
* 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":160
*
* @classmethod
* def infoAllow(cls, flag, filename=None, mode="w"): # <<<<<<<<<<<<<<
* cdef PetscBool tval = PETSC_FALSE
* cdef const char *cfilename = NULL
*/
/* 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.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":172
*
* @classmethod
* def registerCitation(cls, citation): # <<<<<<<<<<<<<<
* if not citation: raise ValueError("empty citation")
* cdef const char *cit = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_31registerCitation(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_30registerCitation[] = "Sys.registerCitation(type cls, citation)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_31registerCitation(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_citation = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_citation,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_citation)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "registerCitation") < 0)) __PYX_ERR(32, 172, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_citation = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("registerCitation", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 172, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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;
PetscErrorCode __pyx_t_4;
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":173
* @classmethod
* def registerCitation(cls, citation):
* 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, 173, __pyx_L1_error)
__pyx_t_2 = ((!__pyx_t_1) != 0);
if (unlikely(__pyx_t_2)) {
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 173, __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, 173, __pyx_L1_error)
}
/* "petsc4py/PETSc/Sys.pyx":174
* def registerCitation(cls, citation):
* 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":175
* 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, 175, __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":176
* 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_v_flag = __pyx_f_8petsc4py_5PETSc_get_citation(__pyx_v_citation);
/* "petsc4py/PETSc/Sys.pyx":177
* citation = str2bytes(citation, &cit)
* cdef PetscBool flag = get_citation(citation)
* CHKERR( PetscCitationsRegister(cit, &flag) ) # <<<<<<<<<<<<<<
* set_citation(citation, toBool(flag))
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscCitationsRegister(__pyx_v_cit, (&__pyx_v_flag))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 177, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":178
* 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, 178, __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, 178, __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, 178, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/Sys.pyx":172
*
* @classmethod
* def registerCitation(cls, citation): # <<<<<<<<<<<<<<
* if not citation: raise ValueError("empty citation")
* cdef const char *cit = 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.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":181
*
* @classmethod
* def hasExternalPackage(cls, package): # <<<<<<<<<<<<<<
* cdef const char *cpackage = NULL
* package = str2bytes(package, &cpackage)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_33hasExternalPackage(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Sys_32hasExternalPackage[] = "Sys.hasExternalPackage(type cls, package)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_33hasExternalPackage(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_package = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_package,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_package)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hasExternalPackage") < 0)) __PYX_ERR(32, 181, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_package = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("hasExternalPackage", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 181, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":182
* @classmethod
* def hasExternalPackage(cls, package):
* cdef const char *cpackage = NULL # <<<<<<<<<<<<<<
* package = str2bytes(package, &cpackage)
* cdef PetscBool has = PETSC_FALSE
*/
__pyx_v_cpackage = NULL;
/* "petsc4py/PETSc/Sys.pyx":183
* def hasExternalPackage(cls, package):
* 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, 183, __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":184
* 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":185
* 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, 185, __pyx_L1_error)
/* "petsc4py/PETSc/Sys.pyx":186
* 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, 186, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Sys.pyx":181
*
* @classmethod
* def hasExternalPackage(cls, package): # <<<<<<<<<<<<<<
* cdef const char *cpackage = NULL
* package = str2bytes(package, &cpackage)
*/
/* 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":191
* 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":192
*
* 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, 192, __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, 192, __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, 192, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_is_set = __pyx_t_2;
/* "petsc4py/PETSc/Sys.pyx":193
* 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 != 0)) {
__pyx_t_3 = PETSC_TRUE;
} else {
__pyx_t_3 = PETSC_FALSE;
}
__pyx_r = __pyx_t_3;
goto __pyx_L0;
/* "petsc4py/PETSc/Sys.pyx":191
* 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_WriteUnraisable("petsc4py.PETSc.get_citation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
__pyx_r = (PetscBool) 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Sys.pyx":195
* 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":196
*
* 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, 196, __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, 196, __pyx_L1_error)
}
if (unlikely(PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_citations_registry, __pyx_v_citation, __pyx_t_1) < 0)) __PYX_ERR(32, 196, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Sys.pyx":195
* 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":8
*
* @classmethod
* def Stage(cls, name): # <<<<<<<<<<<<<<
* if not name: raise ValueError("empty name")
* cdef const char *cname = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_1Stage(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Log_Stage[] = "Log.Stage(type cls, name)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_1Stage(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Stage") < 0)) __PYX_ERR(33, 8, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_name = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("Stage", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 8, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_Stage(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name) {
char const *__pyx_v_cname;
PetscLogStage __pyx_v_stageid;
struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_stage = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("Stage", 0);
__Pyx_INCREF(__pyx_v_name);
/* "petsc4py/PETSc/Log.pyx":9
* @classmethod
* def Stage(cls, name):
* if not name: raise ValueError("empty name") # <<<<<<<<<<<<<<
* cdef const char *cname = NULL
* name = str2bytes(name, &cname)
*/
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(33, 9, __pyx_L1_error)
__pyx_t_2 = ((!__pyx_t_1) != 0);
if (unlikely(__pyx_t_2)) {
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 9, __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, 9, __pyx_L1_error)
}
/* "petsc4py/PETSc/Log.pyx":10
* def Stage(cls, name):
* if not name: raise ValueError("empty name")
* cdef const char *cname = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cname)
* cdef PetscLogStage stageid = -1
*/
__pyx_v_cname = NULL;
/* "petsc4py/PETSc/Log.pyx":11
* 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, 11, __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":12
* 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":13
* 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, 13, __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":14
* 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);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_stage));
__pyx_r = ((PyObject *)__pyx_v_stage);
goto __pyx_L0;
}
/* "petsc4py/PETSc/Log.pyx":15
* cdef LogStage stage = get_LogStage(name)
* if stage is not None: return stage
* CHKERR( PetscLogStageFindId(cname, &stageid) ) # <<<<<<<<<<<<<<
* if stageid == -1:
* CHKERR( PetscLogStageRegister(cname, &stageid) )
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageFindId(__pyx_v_cname, (&__pyx_v_stageid))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 15, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":16
* 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_1 = ((__pyx_v_stageid == -1L) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Log.pyx":17
* CHKERR( PetscLogStageFindId(cname, &stageid) )
* if stageid == -1:
* CHKERR( PetscLogStageRegister(cname, &stageid) ) # <<<<<<<<<<<<<<
* stage = reg_LogStage(name, stageid)
* return stage
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageRegister(__pyx_v_cname, (&__pyx_v_stageid))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 17, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":16
* 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":18
* 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, 18, __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":19
* 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":8
*
* @classmethod
* def Stage(cls, name): # <<<<<<<<<<<<<<
* if not name: raise ValueError("empty name")
* cdef const char *cname = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Log.Stage", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_stage);
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":22
*
* @classmethod
* def Class(cls, name): # <<<<<<<<<<<<<<
* if not name: raise ValueError("empty name")
* cdef const char *cname = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_3Class(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Log_2Class[] = "Log.Class(type cls, name)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_3Class(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Class") < 0)) __PYX_ERR(33, 22, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_name = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("Class", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 22, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_2Class(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name) {
char const *__pyx_v_cname;
PetscClassId __pyx_v_classid;
struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_klass = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("Class", 0);
__Pyx_INCREF(__pyx_v_name);
/* "petsc4py/PETSc/Log.pyx":23
* @classmethod
* def Class(cls, name):
* if not name: raise ValueError("empty name") # <<<<<<<<<<<<<<
* cdef const char *cname = NULL
* name = str2bytes(name, &cname)
*/
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(33, 23, __pyx_L1_error)
__pyx_t_2 = ((!__pyx_t_1) != 0);
if (unlikely(__pyx_t_2)) {
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 23, __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, 23, __pyx_L1_error)
}
/* "petsc4py/PETSc/Log.pyx":24
* def Class(cls, name):
* if not name: raise ValueError("empty name")
* cdef const char *cname = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cname)
* cdef PetscLogClass classid = -1
*/
__pyx_v_cname = NULL;
/* "petsc4py/PETSc/Log.pyx":25
* 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, 25, __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":26
* 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":27
* 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, 27, __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":28
* 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);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_klass));
__pyx_r = ((PyObject *)__pyx_v_klass);
goto __pyx_L0;
}
/* "petsc4py/PETSc/Log.pyx":29
* cdef LogClass klass = get_LogClass(name)
* if klass is not None: return klass
* CHKERR( PetscLogClassFindId(cname, &classid) ) # <<<<<<<<<<<<<<
* if classid == -1:
* CHKERR( PetscLogClassRegister(cname, &classid) )
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogClassFindId(__pyx_v_cname, (&__pyx_v_classid))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 29, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":30
* 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_1 = ((__pyx_v_classid == -1L) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Log.pyx":31
* CHKERR( PetscLogClassFindId(cname, &classid) )
* if classid == -1:
* CHKERR( PetscLogClassRegister(cname, &classid) ) # <<<<<<<<<<<<<<
* klass = reg_LogClass(name, classid)
* return klass
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscClassIdRegister(__pyx_v_cname, (&__pyx_v_classid))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 31, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":30
* 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":32
* 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, 32, __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":33
* 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":22
*
* @classmethod
* def Class(cls, name): # <<<<<<<<<<<<<<
* if not name: raise ValueError("empty name")
* cdef const char *cname = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Log.Class", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_klass);
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":36
*
* @classmethod
* def Event(cls, name, klass=None): # <<<<<<<<<<<<<<
* if not name: raise ValueError("empty name")
* cdef const char *cname = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_5Event(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Log_4Event[] = "Log.Event(type cls, name, klass=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_5Event(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_klass = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_klass,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_klass);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Event") < 0)) __PYX_ERR(33, 36, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_klass = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("Event", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 36, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_4Event(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_klass) {
char const *__pyx_v_cname;
PetscClassId __pyx_v_classid;
PetscLogEvent __pyx_v_eventid;
struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_event = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscClassId __pyx_t_4;
PetscErrorCode __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("Event", 0);
__Pyx_INCREF(__pyx_v_name);
/* "petsc4py/PETSc/Log.pyx":37
* @classmethod
* def Event(cls, name, klass=None):
* if not name: raise ValueError("empty name") # <<<<<<<<<<<<<<
* cdef const char *cname = NULL
* name = str2bytes(name, &cname)
*/
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(33, 37, __pyx_L1_error)
__pyx_t_2 = ((!__pyx_t_1) != 0);
if (unlikely(__pyx_t_2)) {
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 37, __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, 37, __pyx_L1_error)
}
/* "petsc4py/PETSc/Log.pyx":38
* def Event(cls, name, klass=None):
* if not name: raise ValueError("empty name")
* cdef const char *cname = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cname)
* cdef PetscLogClass classid = PETSC_OBJECT_CLASSID
*/
__pyx_v_cname = NULL;
/* "petsc4py/PETSc/Log.pyx":39
* 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, 39, __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":40
* 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":41
* 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":42
* 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);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __Pyx_PyInt_As_PetscClassId(__pyx_v_klass); if (unlikely((__pyx_t_4 == ((PetscClassId)-1)) && PyErr_Occurred())) __PYX_ERR(33, 42, __pyx_L1_error)
__pyx_v_classid = __pyx_t_4;
}
/* "petsc4py/PETSc/Log.pyx":43
* 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, 43, __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":44
* 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_1 = (((PyObject *)__pyx_v_event) != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
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":45
* cdef LogEvent event = get_LogEvent(name)
* if event is not None: return event
* CHKERR( PetscLogEventFindId(cname, &eventid) ) # <<<<<<<<<<<<<<
* if eventid == -1:
* CHKERR( PetscLogEventRegister(cname, classid, &eventid) )
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventFindId(__pyx_v_cname, (&__pyx_v_eventid))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 45, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":46
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Log.pyx":47
* CHKERR( PetscLogEventFindId(cname, &eventid) )
* if eventid == -1:
* CHKERR( PetscLogEventRegister(cname, classid, &eventid) ) # <<<<<<<<<<<<<<
* event = reg_LogEvent(name, eventid)
* return event
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventRegister(__pyx_v_cname, __pyx_v_classid, (&__pyx_v_eventid))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 47, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":46
* 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":48
* 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, 48, __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":49
* 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":36
*
* @classmethod
* def Event(cls, name, klass=None): # <<<<<<<<<<<<<<
* if not name: raise ValueError("empty name")
* cdef const char *cname = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Log.Event", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_event);
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":52
*
* @classmethod
* def begin(cls, all=False): # <<<<<<<<<<<<<<
* if all: CHKERR( PetscLogAllBegin() )
* else: CHKERR( PetscLogDefaultBegin() )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_7begin(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Log_6begin[] = "Log.begin(type cls, all=False)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_7begin(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_all = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_all,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_False);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_all);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "begin") < 0)) __PYX_ERR(33, 52, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_all = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("begin", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 52, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Log.begin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_6begin(((PyTypeObject*)__pyx_v_cls), __pyx_v_all);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_6begin(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_all) {
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":53
* @classmethod
* def begin(cls, all=False):
* if all: CHKERR( PetscLogAllBegin() ) # <<<<<<<<<<<<<<
* else: CHKERR( PetscLogDefaultBegin() )
*
*/
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_all); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(33, 53, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogAllBegin()); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 53, __pyx_L1_error)
goto __pyx_L3;
}
/* "petsc4py/PETSc/Log.pyx":54
* def begin(cls, all=False):
* if all: CHKERR( PetscLogAllBegin() )
* else: CHKERR( PetscLogDefaultBegin() ) # <<<<<<<<<<<<<<
*
* @classmethod
*/
/*else*/ {
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogDefaultBegin()); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 54, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/Log.pyx":52
*
* @classmethod
* def begin(cls, all=False): # <<<<<<<<<<<<<<
* if all: CHKERR( PetscLogAllBegin() )
* else: CHKERR( PetscLogDefaultBegin() )
*/
/* 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":57
*
* @classmethod
* def view(cls, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_9view(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Log_8view[] = "Log.view(type cls, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_9view(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(33, 57, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 57, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Log.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(33, 57, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_8view(((PyTypeObject*)__pyx_v_cls), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/Log.pyx":58
* @classmethod
* def view(cls, Viewer viewer=None):
* 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":59
* def view(cls, Viewer viewer=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
}
/* "petsc4py/PETSc/Log.pyx":60
* 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_2 = ((__pyx_v_vwr == NULL) != 0);
if (__pyx_t_2) {
__pyx_v_vwr = PETSC_VIEWER_STDOUT_WORLD;
}
/* "petsc4py/PETSc/Log.pyx":61
* if viewer is not None: vwr = viewer.vwr
* if vwr == NULL: vwr = PETSC_VIEWER_STDOUT_WORLD
* CHKERR( PetscLogView(vwr) ) # <<<<<<<<<<<<<<
*
* @classmethod
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogView(__pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 61, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":57
*
* @classmethod
* def view(cls, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.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":64
*
* @classmethod
* def logFlops(cls, flops): # <<<<<<<<<<<<<<
* cdef PetscLogDouble cflops=flops
* CHKERR( PetscLogFlops(cflops) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_11logFlops(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Log_10logFlops[] = "Log.logFlops(type cls, flops)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_11logFlops(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flops = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flops,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flops)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "logFlops") < 0)) __PYX_ERR(33, 64, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flops = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("logFlops", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 64, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":65
* @classmethod
* def logFlops(cls, flops):
* 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, 65, __pyx_L1_error)
__pyx_v_cflops = __pyx_t_1;
/* "petsc4py/PETSc/Log.pyx":66
* def logFlops(cls, flops):
* 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, 66, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":64
*
* @classmethod
* def logFlops(cls, flops): # <<<<<<<<<<<<<<
* cdef PetscLogDouble cflops=flops
* CHKERR( PetscLogFlops(cflops) )
*/
/* 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":69
*
* @classmethod
* def addFlops(cls, flops): # <<<<<<<<<<<<<<
* cdef PetscLogDouble cflops=flops
* CHKERR( PetscLogFlops(cflops) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_13addFlops(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Log_12addFlops[] = "Log.addFlops(type cls, flops)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_13addFlops(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flops = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flops,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flops)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addFlops") < 0)) __PYX_ERR(33, 69, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flops = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("addFlops", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 69, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":70
* @classmethod
* def addFlops(cls, flops):
* 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, 70, __pyx_L1_error)
__pyx_v_cflops = __pyx_t_1;
/* "petsc4py/PETSc/Log.pyx":71
* def addFlops(cls, flops):
* 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, 71, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":69
*
* @classmethod
* def addFlops(cls, flops): # <<<<<<<<<<<<<<
* cdef PetscLogDouble cflops=flops
* CHKERR( PetscLogFlops(cflops) )
*/
/* 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":74
*
* @classmethod
* def getFlops(cls): # <<<<<<<<<<<<<<
* cdef PetscLogDouble cflops=0
* CHKERR( PetscGetFlops(&cflops) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_15getFlops(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Log_14getFlops[] = "Log.getFlops(type cls)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_15getFlops(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFlops (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFlops", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFlops", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_14getFlops(((PyTypeObject*)__pyx_v_cls));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14getFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) {
PetscLogDouble __pyx_v_cflops;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFlops", 0);
/* "petsc4py/PETSc/Log.pyx":75
* @classmethod
* def getFlops(cls):
* cdef PetscLogDouble cflops=0 # <<<<<<<<<<<<<<
* CHKERR( PetscGetFlops(&cflops) )
* return cflops
*/
__pyx_v_cflops = 0.0;
/* "petsc4py/PETSc/Log.pyx":76
* def getFlops(cls):
* 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, 76, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":77
* 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, 77, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":74
*
* @classmethod
* def getFlops(cls): # <<<<<<<<<<<<<<
* cdef PetscLogDouble cflops=0
* CHKERR( PetscGetFlops(&cflops) )
*/
/* 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":80
*
* @classmethod
* def getTime(cls): # <<<<<<<<<<<<<<
* cdef PetscLogDouble wctime=0
* CHKERR( PetscTime(&wctime) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_17getTime(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Log_16getTime[] = "Log.getTime(type cls)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_17getTime(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getTime (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getTime", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTime", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_16getTime(((PyTypeObject*)__pyx_v_cls));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_16getTime(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) {
PetscLogDouble __pyx_v_wctime;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getTime", 0);
/* "petsc4py/PETSc/Log.pyx":81
* @classmethod
* def getTime(cls):
* cdef PetscLogDouble wctime=0 # <<<<<<<<<<<<<<
* CHKERR( PetscTime(&wctime) )
* return wctime
*/
__pyx_v_wctime = 0.0;
/* "petsc4py/PETSc/Log.pyx":82
* def getTime(cls):
* 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, 82, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":83
* 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, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":80
*
* @classmethod
* def getTime(cls): # <<<<<<<<<<<<<<
* cdef PetscLogDouble wctime=0
* CHKERR( PetscTime(&wctime) )
*/
/* 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":86
*
* @classmethod
* def getCPUTime(cls): # <<<<<<<<<<<<<<
* cdef PetscLogDouble cputime=0
* CHKERR( PetscGetCPUTime(&cputime) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_19getCPUTime(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Log_18getCPUTime[] = "Log.getCPUTime(type cls)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_19getCPUTime(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getCPUTime (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getCPUTime", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCPUTime", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_18getCPUTime(((PyTypeObject*)__pyx_v_cls));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_18getCPUTime(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) {
PetscLogDouble __pyx_v_cputime;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getCPUTime", 0);
/* "petsc4py/PETSc/Log.pyx":87
* @classmethod
* def getCPUTime(cls):
* cdef PetscLogDouble cputime=0 # <<<<<<<<<<<<<<
* CHKERR( PetscGetCPUTime(&cputime) )
* return cputime
*/
__pyx_v_cputime = 0.0;
/* "petsc4py/PETSc/Log.pyx":88
* def getCPUTime(cls):
* 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, 88, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":89
* 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, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":86
*
* @classmethod
* def getCPUTime(cls): # <<<<<<<<<<<<<<
* cdef PetscLogDouble cputime=0
* CHKERR( PetscGetCPUTime(&cputime) )
*/
/* 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":92
*
* @classmethod
* def EventDecorator(cls, name=None, klass=None): # <<<<<<<<<<<<<<
* """Decorate a function with a PETSc event.
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_21EventDecorator(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Log_20EventDecorator[] = "Log.EventDecorator(type cls, name=None, klass=None)\nDecorate a function with a PETSc event.\n\n If no event name is specified it will default to the name of the function.\n \n Usage:\n @EventDecorator(\"My Function\")\n def myfunc():\n ...\n\n or\n\n @EventDecorator()\n def myfunc():\n ...\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_21EventDecorator(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_klass = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_klass,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_klass);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "EventDecorator") < 0)) __PYX_ERR(33, 92, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_klass = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("EventDecorator", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 92, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":108
* ...
* """
* 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_14EventDecorator_1decorator = {"decorator", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_1decorator, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_1decorator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_func = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decorator") < 0)) __PYX_ERR(33, 108, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_func = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("decorator", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 108, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":110
* def decorator(func):
* @functools.wraps(func)
* def wrapped_func(*args, **kwargs): # <<<<<<<<<<<<<<
* if name:
* name_ = name
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func = {"wrapped_func", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("wrapped_func (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapped_func", 1))) return NULL;
__pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : 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_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_wrapped_func(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *__pyx_cur_scope;
struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *__pyx_outer_scope;
PyObject *__pyx_v_name_ = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
int __pyx_t_12;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("wrapped_func", 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":111
* @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, 111, __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, 111, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Log.pyx":112
* 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, 112, __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":111
* @functools.wraps(func)
* def wrapped_func(*args, **kwargs):
* if name: # <<<<<<<<<<<<<<
* name_ = name
* else:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Log.pyx":114
* 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, 114, __pyx_L1_error) }
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 114, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(33, 114, __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, 114, __pyx_L1_error) }
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 114, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_GetAttr3(__pyx_t_3, __pyx_n_s_qualname, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 114, __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, 114, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_5);
PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
__pyx_t_2 = 0;
__pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__20, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 114, __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":115
* 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, 115, __pyx_L1_error) }
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_cls), __pyx_n_s_Event); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass)) { __Pyx_RaiseClosureNameError("klass"); __PYX_ERR(33, 115, __pyx_L1_error) }
__pyx_t_2 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name_, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass};
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 115, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name_, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass};
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 115, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else
#endif
{
__pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__pyx_t_2) {
__Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
}
__Pyx_INCREF(__pyx_v_name_);
__Pyx_GIVEREF(__pyx_v_name_);
PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_v_name_);
__Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass);
PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass);
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 115, __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_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 115, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 115, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_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":116
* 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, 116, __pyx_L8_error) }
__pyx_t_5 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 116, __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, 116, __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":115
* 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, 115, __pyx_L10_except_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__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, 115, __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, 115, __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, 115, __pyx_L10_except_error)
__pyx_t_12 = ((!(__pyx_t_1 != 0)) != 0);
if (__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, 115, __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_tuple__21, NULL);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
goto __pyx_L7;
}
__pyx_L5_return: {
__pyx_t_10 = __pyx_r;
__pyx_r = 0;
if (__pyx_t_7) {
__pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__21, NULL);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_9)) __PYX_ERR(33, 115, __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":110
* def decorator(func):
* @functools.wraps(func)
* def wrapped_func(*args, **kwargs): # <<<<<<<<<<<<<<
* if name:
* name_ = 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":108
* ...
* """
* def decorator(func): # <<<<<<<<<<<<<<
* @functools.wraps(func)
* def wrapped_func(*args, **kwargs):
*/
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_decorator(PyObject *__pyx_self, PyObject *__pyx_v_func) {
struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *__pyx_cur_scope;
PyObject *__pyx_v_wrapped_func = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("decorator", 0);
__pyx_cur_scope = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *)__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct_1_decorator(__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__pyx_cur_scope = ((struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *)Py_None);
__Pyx_INCREF(Py_None);
__PYX_ERR(33, 108, __pyx_L1_error)
} else {
__Pyx_GOTREF(__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(__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":109
* """
* def decorator(func):
* @functools.wraps(func) # <<<<<<<<<<<<<<
* def wrapped_func(*args, **kwargs):
* if name:
*/
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_functools); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_wraps); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_cur_scope->__pyx_v_func) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_func);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/Log.pyx":110
* def decorator(func):
* @functools.wraps(func)
* def wrapped_func(*args, **kwargs): # <<<<<<<<<<<<<<
* if name:
* name_ = name
*/
__pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func, 0, __pyx_n_s_EventDecorator_locals_decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_petsc4py_PETSc, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 110, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
__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(33, 109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_wrapped_func = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Log.pyx":117
* 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":108
* ...
* """
* 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":92
*
* @classmethod
* def EventDecorator(cls, name=None, klass=None): # <<<<<<<<<<<<<<
* """Decorate a function with a PETSc event.
*
*/
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_20EventDecorator(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_klass) {
struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *__pyx_cur_scope;
PyObject *__pyx_v_decorator = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("EventDecorator", 0);
__pyx_cur_scope = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator(__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__pyx_cur_scope = ((struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)Py_None);
__Pyx_INCREF(Py_None);
__PYX_ERR(33, 92, __pyx_L1_error)
} else {
__Pyx_GOTREF(__pyx_cur_scope);
}
__pyx_cur_scope->__pyx_v_cls = __pyx_v_cls;
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cls);
__Pyx_GIVEREF(__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":108
* ...
* """
* def decorator(func): # <<<<<<<<<<<<<<
* @functools.wraps(func)
* def wrapped_func(*args, **kwargs):
*/
__pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_14EventDecorator_1decorator, 0, __pyx_n_s_EventDecorator_locals_decorator_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_petsc4py_PETSc, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_decorator = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Log.pyx":118
* 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":92
*
* @classmethod
* def EventDecorator(cls, name=None, klass=None): # <<<<<<<<<<<<<<
* """Decorate a function with a PETSc event.
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Log.EventDecorator", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_decorator);
__Pyx_DECREF(((PyObject *)__pyx_cur_scope));
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":121
*
* @classmethod
* def isActive(cls): # <<<<<<<<<<<<<<
* """Return ``True`` if logging is switched on and ``False`` otherwise."""
* cdef PetscBool flag = PETSC_FALSE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_23isActive(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Log_22isActive[] = "Log.isActive(type cls)\nReturn ``True`` if logging is switched on and ``False`` otherwise.";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_23isActive(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isActive (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("isActive", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isActive", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_22isActive(((PyTypeObject*)__pyx_v_cls));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_22isActive(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) {
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("isActive", 0);
/* "petsc4py/PETSc/Log.pyx":123
* def isActive(cls):
* """Return ``True`` if logging is switched on and ``False`` otherwise."""
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( PetscLogIsActive(&flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/Log.pyx":124
* """Return ``True`` if logging is switched on and ``False`` otherwise."""
* 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, 124, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":125
* 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, 125, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":121
*
* @classmethod
* def isActive(cls): # <<<<<<<<<<<<<<
* """Return ``True`` if logging is switched on and ``False`` otherwise."""
* cdef PetscBool flag = PETSC_FALSE
*/
/* 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":133
* cdef readonly PetscLogStage id
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.id = 0
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_8LogStage_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_8LogStage_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage___cinit__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_8LogStage___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/Log.pyx":134
*
* def __cinit__(self):
* self.id = 0 # <<<<<<<<<<<<<<
*
* def __int__(self):
*/
__pyx_v_self->id = 0;
/* "petsc4py/PETSc/Log.pyx":133
* cdef readonly PetscLogStage id
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.id = 0
*
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":136
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__int__ (wrapper)", 0);
__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":137
*
* def __int__(self):
* return <int> self.id # <<<<<<<<<<<<<<
*
* def __enter__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_int(((int)__pyx_v_self->id)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":136
* 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":139
* 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogStage_4__enter__[] = "LogStage.__enter__(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_5__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_4__enter__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_4__enter__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__enter__", 0);
/* "petsc4py/PETSc/Log.pyx":140
*
* def __enter__(self):
* self.push() # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_push); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 140, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 140, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Log.pyx":141
* 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":139
* 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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogStage.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":143
* 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*/
static char __pyx_doc_8petsc4py_5PETSc_8LogStage_6__exit__[] = "LogStage.__exit__(self, *exc)";
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;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_exc = __pyx_args;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_6__exit__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), __pyx_v_exc);
/* function exit code */
__Pyx_XDECREF(__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":144
*
* def __exit__(self, *exc):
* self.pop() # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_1 = __Pyx_PyObject_Pop(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 144, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Log.pyx":143
* 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":148
* #
*
* def push(self): # <<<<<<<<<<<<<<
* CHKERR( PetscLogStagePush(self.id) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_9push(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogStage_8push[] = "LogStage.push(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_9push(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("push (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("push", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "push", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_8push(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_8push(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("push", 0);
/* "petsc4py/PETSc/Log.pyx":149
*
* def push(self):
* CHKERR( PetscLogStagePush(self.id) ) # <<<<<<<<<<<<<<
*
* def pop(self):
*/
__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, 149, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":148
* #
*
* def push(self): # <<<<<<<<<<<<<<
* CHKERR( PetscLogStagePush(self.id) )
*
*/
/* 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":151
* CHKERR( PetscLogStagePush(self.id) )
*
* def pop(self): # <<<<<<<<<<<<<<
* <void>self # unused
* CHKERR( PetscLogStagePop() )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_11pop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogStage_10pop[] = "LogStage.pop(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_11pop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pop (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("pop", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pop", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_10pop(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_10pop(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pop", 0);
/* "petsc4py/PETSc/Log.pyx":152
*
* def pop(self):
* <void>self # unused # <<<<<<<<<<<<<<
* CHKERR( PetscLogStagePop() )
*
*/
((void)__pyx_v_self);
/* "petsc4py/PETSc/Log.pyx":153
* def pop(self):
* <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, 153, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":151
* CHKERR( PetscLogStagePush(self.id) )
*
* def pop(self): # <<<<<<<<<<<<<<
* <void>self # unused
* CHKERR( PetscLogStagePop() )
*/
/* 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":157
* #
*
* def getName(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscLogStageFindName(self.id, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_13getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogStage_12getName[] = "LogStage.getName(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_13getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getName (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getName", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getName", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_12getName(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_12getName(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getName", 0);
/* "petsc4py/PETSc/Log.pyx":158
*
* def getName(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscLogStageFindName(self.id, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Log.pyx":159
* def getName(self):
* cdef const char *cval = NULL
* CHKERR( PetscLogStageFindName(self.id, &cval) ) # <<<<<<<<<<<<<<
* return bytes2str(cval)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageFindName(__pyx_v_self->id, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 159, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":160
* 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, 160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":157
* #
*
* def getName(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscLogStageFindName(self.id, &cval) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.LogStage.getName", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":163
*
* property name:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getName()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_4name_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_4name___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Log.pyx":164
* property name:
* def __get__(self):
* return self.getName() # <<<<<<<<<<<<<<
* def __set__(self, value):
* <void>self; <void>value; # unused
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getName); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":163
*
* property name:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getName()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogStage.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":165
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_4name_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_8LogStage_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Log.pyx":166
* return self.getName()
* 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":167
* def __set__(self, value):
* <void>self; <void>value; # unused
* raise TypeError("readonly attribute") # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 167, __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, 167, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":165
* def __get__(self):
* 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_AddTraceback("petsc4py.PETSc.LogStage.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":171
* #
*
* def activate(self): # <<<<<<<<<<<<<<
* CHKERR( PetscLogStageSetActive(self.id, PETSC_TRUE) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_15activate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogStage_14activate[] = "LogStage.activate(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_15activate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("activate (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("activate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "activate", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_14activate(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_14activate(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("activate", 0);
/* "petsc4py/PETSc/Log.pyx":172
*
* def activate(self):
* CHKERR( PetscLogStageSetActive(self.id, PETSC_TRUE) ) # <<<<<<<<<<<<<<
*
* def deactivate(self):
*/
__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, 172, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":171
* #
*
* def activate(self): # <<<<<<<<<<<<<<
* CHKERR( PetscLogStageSetActive(self.id, PETSC_TRUE) )
*
*/
/* 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":174
* CHKERR( PetscLogStageSetActive(self.id, PETSC_TRUE) )
*
* def deactivate(self): # <<<<<<<<<<<<<<
* CHKERR( PetscLogStageSetActive(self.id, PETSC_FALSE) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_17deactivate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogStage_16deactivate[] = "LogStage.deactivate(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_17deactivate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("deactivate (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("deactivate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "deactivate", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_16deactivate(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_16deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("deactivate", 0);
/* "petsc4py/PETSc/Log.pyx":175
*
* def deactivate(self):
* CHKERR( PetscLogStageSetActive(self.id, PETSC_FALSE) ) # <<<<<<<<<<<<<<
*
* def getActive(self):
*/
__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, 175, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":174
* CHKERR( PetscLogStageSetActive(self.id, PETSC_TRUE) )
*
* def deactivate(self): # <<<<<<<<<<<<<<
* CHKERR( PetscLogStageSetActive(self.id, PETSC_FALSE) )
*
*/
/* 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":177
* CHKERR( PetscLogStageSetActive(self.id, PETSC_FALSE) )
*
* def getActive(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscLogStageGetActive(self.id, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_19getActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogStage_18getActive[] = "LogStage.getActive(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_19getActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getActive (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getActive", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getActive", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_18getActive(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_18getActive(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) {
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getActive", 0);
/* "petsc4py/PETSc/Log.pyx":178
*
* def getActive(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( PetscLogStageGetActive(self.id, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/Log.pyx":179
* def getActive(self):
* 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, 179, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":180
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscLogStageGetActive(self.id, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def setActive(self, flag):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 180, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":177
* CHKERR( PetscLogStageSetActive(self.id, PETSC_FALSE) )
*
* def getActive(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscLogStageGetActive(self.id, &flag) )
*/
/* 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":182
* return toBool(flag)
*
* def setActive(self, flag): # <<<<<<<<<<<<<<
* cdef PetscBool tval = PETSC_FALSE
* if flag: tval = PETSC_TRUE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_21setActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogStage_20setActive[] = "LogStage.setActive(self, flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_21setActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flag = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setActive") < 0)) __PYX_ERR(33, 182, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setActive", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 182, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":183
*
* def setActive(self, flag):
* cdef PetscBool tval = PETSC_FALSE # <<<<<<<<<<<<<<
* if flag: tval = PETSC_TRUE
* CHKERR( PetscLogStageSetActive(self.id, tval) )
*/
__pyx_v_tval = PETSC_FALSE;
/* "petsc4py/PETSc/Log.pyx":184
* def setActive(self, flag):
* 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, 184, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_v_tval = PETSC_TRUE;
}
/* "petsc4py/PETSc/Log.pyx":185
* 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, 185, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":182
* return toBool(flag)
*
* def setActive(self, flag): # <<<<<<<<<<<<<<
* cdef PetscBool tval = PETSC_FALSE
* if flag: tval = PETSC_TRUE
*/
/* 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":188
*
* property active:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getActive()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_6active_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_6active___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Log.pyx":189
* property active:
* def __get__(self):
* return self.getActive() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setActive(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":188
*
* property active:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getActive()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogStage.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":190
* def __get__(self):
* return self.getActive()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setActive(value)
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_8LogStage_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_8LogStage_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_6active_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_8LogStage_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Log.pyx":191
* return self.getActive()
* def __set__(self, value):
* self.setActive(value) # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Log.pyx":190
* def __get__(self):
* return self.getActive()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setActive(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogStage.active.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":195
* #
*
* def getVisible(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscLogStageGetVisible(self.id, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_23getVisible(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogStage_22getVisible[] = "LogStage.getVisible(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_23getVisible(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getVisible (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getVisible", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVisible", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_22getVisible(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_22getVisible(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) {
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getVisible", 0);
/* "petsc4py/PETSc/Log.pyx":196
*
* def getVisible(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( PetscLogStageGetVisible(self.id, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/Log.pyx":197
* def getVisible(self):
* 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, 197, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":198
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscLogStageGetVisible(self.id, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def setVisible(self, flag):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":195
* #
*
* def getVisible(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( PetscLogStageGetVisible(self.id, &flag) )
*/
/* 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":200
* return toBool(flag)
*
* def setVisible(self, flag): # <<<<<<<<<<<<<<
* cdef PetscBool tval = PETSC_FALSE
* if flag: tval = PETSC_TRUE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_25setVisible(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogStage_24setVisible[] = "LogStage.setVisible(self, flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_25setVisible(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flag = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setVisible") < 0)) __PYX_ERR(33, 200, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setVisible", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 200, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":201
*
* def setVisible(self, flag):
* cdef PetscBool tval = PETSC_FALSE # <<<<<<<<<<<<<<
* if flag: tval = PETSC_TRUE
* CHKERR( PetscLogStageSetVisible(self.id, tval) )
*/
__pyx_v_tval = PETSC_FALSE;
/* "petsc4py/PETSc/Log.pyx":202
* def setVisible(self, flag):
* 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, 202, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_v_tval = PETSC_TRUE;
}
/* "petsc4py/PETSc/Log.pyx":203
* 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, 203, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":200
* return toBool(flag)
*
* def setVisible(self, flag): # <<<<<<<<<<<<<<
* cdef PetscBool tval = PETSC_FALSE
* if flag: tval = PETSC_TRUE
*/
/* 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":206
*
* property visible:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getVisible()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_7visible___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_7visible___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Log.pyx":207
* property visible:
* def __get__(self):
* return self.getVisible() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setVisible(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getVisible); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":206
*
* property visible:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getVisible()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogStage.visible.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":208
* def __get__(self):
* return self.getVisible()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setVisible(value)
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_7visible_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_8LogStage_7visible_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Log.pyx":209
* return self.getVisible()
* def __set__(self, value):
* self.setVisible(value) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setVisible); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 209, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 209, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Log.pyx":208
* def __get__(self):
* return self.getVisible()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setVisible(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogStage.visible.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":131
* cdef class LogStage:
*
* cdef readonly PetscLogStage id # <<<<<<<<<<<<<<
*
* def __cinit__(self):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_2id_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_2id_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_PetscLogStage(__pyx_v_self->id); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.LogStage.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":214
* 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":215
*
* 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, 215, __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, 215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_LogStage))))) __PYX_ERR(33, 215, __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":214
* 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":217
* return stage_registry.get(name)
*
* cdef LogStage reg_LogStage(object name, PetscLogStage stageid): # <<<<<<<<<<<<<<
* cdef LogStage stage = LogStage()
* stage.id = stageid
*/
static struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_f_8petsc4py_5PETSc_reg_LogStage(PyObject *__pyx_v_name, PetscLogStage __pyx_v_stageid) {
struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_stage = 0;
struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reg_LogStage", 0);
/* "petsc4py/PETSc/Log.pyx":218
*
* cdef LogStage reg_LogStage(object name, PetscLogStage stageid):
* cdef LogStage stage = LogStage() # <<<<<<<<<<<<<<
* stage.id = stageid
* stage_registry[name] = stage
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LogStage)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_stage = ((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Log.pyx":219
* 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":220
* 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, 220, __pyx_L1_error)
}
if (unlikely(PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_stage_registry, __pyx_v_name, ((PyObject *)__pyx_v_stage)) < 0)) __PYX_ERR(33, 220, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":221
* 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":217
* return stage_registry.get(name)
*
* cdef LogStage reg_LogStage(object name, PetscLogStage stageid): # <<<<<<<<<<<<<<
* cdef LogStage stage = LogStage()
* stage.id = stageid
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.reg_LogStage", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_stage);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":229
* cdef readonly PetscLogClass id
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.id = PETSC_OBJECT_CLASSID
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_8LogClass_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_8LogClass_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass___cinit__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_8LogClass___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/Log.pyx":230
*
* def __cinit__(self):
* self.id = PETSC_OBJECT_CLASSID # <<<<<<<<<<<<<<
*
* def __int__(self):
*/
__pyx_v_self->id = PETSC_OBJECT_CLASSID;
/* "petsc4py/PETSc/Log.pyx":229
* cdef readonly PetscLogClass id
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.id = PETSC_OBJECT_CLASSID
*
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":232
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__int__ (wrapper)", 0);
__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":233
*
* def __int__(self):
* return <int> self.id # <<<<<<<<<<<<<<
*
* #
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_int(((int)__pyx_v_self->id)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":232
* 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":237
* #
*
* def getName(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscLogClassFindName(self.id, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_5getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogClass_4getName[] = "LogClass.getName(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_5getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getName (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getName", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getName", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_4getName(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_4getName(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getName", 0);
/* "petsc4py/PETSc/Log.pyx":238
*
* def getName(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscLogClassFindName(self.id, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Log.pyx":239
* def getName(self):
* cdef const char *cval = NULL
* CHKERR( PetscLogClassFindName(self.id, &cval) ) # <<<<<<<<<<<<<<
* return bytes2str(cval)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogClassFindName(__pyx_v_self->id, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 239, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":240
* 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, 240, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":237
* #
*
* def getName(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscLogClassFindName(self.id, &cval) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.LogClass.getName", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":243
*
* property name:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getName()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_4name_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_4name___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Log.pyx":244
* property name:
* def __get__(self):
* return self.getName() # <<<<<<<<<<<<<<
* def __set__(self, value):
* <void>self; <void>value; # unused
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getName); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":243
*
* property name:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getName()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogClass.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":245
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_4name_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_8LogClass_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Log.pyx":246
* return self.getName()
* 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":247
* def __set__(self, value):
* <void>self; <void>value; # unused
* raise TypeError("readonly attribute") # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 247, __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, 247, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":245
* def __get__(self):
* 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_AddTraceback("petsc4py.PETSc.LogClass.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":251
* #
*
* def activate(self): # <<<<<<<<<<<<<<
* CHKERR( PetscLogClassActivate(self.id) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_7activate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogClass_6activate[] = "LogClass.activate(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_7activate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("activate (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("activate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "activate", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_6activate(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_6activate(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("activate", 0);
/* "petsc4py/PETSc/Log.pyx":252
*
* def activate(self):
* CHKERR( PetscLogClassActivate(self.id) ) # <<<<<<<<<<<<<<
*
* def deactivate(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventActivateClass(__pyx_v_self->id)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 252, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":251
* #
*
* def activate(self): # <<<<<<<<<<<<<<
* CHKERR( PetscLogClassActivate(self.id) )
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.LogClass.activate", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":254
* CHKERR( PetscLogClassActivate(self.id) )
*
* def deactivate(self): # <<<<<<<<<<<<<<
* CHKERR( PetscLogClassDeactivate(self.id) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_9deactivate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogClass_8deactivate[] = "LogClass.deactivate(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_9deactivate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("deactivate (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("deactivate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "deactivate", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_8deactivate(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_8deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("deactivate", 0);
/* "petsc4py/PETSc/Log.pyx":255
*
* def deactivate(self):
* CHKERR( PetscLogClassDeactivate(self.id) ) # <<<<<<<<<<<<<<
*
* def getActive(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventDeactivateClass(__pyx_v_self->id)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 255, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":254
* CHKERR( PetscLogClassActivate(self.id) )
*
* def deactivate(self): # <<<<<<<<<<<<<<
* CHKERR( PetscLogClassDeactivate(self.id) )
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.LogClass.deactivate", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":257
* CHKERR( PetscLogClassDeactivate(self.id) )
*
* def getActive(self): # <<<<<<<<<<<<<<
* <void>self # unused
* raise NotImplementedError
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_11getActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogClass_10getActive[] = "LogClass.getActive(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_11getActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getActive (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getActive", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getActive", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_10getActive(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_10getActive(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getActive", 0);
/* "petsc4py/PETSc/Log.pyx":258
*
* def getActive(self):
* <void>self # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
*
*/
((void)__pyx_v_self);
/* "petsc4py/PETSc/Log.pyx":259
* def getActive(self):
* <void>self # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
*
* def setActive(self, flag):
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(33, 259, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":257
* CHKERR( PetscLogClassDeactivate(self.id) )
*
* def getActive(self): # <<<<<<<<<<<<<<
* <void>self # unused
* raise NotImplementedError
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.LogClass.getActive", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":261
* raise NotImplementedError
*
* def setActive(self, flag): # <<<<<<<<<<<<<<
* if flag:
* CHKERR( PetscLogClassActivate(self.id) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_13setActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogClass_12setActive[] = "LogClass.setActive(self, flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_13setActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flag = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setActive") < 0)) __PYX_ERR(33, 261, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setActive", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 261, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":262
*
* def setActive(self, flag):
* if flag: # <<<<<<<<<<<<<<
* CHKERR( PetscLogClassActivate(self.id) )
* else:
*/
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(33, 262, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Log.pyx":263
* def setActive(self, flag):
* if flag:
* CHKERR( PetscLogClassActivate(self.id) ) # <<<<<<<<<<<<<<
* else:
* CHKERR( PetscLogClassDeactivate(self.id) )
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventActivateClass(__pyx_v_self->id)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 263, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":262
*
* def setActive(self, flag):
* if flag: # <<<<<<<<<<<<<<
* CHKERR( PetscLogClassActivate(self.id) )
* else:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Log.pyx":265
* 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, 265, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/Log.pyx":261
* raise NotImplementedError
*
* def setActive(self, flag): # <<<<<<<<<<<<<<
* if flag:
* CHKERR( PetscLogClassActivate(self.id) )
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.LogClass.setActive", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":268
*
* property active:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getActive()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_6active_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_6active___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Log.pyx":269
* property active:
* def __get__(self):
* return self.getActive() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setActive(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":268
*
* property active:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getActive()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogClass.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":270
* def __get__(self):
* return self.getActive()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setActive(value)
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_8LogClass_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_8LogClass_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_6active_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_8LogClass_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Log.pyx":271
* return self.getActive()
* def __set__(self, value):
* self.setActive(value) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Log.pyx":270
* def __get__(self):
* return self.getActive()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setActive(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogClass.active.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":227
* cdef class LogClass:
*
* cdef readonly PetscLogClass id # <<<<<<<<<<<<<<
*
* def __cinit__(self):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_2id_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_2id_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_PetscClassId(__pyx_v_self->id); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 227, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.LogClass.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":276
* 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":277
*
* 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, 277, __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, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_LogClass))))) __PYX_ERR(33, 277, __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":276
* 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":279
* return class_registry.get(name)
*
* cdef LogClass reg_LogClass(object name, PetscLogClass classid): # <<<<<<<<<<<<<<
* cdef LogClass klass = LogClass()
* klass.id = classid
*/
static struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_f_8petsc4py_5PETSc_reg_LogClass(PyObject *__pyx_v_name, PetscClassId __pyx_v_classid) {
struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_klass = 0;
struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reg_LogClass", 0);
/* "petsc4py/PETSc/Log.pyx":280
*
* cdef LogClass reg_LogClass(object name, PetscLogClass classid):
* cdef LogClass klass = LogClass() # <<<<<<<<<<<<<<
* klass.id = classid
* class_registry[name] = klass
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LogClass)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_klass = ((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Log.pyx":281
* 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":282
* 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, 282, __pyx_L1_error)
}
if (unlikely(PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_class_registry, __pyx_v_name, ((PyObject *)__pyx_v_klass)) < 0)) __PYX_ERR(33, 282, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":283
* 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":279
* return class_registry.get(name)
*
* cdef LogClass reg_LogClass(object name, PetscLogClass classid): # <<<<<<<<<<<<<<
* cdef LogClass klass = LogClass()
* klass.id = classid
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.reg_LogClass", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_klass);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":291
* cdef readonly PetscLogEvent id
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.id = 0
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent___cinit__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_8LogEvent___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/Log.pyx":292
*
* def __cinit__(self):
* self.id = 0 # <<<<<<<<<<<<<<
*
* def __int__(self):
*/
__pyx_v_self->id = 0;
/* "petsc4py/PETSc/Log.pyx":291
* cdef readonly PetscLogEvent id
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.id = 0
*
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":294
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__int__ (wrapper)", 0);
__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":295
*
* def __int__(self):
* return <int> self.id # <<<<<<<<<<<<<<
*
* def __enter__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_int(((int)__pyx_v_self->id)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":294
* 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":297
* 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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_4__enter__[] = "LogEvent.__enter__(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_5__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_4__enter__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_4__enter__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__enter__", 0);
/* "petsc4py/PETSc/Log.pyx":298
*
* def __enter__(self):
* self.begin() # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Log.pyx":299
* 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":297
* 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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogEvent.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":301
* 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*/
static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_6__exit__[] = "LogEvent.__exit__(self, *exc)";
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;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_exc = __pyx_args;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_6__exit__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), __pyx_v_exc);
/* function exit code */
__Pyx_XDECREF(__pyx_v_exc);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_6__exit__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__exit__", 0);
/* "petsc4py/PETSc/Log.pyx":302
*
* def __exit__(self, *exc):
* self.end() # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Log.pyx":301
* return self
*
* def __exit__(self, *exc): # <<<<<<<<<<<<<<
* self.end()
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogEvent.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":306
* #
*
* def begin(self, *objs): # <<<<<<<<<<<<<<
* cdef PetscObject o[4]
* event_args2objs(objs, o)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_9begin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_8begin[] = "LogEvent.begin(self, *objs)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_9begin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_objs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("begin (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "begin", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_objs = __pyx_args;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_8begin(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), __pyx_v_objs);
/* function exit code */
__Pyx_XDECREF(__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":308
* def begin(self, *objs):
* 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, 308, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":309
* cdef PetscObject o[4]
* event_args2objs(objs, o)
* CHKERR( PetscLogEventBegin(self.id, o[0], o[1], o[2], o[3]) ) # <<<<<<<<<<<<<<
*
* def end(self, *objs):
*/
__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, 309, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":306
* #
*
* def begin(self, *objs): # <<<<<<<<<<<<<<
* cdef PetscObject o[4]
* event_args2objs(objs, o)
*/
/* 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":311
* CHKERR( PetscLogEventBegin(self.id, o[0], o[1], o[2], o[3]) )
*
* def end(self, *objs): # <<<<<<<<<<<<<<
* cdef PetscObject o[4]
* event_args2objs(objs, o)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_11end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_10end[] = "LogEvent.end(self, *objs)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_11end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_objs = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("end (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "end", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_objs = __pyx_args;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_10end(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), __pyx_v_objs);
/* function exit code */
__Pyx_XDECREF(__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":313
* def end(self, *objs):
* 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, 313, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":314
* 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, 314, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":311
* CHKERR( PetscLogEventBegin(self.id, o[0], o[1], o[2], o[3]) )
*
* def end(self, *objs): # <<<<<<<<<<<<<<
* cdef PetscObject o[4]
* event_args2objs(objs, o)
*/
/* 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":318
* #
*
* def getName(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscLogEventFindName(self.id, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_13getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_12getName[] = "LogEvent.getName(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_13getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getName (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getName", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getName", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_12getName(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_12getName(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getName", 0);
/* "petsc4py/PETSc/Log.pyx":319
*
* def getName(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscLogEventFindName(self.id, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Log.pyx":320
* def getName(self):
* cdef const char *cval = NULL
* CHKERR( PetscLogEventFindName(self.id, &cval) ) # <<<<<<<<<<<<<<
* return bytes2str(cval)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventFindName(__pyx_v_self->id, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 320, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":321
* 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, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":318
* #
*
* def getName(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscLogEventFindName(self.id, &cval) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.LogEvent.getName", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":324
*
* property name:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getName()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_4name_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_4name___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Log.pyx":325
* property name:
* def __get__(self):
* return self.getName() # <<<<<<<<<<<<<<
* def __set__(self, value):
* <void>self; <void>value; # unused
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getName); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 325, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 325, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":324
*
* property name:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getName()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogEvent.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":326
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_4name_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Log.pyx":327
* return self.getName()
* 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":328
* def __set__(self, value):
* <void>self; <void>value; # unused
* raise TypeError("readonly attribute") # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 328, __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, 328, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":326
* def __get__(self):
* 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_AddTraceback("petsc4py.PETSc.LogEvent.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":332
* #
*
* def activate(self): # <<<<<<<<<<<<<<
* CHKERR( PetscLogEventActivate(self.id) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_15activate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_14activate[] = "LogEvent.activate(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_15activate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("activate (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("activate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "activate", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_14activate(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_14activate(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("activate", 0);
/* "petsc4py/PETSc/Log.pyx":333
*
* def activate(self):
* CHKERR( PetscLogEventActivate(self.id) ) # <<<<<<<<<<<<<<
*
* def deactivate(self):
*/
__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, 333, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":332
* #
*
* def activate(self): # <<<<<<<<<<<<<<
* CHKERR( PetscLogEventActivate(self.id) )
*
*/
/* 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":335
* CHKERR( PetscLogEventActivate(self.id) )
*
* def deactivate(self): # <<<<<<<<<<<<<<
* CHKERR( PetscLogEventDeactivate(self.id) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_17deactivate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_16deactivate[] = "LogEvent.deactivate(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_17deactivate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("deactivate (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("deactivate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "deactivate", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_16deactivate(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_16deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("deactivate", 0);
/* "petsc4py/PETSc/Log.pyx":336
*
* def deactivate(self):
* CHKERR( PetscLogEventDeactivate(self.id) ) # <<<<<<<<<<<<<<
*
* def getActive(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventDeactivate(__pyx_v_self->id)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 336, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":335
* CHKERR( PetscLogEventActivate(self.id) )
*
* def deactivate(self): # <<<<<<<<<<<<<<
* CHKERR( PetscLogEventDeactivate(self.id) )
*
*/
/* 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":338
* CHKERR( PetscLogEventDeactivate(self.id) )
*
* def getActive(self): # <<<<<<<<<<<<<<
* <void>self # unused
* raise NotImplementedError
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_19getActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_18getActive[] = "LogEvent.getActive(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_19getActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getActive (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getActive", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getActive", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_18getActive(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_18getActive(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getActive", 0);
/* "petsc4py/PETSc/Log.pyx":339
*
* def getActive(self):
* <void>self # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
*
*/
((void)__pyx_v_self);
/* "petsc4py/PETSc/Log.pyx":340
* def getActive(self):
* <void>self # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
*
* def setActive(self, flag):
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(33, 340, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":338
* CHKERR( PetscLogEventDeactivate(self.id) )
*
* def getActive(self): # <<<<<<<<<<<<<<
* <void>self # unused
* raise NotImplementedError
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.LogEvent.getActive", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":342
* raise NotImplementedError
*
* def setActive(self, flag): # <<<<<<<<<<<<<<
* if flag:
* CHKERR( PetscLogEventActivate(self.id) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_21setActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_20setActive[] = "LogEvent.setActive(self, flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_21setActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flag = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setActive") < 0)) __PYX_ERR(33, 342, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setActive", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 342, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":343
*
* def setActive(self, flag):
* 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, 343, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Log.pyx":344
* def setActive(self, flag):
* 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, 344, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":343
*
* def setActive(self, flag):
* if flag: # <<<<<<<<<<<<<<
* CHKERR( PetscLogEventActivate(self.id) )
* else:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Log.pyx":346
* 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, 346, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/Log.pyx":342
* raise NotImplementedError
*
* def setActive(self, flag): # <<<<<<<<<<<<<<
* if flag:
* CHKERR( PetscLogEventActivate(self.id) )
*/
/* 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":349
*
* property active:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getActive()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_6active___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Log.pyx":350
* property active:
* def __get__(self):
* return self.getActive() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setActive(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 350, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 350, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":349
*
* property active:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getActive()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogEvent.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":351
* def __get__(self):
* return self.getActive()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setActive(value)
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_6active_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Log.pyx":352
* return self.getActive()
* def __set__(self, value):
* self.setActive(value) # <<<<<<<<<<<<<<
*
* def getActiveAll(self):
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Log.pyx":351
* def __get__(self):
* return self.getActive()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setActive(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogEvent.active.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":354
* self.setActive(value)
*
* def getActiveAll(self): # <<<<<<<<<<<<<<
* <void>self # unused
* raise NotImplementedError
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_23getActiveAll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_22getActiveAll[] = "LogEvent.getActiveAll(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_23getActiveAll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getActiveAll (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getActiveAll", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getActiveAll", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_22getActiveAll(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_22getActiveAll(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getActiveAll", 0);
/* "petsc4py/PETSc/Log.pyx":355
*
* def getActiveAll(self):
* <void>self # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
*
*/
((void)__pyx_v_self);
/* "petsc4py/PETSc/Log.pyx":356
* def getActiveAll(self):
* <void>self # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
*
* def setActiveAll(self, flag):
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(33, 356, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":354
* self.setActive(value)
*
* def getActiveAll(self): # <<<<<<<<<<<<<<
* <void>self # unused
* raise NotImplementedError
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.LogEvent.getActiveAll", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":358
* raise NotImplementedError
*
* def setActiveAll(self, flag): # <<<<<<<<<<<<<<
* cdef PetscBool tval = PETSC_FALSE
* if flag: tval = PETSC_TRUE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_25setActiveAll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_24setActiveAll[] = "LogEvent.setActiveAll(self, flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_25setActiveAll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flag = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setActiveAll") < 0)) __PYX_ERR(33, 358, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setActiveAll", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 358, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":359
*
* def setActiveAll(self, flag):
* cdef PetscBool tval = PETSC_FALSE # <<<<<<<<<<<<<<
* if flag: tval = PETSC_TRUE
* CHKERR( PetscLogEventSetActiveAll(self.id, tval) )
*/
__pyx_v_tval = PETSC_FALSE;
/* "petsc4py/PETSc/Log.pyx":360
* def setActiveAll(self, flag):
* 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, 360, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_v_tval = PETSC_TRUE;
}
/* "petsc4py/PETSc/Log.pyx":361
* 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, 361, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":358
* raise NotImplementedError
*
* def setActiveAll(self, flag): # <<<<<<<<<<<<<<
* cdef PetscBool tval = PETSC_FALSE
* if flag: tval = PETSC_TRUE
*/
/* 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":364
*
* property active_all:
* def __get__(self): # <<<<<<<<<<<<<<
* self.getActiveAll()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Log.pyx":365
* property active_all:
* def __get__(self):
* self.getActiveAll() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setActiveAll(value)
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getActiveAll); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Log.pyx":364
*
* property active_all:
* def __get__(self): # <<<<<<<<<<<<<<
* self.getActiveAll()
* def __set__(self, value):
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogEvent.active_all.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":366
* def __get__(self):
* self.getActiveAll()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setActiveAll(value)
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Log.pyx":367
* self.getActiveAll()
* def __set__(self, value):
* self.setActiveAll(value) # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setActiveAll); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Log.pyx":366
* def __get__(self):
* self.getActiveAll()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setActiveAll(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LogEvent.active_all.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":371
* #
*
* def getPerfInfo(self, stage=None): # <<<<<<<<<<<<<<
* cdef PetscEventPerfInfo info
* cdef PetscInt cstage = PETSC_DETERMINE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_27getPerfInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_26getPerfInfo[] = "LogEvent.getPerfInfo(self, stage=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_27getPerfInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_stage = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stage,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stage);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getPerfInfo") < 0)) __PYX_ERR(33, 371, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_stage = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getPerfInfo", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 371, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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;
int __pyx_t_2;
PetscInt __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("getPerfInfo", 0);
/* "petsc4py/PETSc/Log.pyx":373
* def getPerfInfo(self, stage=None):
* cdef PetscEventPerfInfo info
* cdef PetscInt cstage = PETSC_DETERMINE # <<<<<<<<<<<<<<
* if stage is not None: cstage = asInt(stage)
* CHKERR( PetscLogEventGetPerfInfo(cstage, self.id, &info) )
*/
__pyx_v_cstage = PETSC_DETERMINE;
/* "petsc4py/PETSc/Log.pyx":374
* cdef PetscEventPerfInfo info
* cdef PetscInt cstage = PETSC_DETERMINE
* if stage is not None: cstage = asInt(stage) # <<<<<<<<<<<<<<
* CHKERR( PetscLogEventGetPerfInfo(cstage, self.id, &info) )
* return info
*/
__pyx_t_1 = (__pyx_v_stage != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stage); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(33, 374, __pyx_L1_error)
__pyx_v_cstage = __pyx_t_3;
}
/* "petsc4py/PETSc/Log.pyx":375
* cdef PetscInt cstage = PETSC_DETERMINE
* if stage is not None: cstage = asInt(stage)
* CHKERR( PetscLogEventGetPerfInfo(cstage, self.id, &info) ) # <<<<<<<<<<<<<<
* return info
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventGetPerfInfo(__pyx_v_cstage, __pyx_v_self->id, (&__pyx_v_info))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 375, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":376
* if stage is not None: cstage = asInt(stage)
* CHKERR( PetscLogEventGetPerfInfo(cstage, self.id, &info) )
* return info # <<<<<<<<<<<<<<
*
* cdef dict event_registry = { }
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_5 = __pyx_convert__to_py_PetscEventPerfInfo(__pyx_v_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 376, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Log.pyx":371
* #
*
* def getPerfInfo(self, stage=None): # <<<<<<<<<<<<<<
* cdef PetscEventPerfInfo info
* cdef PetscInt cstage = PETSC_DETERMINE
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__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":289
* cdef class LogEvent:
*
* cdef readonly PetscLogEvent id # <<<<<<<<<<<<<<
*
* def __cinit__(self):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_2id_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_2id_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_From_PetscLogEvent(__pyx_v_self->id); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.LogEvent.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Log.pyx":380
* 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":381
*
* 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, 381, __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, 381, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_LogEvent))))) __PYX_ERR(33, 381, __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":380
* 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":383
* return event_registry.get(name)
*
* cdef LogEvent reg_LogEvent(object name, PetscLogEvent eventid): # <<<<<<<<<<<<<<
* cdef LogEvent event = LogEvent()
* event.id = eventid
*/
static struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_f_8petsc4py_5PETSc_reg_LogEvent(PyObject *__pyx_v_name, PetscLogEvent __pyx_v_eventid) {
struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_event = 0;
struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reg_LogEvent", 0);
/* "petsc4py/PETSc/Log.pyx":384
*
* cdef LogEvent reg_LogEvent(object name, PetscLogEvent eventid):
* cdef LogEvent event = LogEvent() # <<<<<<<<<<<<<<
* event.id = eventid
* event_registry[name] = event
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LogEvent)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 384, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_event = ((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Log.pyx":385
* 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":386
* 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, 386, __pyx_L1_error)
}
if (unlikely(PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_event_registry, __pyx_v_name, ((PyObject *)__pyx_v_event)) < 0)) __PYX_ERR(33, 386, __pyx_L1_error)
/* "petsc4py/PETSc/Log.pyx":387
* 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":383
* return event_registry.get(name)
*
* cdef LogEvent reg_LogEvent(object name, PetscLogEvent eventid): # <<<<<<<<<<<<<<
* cdef LogEvent event = LogEvent()
* event.id = eventid
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.reg_LogEvent", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_event);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Comm.pyx":7
* #
*
* 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(10, 7, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 7, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":8
*
* 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(PyErr_Occurred())) __PYX_ERR(10, 8, __pyx_L1_error)
__pyx_v_self->comm = __pyx_t_1;
/* "petsc4py/PETSc/Comm.pyx":9
* 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":10
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Comm.pyx":11
* 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":10
* 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":13
* 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":7
* #
*
* 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":15
* 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) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__dealloc__", 0);
/* "petsc4py/PETSc/Comm.pyx":16
*
* 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":17
* 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_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCommDEALLOC((&__pyx_v_self->comm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(10, 17, __pyx_L1_error)
/* "petsc4py/PETSc/Comm.pyx":16
*
* def __dealloc__(self):
* if self.isdup: # <<<<<<<<<<<<<<
* CHKERR( PetscCommDEALLOC(&self.comm) )
* self.comm = MPI_COMM_NULL
*/
}
/* "petsc4py/PETSc/Comm.pyx":18
* 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":19
* CHKERR( PetscCommDEALLOC(&self.comm) )
* self.comm = MPI_COMM_NULL
* self.isdup = 0 # <<<<<<<<<<<<<<
* self.base = None
*
*/
__pyx_v_self->isdup = 0;
/* "petsc4py/PETSc/Comm.pyx":20
* 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":15
* 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":22
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_4__richcmp__(((struct PyPetscCommObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4__richcmp__(struct PyPetscCommObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
struct PyPetscCommObject *__pyx_v_s = 0;
struct PyPetscCommObject *__pyx_v_o = 0;
int __pyx_v_eq;
MPI_Comm __pyx_v_comm1;
MPI_Comm __pyx_v_comm2;
int __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
MPI_Comm __pyx_t_4;
PetscErrorCode __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__richcmp__", 0);
/* "petsc4py/PETSc/Comm.pyx":23
*
* def __richcmp__(self, other, int op):
* if not isinstance(self, Comm): return NotImplemented # <<<<<<<<<<<<<<
* if not isinstance(other, Comm): return NotImplemented
* if op!=2 and op!=3: raise TypeError("only '==' and '!='")
*/
__pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), __pyx_ptype_8petsc4py_5PETSc_Comm);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
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":24
* def __richcmp__(self, other, int op):
* if not isinstance(self, Comm): return NotImplemented
* if not isinstance(other, Comm): return NotImplemented # <<<<<<<<<<<<<<
* if op!=2 and op!=3: raise TypeError("only '==' and '!='")
* cdef Comm s = self
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Comm);
__pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
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":25
* 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) != 0);
if (__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L6_bool_binop_done;
}
__pyx_t_2 = ((__pyx_v_op != 3) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L6_bool_binop_done:;
if (unlikely(__pyx_t_1)) {
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 25, __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(10, 25, __pyx_L1_error)
}
/* "petsc4py/PETSc/Comm.pyx":26
* 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":27
* if op!=2 and op!=3: raise TypeError("only '==' and '!='")
* cdef Comm s = self
* cdef Comm o = other # <<<<<<<<<<<<<<
* cdef int eq = (op == 2)
* cdef MPI_Comm comm1 = s.comm
*/
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Comm))))) __PYX_ERR(10, 27, __pyx_L1_error)
__pyx_t_3 = __pyx_v_other;
__Pyx_INCREF(__pyx_t_3);
__pyx_v_o = ((struct PyPetscCommObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Comm.pyx":28
* 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":29
* cdef Comm o = other
* cdef int eq = (op == 2)
* cdef MPI_Comm comm1 = s.comm # <<<<<<<<<<<<<<
* cdef MPI_Comm comm2 = o.comm
* cdef int flag = 0
*/
__pyx_t_4 = __pyx_v_s->comm;
__pyx_v_comm1 = __pyx_t_4;
/* "petsc4py/PETSc/Comm.pyx":30
* cdef int eq = (op == 2)
* cdef MPI_Comm comm1 = s.comm
* cdef MPI_Comm comm2 = o.comm # <<<<<<<<<<<<<<
* cdef int flag = 0
* if comm1 != MPI_COMM_NULL and comm2 != MPI_COMM_NULL:
*/
__pyx_t_4 = __pyx_v_o->comm;
__pyx_v_comm2 = __pyx_t_4;
/* "petsc4py/PETSc/Comm.pyx":31
* 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":32
* 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) != 0);
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) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L9_bool_binop_done:;
if (__pyx_t_1) {
/* "petsc4py/PETSc/Comm.pyx":33
* 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(((PetscErrorCode)MPI_Comm_compare(__pyx_v_comm1, __pyx_v_comm2, (&__pyx_v_flag)))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(10, 33, __pyx_L1_error)
/* "petsc4py/PETSc/Comm.pyx":34
* 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_6 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 34, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L12_bool_binop_done;
}
__pyx_t_1 = (__pyx_v_flag == ((int)MPI_CONGRUENT));
__pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 34, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = __pyx_t_6;
__pyx_t_6 = 0;
__pyx_L12_bool_binop_done:;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Comm.pyx":35
* 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_6 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 35, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L14_bool_binop_done;
}
__pyx_t_1 = (__pyx_v_flag != ((int)MPI_CONGRUENT));
__pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 35, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = __pyx_t_6;
__pyx_t_6 = 0;
__pyx_L14_bool_binop_done:;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Comm.pyx":32
* 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":37
* 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(10, 37, __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
* else:
* if eq: return (comm1 == comm2)
* else: return (comm1 != comm2) # <<<<<<<<<<<<<<
*
* def __nonzero__(self):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_v_comm1 != __pyx_v_comm2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 38, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
}
/* "petsc4py/PETSc/Comm.pyx":22
* self.base = None
*
* def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
* if not isinstance(self, Comm): return NotImplemented
* if not isinstance(other, Comm): return NotImplemented
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("petsc4py.PETSc.Comm.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_s);
__Pyx_XDECREF((PyObject *)__pyx_v_o);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Comm.pyx":40
* else: return (comm1 != comm2)
*
* def __nonzero__(self): # <<<<<<<<<<<<<<
* return self.comm != MPI_COMM_NULL
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_4Comm_7__nonzero__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_4Comm_7__nonzero__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_6__nonzero__(((struct PyPetscCommObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4Comm_6__nonzero__(struct PyPetscCommObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__nonzero__", 0);
/* "petsc4py/PETSc/Comm.pyx":41
*
* def __nonzero__(self):
* return self.comm != MPI_COMM_NULL # <<<<<<<<<<<<<<
*
* #
*/
__pyx_r = (__pyx_v_self->comm != MPI_COMM_NULL);
goto __pyx_L0;
/* "petsc4py/PETSc/Comm.pyx":40
* else: return (comm1 != comm2)
*
* def __nonzero__(self): # <<<<<<<<<<<<<<
* return self.comm != MPI_COMM_NULL
*
*/
/* function exit code */
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Comm.pyx":45
* #
*
* def destroy(self): # <<<<<<<<<<<<<<
* if self.comm == MPI_COMM_NULL: return
* if not self.isdup:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_9destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4Comm_8destroy[] = "Comm.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_9destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_8destroy(((struct PyPetscCommObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_8destroy(struct PyPetscCommObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/Comm.pyx":46
*
* def destroy(self):
* 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) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/Comm.pyx":47
* def destroy(self):
* 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)) != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/Comm.pyx":48
* if self.comm == MPI_COMM_NULL: return
* if not self.isdup:
* raise ValueError("communicator not owned") # <<<<<<<<<<<<<<
* CHKERR( PetscCommDestroy(&self.comm) )
* self.comm = MPI_COMM_NULL
*/
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 48, __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, 48, __pyx_L1_error)
/* "petsc4py/PETSc/Comm.pyx":47
* def destroy(self):
* if self.comm == MPI_COMM_NULL: return
* if not self.isdup: # <<<<<<<<<<<<<<
* raise ValueError("communicator not owned")
* CHKERR( PetscCommDestroy(&self.comm) )
*/
}
/* "petsc4py/PETSc/Comm.pyx":49
* if not self.isdup:
* raise ValueError("communicator not owned")
* CHKERR( PetscCommDestroy(&self.comm) ) # <<<<<<<<<<<<<<
* self.comm = MPI_COMM_NULL
* self.isdup = 0
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscCommDestroy((&__pyx_v_self->comm))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(10, 49, __pyx_L1_error)
/* "petsc4py/PETSc/Comm.pyx":50
* 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":51
* CHKERR( PetscCommDestroy(&self.comm) )
* self.comm = MPI_COMM_NULL
* self.isdup = 0 # <<<<<<<<<<<<<<
* self.base = None
*
*/
__pyx_v_self->isdup = 0;
/* "petsc4py/PETSc/Comm.pyx":52
* self.comm = MPI_COMM_NULL
* self.isdup = 0
* self.base = None # <<<<<<<<<<<<<<
*
* def duplicate(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":45
* #
*
* def destroy(self): # <<<<<<<<<<<<<<
* if self.comm == MPI_COMM_NULL: return
* if not self.isdup:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Comm.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Comm.pyx":54
* self.base = None
*
* def duplicate(self): # <<<<<<<<<<<<<<
* if self.comm == MPI_COMM_NULL:
* raise ValueError("null communicator")
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_11duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4Comm_10duplicate[] = "Comm.duplicate(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_11duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("duplicate (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("duplicate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "duplicate", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_10duplicate(((struct PyPetscCommObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_10duplicate(struct PyPetscCommObject *__pyx_v_self) {
MPI_Comm __pyx_v_newcomm;
struct PyPetscCommObject *__pyx_v_comm = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("duplicate", 0);
/* "petsc4py/PETSc/Comm.pyx":55
*
* def duplicate(self):
* 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) != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/Comm.pyx":56
* def duplicate(self):
* if self.comm == MPI_COMM_NULL:
* raise ValueError("null communicator") # <<<<<<<<<<<<<<
* cdef MPI_Comm newcomm = MPI_COMM_NULL
* CHKERR( PetscCommDuplicate(self.comm, &newcomm, NULL) )
*/
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); 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/Comm.pyx":55
*
* def duplicate(self):
* if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<<
* raise ValueError("null communicator")
* cdef MPI_Comm newcomm = MPI_COMM_NULL
*/
}
/* "petsc4py/PETSc/Comm.pyx":57
* 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":58
* raise ValueError("null communicator")
* cdef MPI_Comm newcomm = MPI_COMM_NULL
* CHKERR( PetscCommDuplicate(self.comm, &newcomm, NULL) ) # <<<<<<<<<<<<<<
* cdef Comm comm = type(self)()
* comm.comm = newcomm
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscCommDuplicate(__pyx_v_self->comm, (&__pyx_v_newcomm), NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(10, 58, __pyx_L1_error)
/* "petsc4py/PETSc/Comm.pyx":59
* cdef MPI_Comm newcomm = MPI_COMM_NULL
* CHKERR( PetscCommDuplicate(self.comm, &newcomm, NULL) )
* cdef Comm comm = type(self)() # <<<<<<<<<<<<<<
* comm.comm = newcomm
* comm.isdup = 1
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 59, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Comm))))) __PYX_ERR(10, 59, __pyx_L1_error)
__pyx_v_comm = ((struct PyPetscCommObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Comm.pyx":60
* 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":61
* 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":62
* 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":63
* comm.isdup = 1
* comm.base = self.base
* return comm # <<<<<<<<<<<<<<
*
* def getSize(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_comm));
__pyx_r = ((PyObject *)__pyx_v_comm);
goto __pyx_L0;
/* "petsc4py/PETSc/Comm.pyx":54
* self.base = None
*
* def duplicate(self): # <<<<<<<<<<<<<<
* if self.comm == MPI_COMM_NULL:
* raise ValueError("null communicator")
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.Comm.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_comm);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Comm.pyx":65
* return comm
*
* def getSize(self): # <<<<<<<<<<<<<<
* if self.comm == MPI_COMM_NULL:
* raise ValueError("null communicator")
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_13getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4Comm_12getSize[] = "Comm.getSize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_13getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getSize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_12getSize(((struct PyPetscCommObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_12getSize(struct PyPetscCommObject *__pyx_v_self) {
int __pyx_v_size;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getSize", 0);
/* "petsc4py/PETSc/Comm.pyx":66
*
* def getSize(self):
* if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<<
* raise ValueError("null communicator")
* cdef int size=0
*/
__pyx_t_1 = ((__pyx_v_self->comm == MPI_COMM_NULL) != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/Comm.pyx":67
* def getSize(self):
* if self.comm == MPI_COMM_NULL:
* raise ValueError("null communicator") # <<<<<<<<<<<<<<
* cdef int size=0
* MPI_Comm_size(self.comm, &size)
*/
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 67, __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, 67, __pyx_L1_error)
/* "petsc4py/PETSc/Comm.pyx":66
*
* def getSize(self):
* if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<<
* raise ValueError("null communicator")
* cdef int size=0
*/
}
/* "petsc4py/PETSc/Comm.pyx":68
* if self.comm == MPI_COMM_NULL:
* raise ValueError("null communicator")
* cdef int size=0 # <<<<<<<<<<<<<<
* MPI_Comm_size(self.comm, &size)
* return size
*/
__pyx_v_size = 0;
/* "petsc4py/PETSc/Comm.pyx":69
* raise ValueError("null communicator")
* cdef int size=0
* MPI_Comm_size(self.comm, &size) # <<<<<<<<<<<<<<
* return size
*
*/
(void)(MPI_Comm_size(__pyx_v_self->comm, (&__pyx_v_size)));
/* "petsc4py/PETSc/Comm.pyx":70
* cdef int size=0
* MPI_Comm_size(self.comm, &size)
* return size # <<<<<<<<<<<<<<
*
* def getRank(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 70, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Comm.pyx":65
* return comm
*
* def getSize(self): # <<<<<<<<<<<<<<
* if self.comm == MPI_COMM_NULL:
* raise ValueError("null communicator")
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Comm.getSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Comm.pyx":72
* return size
*
* def getRank(self): # <<<<<<<<<<<<<<
* if self.comm == MPI_COMM_NULL:
* raise ValueError("null communicator")
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_15getRank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4Comm_14getRank[] = "Comm.getRank(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_15getRank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getRank (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getRank", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRank", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_14getRank(((struct PyPetscCommObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_14getRank(struct PyPetscCommObject *__pyx_v_self) {
int __pyx_v_rank;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getRank", 0);
/* "petsc4py/PETSc/Comm.pyx":73
*
* def getRank(self):
* if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<<
* raise ValueError("null communicator")
* cdef int rank=0
*/
__pyx_t_1 = ((__pyx_v_self->comm == MPI_COMM_NULL) != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/Comm.pyx":74
* def getRank(self):
* if self.comm == MPI_COMM_NULL:
* raise ValueError("null communicator") # <<<<<<<<<<<<<<
* cdef int rank=0
* MPI_Comm_rank(self.comm, &rank)
*/
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 74, __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, 74, __pyx_L1_error)
/* "petsc4py/PETSc/Comm.pyx":73
*
* def getRank(self):
* if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<<
* raise ValueError("null communicator")
* cdef int rank=0
*/
}
/* "petsc4py/PETSc/Comm.pyx":75
* if self.comm == MPI_COMM_NULL:
* raise ValueError("null communicator")
* cdef int rank=0 # <<<<<<<<<<<<<<
* MPI_Comm_rank(self.comm, &rank)
* return rank
*/
__pyx_v_rank = 0;
/* "petsc4py/PETSc/Comm.pyx":76
* raise ValueError("null communicator")
* cdef int rank=0
* MPI_Comm_rank(self.comm, &rank) # <<<<<<<<<<<<<<
* return rank
*
*/
(void)(MPI_Comm_rank(__pyx_v_self->comm, (&__pyx_v_rank)));
/* "petsc4py/PETSc/Comm.pyx":77
* cdef int rank=0
* MPI_Comm_rank(self.comm, &rank)
* return rank # <<<<<<<<<<<<<<
*
* def barrier(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rank); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 77, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Comm.pyx":72
* return size
*
* def getRank(self): # <<<<<<<<<<<<<<
* if self.comm == MPI_COMM_NULL:
* raise ValueError("null communicator")
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Comm.getRank", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Comm.pyx":79
* return rank
*
* def barrier(self): # <<<<<<<<<<<<<<
* if self.comm == MPI_COMM_NULL:
* raise ValueError("null communicator")
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_17barrier(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4Comm_16barrier[] = "Comm.barrier(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_17barrier(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("barrier (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("barrier", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "barrier", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_16barrier(((struct PyPetscCommObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_16barrier(struct PyPetscCommObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("barrier", 0);
/* "petsc4py/PETSc/Comm.pyx":80
*
* def barrier(self):
* if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<<
* raise ValueError("null communicator")
* MPI_Barrier(self.comm)
*/
__pyx_t_1 = ((__pyx_v_self->comm == MPI_COMM_NULL) != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/Comm.pyx":81
* def barrier(self):
* if self.comm == MPI_COMM_NULL:
* raise ValueError("null communicator") # <<<<<<<<<<<<<<
* MPI_Barrier(self.comm)
*
*/
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 81, __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, 81, __pyx_L1_error)
/* "petsc4py/PETSc/Comm.pyx":80
*
* def barrier(self):
* if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<<
* raise ValueError("null communicator")
* MPI_Barrier(self.comm)
*/
}
/* "petsc4py/PETSc/Comm.pyx":82
* if self.comm == MPI_COMM_NULL:
* raise ValueError("null communicator")
* MPI_Barrier(self.comm) # <<<<<<<<<<<<<<
*
* # --- properties ---
*/
(void)(MPI_Barrier(__pyx_v_self->comm));
/* "petsc4py/PETSc/Comm.pyx":79
* return rank
*
* def barrier(self): # <<<<<<<<<<<<<<
* if self.comm == MPI_COMM_NULL:
* raise ValueError("null communicator")
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Comm.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":87
*
* property size:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_4size___get__(((struct PyPetscCommObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4size___get__(struct PyPetscCommObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Comm.pyx":88
* property size:
* def __get__(self):
* return self.getSize() # <<<<<<<<<<<<<<
*
* property rank:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 88, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 88, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Comm.pyx":87
*
* property size:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getSize()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Comm.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Comm.pyx":91
*
* property rank:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_4rank___get__(((struct PyPetscCommObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4rank___get__(struct PyPetscCommObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Comm.pyx":92
* property rank:
* def __get__(self):
* return self.getRank() # <<<<<<<<<<<<<<
*
* # --- Fortran support ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getRank); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 92, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 92, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Comm.pyx":91
*
* property rank:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getRank()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Comm.rank.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Comm.pyx":97
*
* property fortran:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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":98
* property fortran:
* def __get__(self):
* 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":99
* def __get__(self):
* cdef MPI_Comm comm = self.comm
* return MPI_Comm_c2f(comm) # <<<<<<<<<<<<<<
*
* # --- mpi4py support ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_MPI_Fint(MPI_Comm_c2f(__pyx_v_comm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 99, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Comm.pyx":97
*
* property fortran:
* def __get__(self): # <<<<<<<<<<<<<<
* 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":103
* # --- mpi4py support ---
*
* def tompi4py(self): # <<<<<<<<<<<<<<
* cdef MPI_Comm comm = self.comm
* return mpi4py_Comm_New(comm)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_19tompi4py(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4Comm_18tompi4py[] = "Comm.tompi4py(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_19tompi4py(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("tompi4py (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("tompi4py", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "tompi4py", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_18tompi4py(((struct PyPetscCommObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_18tompi4py(struct PyPetscCommObject *__pyx_v_self) {
MPI_Comm __pyx_v_comm;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("tompi4py", 0);
/* "petsc4py/PETSc/Comm.pyx":104
*
* def tompi4py(self):
* 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":105
* def tompi4py(self):
* 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(10, 105, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Comm.pyx":103
* # --- mpi4py support ---
*
* def tompi4py(self): # <<<<<<<<<<<<<<
* cdef MPI_Comm comm = self.comm
* return mpi4py_Comm_New(comm)
*/
/* 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":130
* cdef MPI_Comm PETSC_COMM_DEFAULT = MPI_COMM_NULL
*
* cdef MPI_Comm GetComm(object comm, MPI_Comm defv) except *: # <<<<<<<<<<<<<<
* return def_Comm(comm, defv)
*
*/
static MPI_Comm __pyx_f_8petsc4py_5PETSc_GetComm(PyObject *__pyx_v_comm, MPI_Comm __pyx_v_defv) {
MPI_Comm __pyx_r;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("GetComm", 0);
/* "petsc4py/PETSc/Comm.pyx":131
*
* cdef MPI_Comm GetComm(object comm, MPI_Comm defv) except *:
* 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(PyErr_Occurred())) __PYX_ERR(10, 131, __pyx_L1_error)
__pyx_r = __pyx_t_1;
goto __pyx_L0;
/* "petsc4py/PETSc/Comm.pyx":130
* cdef MPI_Comm PETSC_COMM_DEFAULT = MPI_COMM_NULL
*
* cdef MPI_Comm GetComm(object comm, MPI_Comm defv) except *: # <<<<<<<<<<<<<<
* return def_Comm(comm, defv)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.GetComm", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Comm.pyx":133
* 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;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("GetCommDefault", 0);
/* "petsc4py/PETSc/Comm.pyx":134
*
* cdef MPI_Comm GetCommDefault():
* return PETSC_COMM_DEFAULT # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__pyx_r = __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT;
goto __pyx_L0;
/* "petsc4py/PETSc/Comm.pyx":133
* return def_Comm(comm, defv)
*
* cdef MPI_Comm GetCommDefault(): # <<<<<<<<<<<<<<
* return PETSC_COMM_DEFAULT
*
*/
/* function exit code */
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":7
* # --- special methods ---
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.oval = NULL
* self.obj = &self.oval
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_6Object_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_6Object_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object___cinit__(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_6Object___cinit__(struct PyPetscObjectObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/Object.pyx":8
*
* def __cinit__(self):
* self.oval = NULL # <<<<<<<<<<<<<<
* self.obj = &self.oval
*
*/
__pyx_v_self->oval = NULL;
/* "petsc4py/PETSc/Object.pyx":9
* def __cinit__(self):
* self.oval = NULL
* self.obj = &self.oval # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
__pyx_v_self->obj = (&__pyx_v_self->oval);
/* "petsc4py/PETSc/Object.pyx":7
* # --- special methods ---
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.oval = NULL
* self.obj = &self.oval
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":11
* self.obj = &self.oval
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* CHKERR( PetscDEALLOC(&self.obj[0]) )
* self.obj = NULL
*/
/* Python wrapper */
static void __pyx_pw_8petsc4py_5PETSc_6Object_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8petsc4py_5PETSc_6Object_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__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) {
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__dealloc__", 0);
/* "petsc4py/PETSc/Object.pyx":12
*
* def __dealloc__(self):
* CHKERR( PetscDEALLOC(&self.obj[0]) ) # <<<<<<<<<<<<<<
* self.obj = NULL
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscDEALLOC((&(__pyx_v_self->obj[0])))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 12, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":13
* def __dealloc__(self):
* CHKERR( PetscDEALLOC(&self.obj[0]) )
* self.obj = NULL # <<<<<<<<<<<<<<
*
* def __richcmp__(self, other, int op):
*/
__pyx_v_self->obj = NULL;
/* "petsc4py/PETSc/Object.pyx":11
* self.obj = &self.oval
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* CHKERR( PetscDEALLOC(&self.obj[0]) )
* self.obj = NULL
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_WriteUnraisable("petsc4py.PETSc.Object.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "petsc4py/PETSc/Object.pyx":15
* self.obj = NULL
*
* def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
* if not isinstance(self, Object): return NotImplemented
* if not isinstance(other, Object): return NotImplemented
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4__richcmp__(((struct PyPetscObjectObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4__richcmp__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
struct PyPetscObjectObject *__pyx_v_s = 0;
struct PyPetscObjectObject *__pyx_v_o = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__richcmp__", 0);
/* "petsc4py/PETSc/Object.pyx":16
*
* def __richcmp__(self, other, int op):
* if not isinstance(self, Object): return NotImplemented # <<<<<<<<<<<<<<
* if not isinstance(other, Object): return NotImplemented
* cdef Object s = self, o = other
*/
__pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), __pyx_ptype_8petsc4py_5PETSc_Object);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_builtin_NotImplemented);
__pyx_r = __pyx_builtin_NotImplemented;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Object.pyx":17
* def __richcmp__(self, other, int op):
* if not isinstance(self, Object): return NotImplemented
* if not isinstance(other, Object): return NotImplemented # <<<<<<<<<<<<<<
* cdef Object s = self, o = other
* if op == 2: return (s.obj[0] == o.obj[0])
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Object);
__pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_builtin_NotImplemented);
__pyx_r = __pyx_builtin_NotImplemented;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Object.pyx":18
* if not isinstance(self, Object): return NotImplemented
* if not isinstance(other, Object): return NotImplemented
* cdef Object s = self, o = other # <<<<<<<<<<<<<<
* if op == 2: return (s.obj[0] == o.obj[0])
* elif op == 3: return (s.obj[0] != o.obj[0])
*/
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_v_s = __pyx_v_self;
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(34, 18, __pyx_L1_error)
__pyx_t_3 = __pyx_v_other;
__Pyx_INCREF(__pyx_t_3);
__pyx_v_o = ((struct PyPetscObjectObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Object.pyx":19
* if not isinstance(other, Object): return NotImplemented
* cdef Object s = self, o = other
* if op == 2: return (s.obj[0] == o.obj[0]) # <<<<<<<<<<<<<<
* elif op == 3: return (s.obj[0] != o.obj[0])
* else: raise TypeError("only '==' and '!='")
*/
__pyx_t_1 = ((__pyx_v_op == 2) != 0);
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(34, 19, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Object.pyx":20
* cdef Object s = self, o = other
* if op == 2: return (s.obj[0] == o.obj[0])
* elif op == 3: return (s.obj[0] != o.obj[0]) # <<<<<<<<<<<<<<
* else: raise TypeError("only '==' and '!='")
*
*/
__pyx_t_1 = ((__pyx_v_op == 3) != 0);
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(34, 20, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Object.pyx":21
* if op == 2: return (s.obj[0] == o.obj[0])
* elif op == 3: return (s.obj[0] != o.obj[0])
* else: raise TypeError("only '==' and '!='") # <<<<<<<<<<<<<<
*
* def __nonzero__(self):
*/
/*else*/ {
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(34, 21, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(34, 21, __pyx_L1_error)
}
/* "petsc4py/PETSc/Object.pyx":15
* self.obj = NULL
*
* def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
* if not isinstance(self, Object): return NotImplemented
* if not isinstance(other, Object): return NotImplemented
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_s);
__Pyx_XDECREF((PyObject *)__pyx_v_o);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":23
* else: raise TypeError("only '==' and '!='")
*
* def __nonzero__(self): # <<<<<<<<<<<<<<
* return self.obj[0] != NULL
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_6Object_7__nonzero__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_6Object_7__nonzero__(PyObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_6__nonzero__(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_6Object_6__nonzero__(struct PyPetscObjectObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__nonzero__", 0);
/* "petsc4py/PETSc/Object.pyx":24
*
* def __nonzero__(self):
* return self.obj[0] != NULL # <<<<<<<<<<<<<<
*
* def __copy__(self):
*/
__pyx_r = ((__pyx_v_self->obj[0]) != NULL);
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":23
* else: raise TypeError("only '==' and '!='")
*
* def __nonzero__(self): # <<<<<<<<<<<<<<
* return self.obj[0] != NULL
*
*/
/* function exit code */
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":26
* return self.obj[0] != NULL
*
* def __copy__(self): # <<<<<<<<<<<<<<
* cdef Object obj = type(self)()
* cdef PetscObject o = self.obj[0]
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_9__copy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_8__copy__[] = "Object.__copy__(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_9__copy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__copy__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__copy__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__copy__", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_8__copy__(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_8__copy__(struct PyPetscObjectObject *__pyx_v_self) {
struct PyPetscObjectObject *__pyx_v_obj = 0;
PetscObject __pyx_v_o;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PetscErrorCode __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__copy__", 0);
/* "petsc4py/PETSc/Object.pyx":27
*
* def __copy__(self):
* cdef Object obj = type(self)() # <<<<<<<<<<<<<<
* cdef PetscObject o = self.obj[0]
* if o != NULL:
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 27, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(34, 27, __pyx_L1_error)
__pyx_v_obj = ((struct PyPetscObjectObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":28
* def __copy__(self):
* cdef Object obj = type(self)()
* cdef PetscObject o = self.obj[0] # <<<<<<<<<<<<<<
* if o != NULL:
* CHKERR( PetscObjectReference(o) )
*/
__pyx_v_o = (__pyx_v_self->obj[0]);
/* "petsc4py/PETSc/Object.pyx":29
* cdef Object obj = type(self)()
* cdef PetscObject o = self.obj[0]
* if o != NULL: # <<<<<<<<<<<<<<
* CHKERR( PetscObjectReference(o) )
* obj.obj[0] = o
*/
__pyx_t_4 = ((__pyx_v_o != NULL) != 0);
if (__pyx_t_4) {
/* "petsc4py/PETSc/Object.pyx":30
* cdef PetscObject o = self.obj[0]
* if o != NULL:
* CHKERR( PetscObjectReference(o) ) # <<<<<<<<<<<<<<
* obj.obj[0] = o
* return obj
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectReference(__pyx_v_o)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 30, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":29
* cdef Object obj = type(self)()
* cdef PetscObject o = self.obj[0]
* if o != NULL: # <<<<<<<<<<<<<<
* CHKERR( PetscObjectReference(o) )
* obj.obj[0] = o
*/
}
/* "petsc4py/PETSc/Object.pyx":31
* if o != NULL:
* CHKERR( PetscObjectReference(o) )
* obj.obj[0] = o # <<<<<<<<<<<<<<
* return obj
*
*/
(__pyx_v_obj->obj[0]) = __pyx_v_o;
/* "petsc4py/PETSc/Object.pyx":32
* CHKERR( PetscObjectReference(o) )
* obj.obj[0] = o
* return obj # <<<<<<<<<<<<<<
*
* def __deepcopy__(self, dict memo):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_obj));
__pyx_r = ((PyObject *)__pyx_v_obj);
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":26
* return self.obj[0] != NULL
*
* def __copy__(self): # <<<<<<<<<<<<<<
* cdef Object obj = type(self)()
* cdef PetscObject o = self.obj[0]
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_obj);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":34
* return obj
*
* def __deepcopy__(self, dict memo): # <<<<<<<<<<<<<<
* cdef object obj_copy = None
* try:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_11__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_10__deepcopy__[] = "Object.__deepcopy__(self, dict memo)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_11__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_memo = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memo,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memo)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__deepcopy__") < 0)) __PYX_ERR(34, 34, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_memo = ((PyObject*)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__deepcopy__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(34, 34, __pyx_L3_error)
__pyx_L3_error:;
__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(34, 34, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_10__deepcopy__(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_memo);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_10__deepcopy__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_v_obj_copy = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__deepcopy__", 0);
/* "petsc4py/PETSc/Object.pyx":35
*
* def __deepcopy__(self, dict memo):
* cdef object obj_copy = None # <<<<<<<<<<<<<<
* try:
* obj_copy = self.copy
*/
__Pyx_INCREF(Py_None);
__pyx_v_obj_copy = Py_None;
/* "petsc4py/PETSc/Object.pyx":36
* def __deepcopy__(self, dict memo):
* cdef object obj_copy = None
* try: # <<<<<<<<<<<<<<
* obj_copy = self.copy
* except AttributeError:
*/
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
/* "petsc4py/PETSc/Object.pyx":37
* cdef object obj_copy = None
* try:
* obj_copy = self.copy # <<<<<<<<<<<<<<
* except AttributeError:
* raise NotImplementedError
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 37, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_obj_copy, __pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Object.pyx":36
* def __deepcopy__(self, dict memo):
* cdef object obj_copy = None
* try: # <<<<<<<<<<<<<<
* obj_copy = self.copy
* except AttributeError:
*/
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L8_try_end;
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/Object.pyx":38
* try:
* obj_copy = self.copy
* except AttributeError: # <<<<<<<<<<<<<<
* raise NotImplementedError
* <void>memo # unused
*/
__pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_t_5) {
__Pyx_AddTraceback("petsc4py.PETSc.Object.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(34, 38, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_7);
/* "petsc4py/PETSc/Object.pyx":39
* obj_copy = self.copy
* except AttributeError:
* raise NotImplementedError # <<<<<<<<<<<<<<
* <void>memo # unused
* return obj_copy()
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(34, 39, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
/* "petsc4py/PETSc/Object.pyx":36
* def __deepcopy__(self, dict memo):
* cdef object obj_copy = None
* try: # <<<<<<<<<<<<<<
* obj_copy = self.copy
* except AttributeError:
*/
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
__pyx_L8_try_end:;
}
/* "petsc4py/PETSc/Object.pyx":40
* except AttributeError:
* raise NotImplementedError
* <void>memo # unused # <<<<<<<<<<<<<<
* return obj_copy()
*
*/
((void)__pyx_v_memo);
/* "petsc4py/PETSc/Object.pyx":41
* raise NotImplementedError
* <void>memo # unused
* return obj_copy() # <<<<<<<<<<<<<<
*
* # --- attribute management ---
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_obj_copy);
__pyx_t_6 = __pyx_v_obj_copy; __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
}
}
__pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(34, 41, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_r = __pyx_t_7;
__pyx_t_7 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":34
* return obj
*
* def __deepcopy__(self, dict memo): # <<<<<<<<<<<<<<
* cdef object obj_copy = None
* try:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.Object.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_obj_copy);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":45
* # --- attribute management ---
*
* cdef object get_attr(self, char name[]): # <<<<<<<<<<<<<<
* return PetscGetPyObj(self.obj[0], name)
*
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_get_attr(struct PyPetscObjectObject *__pyx_v_self, char *__pyx_v_name) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_attr", 0);
/* "petsc4py/PETSc/Object.pyx":46
*
* cdef object get_attr(self, char name[]):
* return PetscGetPyObj(self.obj[0], name) # <<<<<<<<<<<<<<
*
* cdef object set_attr(self, char name[], object attr):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PetscGetPyObj((__pyx_v_self->obj[0]), __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 46, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":45
* # --- attribute management ---
*
* cdef object get_attr(self, char name[]): # <<<<<<<<<<<<<<
* return PetscGetPyObj(self.obj[0], name)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Object.get_attr", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":48
* return PetscGetPyObj(self.obj[0], name)
*
* cdef object set_attr(self, char name[], object attr): # <<<<<<<<<<<<<<
* return PetscSetPyObj(self.obj[0], name, attr)
*
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_set_attr(struct PyPetscObjectObject *__pyx_v_self, char *__pyx_v_name, PyObject *__pyx_v_attr) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_attr", 0);
/* "petsc4py/PETSc/Object.pyx":49
*
* cdef object set_attr(self, char name[], object attr):
* return PetscSetPyObj(self.obj[0], name, attr) # <<<<<<<<<<<<<<
*
* cdef object get_dict(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PetscSetPyObj((__pyx_v_self->obj[0]), __pyx_v_name, __pyx_v_attr); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 49, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":48
* return PetscGetPyObj(self.obj[0], name)
*
* cdef object set_attr(self, char name[], object attr): # <<<<<<<<<<<<<<
* return PetscSetPyObj(self.obj[0], name, attr)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Object.set_attr", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":51
* return PetscSetPyObj(self.obj[0], name, attr)
*
* cdef object get_dict(self): # <<<<<<<<<<<<<<
* return PetscGetPyDict(self.obj[0], True)
*
*/
static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_get_dict(struct PyPetscObjectObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_dict", 0);
/* "petsc4py/PETSc/Object.pyx":52
*
* cdef object get_dict(self):
* return PetscGetPyDict(self.obj[0], True) # <<<<<<<<<<<<<<
*
* #
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PetscGetPyDict((__pyx_v_self->obj[0]), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 52, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":51
* return PetscSetPyObj(self.obj[0], name, attr)
*
* cdef object get_dict(self): # <<<<<<<<<<<<<<
* return PetscGetPyDict(self.obj[0], True)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Object.get_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":56
* #
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_13view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_12view[] = "Object.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_13view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(34, 56, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(34, 56, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(34, 56, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_12view(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/Object.pyx":57
*
* def view(self, Viewer viewer=None):
* cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<<
* if viewer is not None: vwr = viewer.vwr
* CHKERR( PetscObjectView(self.obj[0], vwr) )
*/
__pyx_v_vwr = NULL;
/* "petsc4py/PETSc/Object.pyx":58
* def view(self, Viewer viewer=None):
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<<
* CHKERR( PetscObjectView(self.obj[0], vwr) )
*
*/
__pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
}
/* "petsc4py/PETSc/Object.pyx":59
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
* CHKERR( PetscObjectView(self.obj[0], vwr) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectView((__pyx_v_self->obj[0]), __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 59, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":56
* #
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":61
* CHKERR( PetscObjectView(self.obj[0], vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PetscObjectDestroy(&self.obj[0]) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_15destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_14destroy[] = "Object.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_15destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_14destroy(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_14destroy(struct PyPetscObjectObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/Object.pyx":62
*
* def destroy(self):
* CHKERR( PetscObjectDestroy(&self.obj[0]) ) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectDestroy((&(__pyx_v_self->obj[0])))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 62, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":63
* def destroy(self):
* CHKERR( PetscObjectDestroy(&self.obj[0]) )
* return self # <<<<<<<<<<<<<<
*
* def getType(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":61
* CHKERR( PetscObjectView(self.obj[0], vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PetscObjectDestroy(&self.obj[0]) )
* return self
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":65
* return self
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetType(self.obj[0], &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_17getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_16getType[] = "Object.getType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_17getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_16getType(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_16getType(struct PyPetscObjectObject *__pyx_v_self) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getType", 0);
/* "petsc4py/PETSc/Object.pyx":66
*
* def getType(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscObjectGetType(self.obj[0], &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Object.pyx":67
* def getType(self):
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetType(self.obj[0], &cval) ) # <<<<<<<<<<<<<<
* return bytes2str(cval)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetType((__pyx_v_self->obj[0]), (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 67, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":68
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetType(self.obj[0], &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* #
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 68, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":65
* return self
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetType(self.obj[0], &cval) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Object.getType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":72
* #
*
* def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_19setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_18setOptionsPrefix[] = "Object.setOptionsPrefix(self, prefix)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_19setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(34, 72, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_prefix = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(34, 72, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_18setOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_prefix) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setOptionsPrefix", 0);
__Pyx_INCREF(__pyx_v_prefix);
/* "petsc4py/PETSc/Object.pyx":73
*
* def setOptionsPrefix(self, prefix):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* prefix = str2bytes(prefix, &cval)
* CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Object.pyx":74
* def setOptionsPrefix(self, prefix):
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<<
* CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 74, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":75
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
* CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) ) # <<<<<<<<<<<<<<
*
* def getOptionsPrefix(self):
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectSetOptionsPrefix((__pyx_v_self->obj[0]), __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 75, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":72
* #
*
* def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Object.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_prefix);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":77
* CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) )
*
* def getOptionsPrefix(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_21getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_20getOptionsPrefix[] = "Object.getOptionsPrefix(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_21getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_20getOptionsPrefix(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_20getOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getOptionsPrefix", 0);
/* "petsc4py/PETSc/Object.pyx":78
*
* def getOptionsPrefix(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Object.pyx":79
* def getOptionsPrefix(self):
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) ) # <<<<<<<<<<<<<<
* return bytes2str(cval)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetOptionsPrefix((__pyx_v_self->obj[0]), (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 79, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":80
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def appendOptionsPrefix(self, prefix):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 80, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":77
* CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) )
*
* def getOptionsPrefix(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Object.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":82
* return bytes2str(cval)
*
* def appendOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_23appendOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_22appendOptionsPrefix[] = "Object.appendOptionsPrefix(self, prefix)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_23appendOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "appendOptionsPrefix") < 0)) __PYX_ERR(34, 82, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_prefix = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(34, 82, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_22appendOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_prefix) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("appendOptionsPrefix", 0);
__Pyx_INCREF(__pyx_v_prefix);
/* "petsc4py/PETSc/Object.pyx":83
*
* def appendOptionsPrefix(self, prefix):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* prefix = str2bytes(prefix, &cval)
* CHKERR( PetscObjectAppendOptionsPrefix(self.obj[0], cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Object.pyx":84
* def appendOptionsPrefix(self, prefix):
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<<
* CHKERR( PetscObjectAppendOptionsPrefix(self.obj[0], cval) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":85
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
* CHKERR( PetscObjectAppendOptionsPrefix(self.obj[0], cval) ) # <<<<<<<<<<<<<<
*
* def setFromOptions(self):
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectAppendOptionsPrefix((__pyx_v_self->obj[0]), __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 85, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":82
* return bytes2str(cval)
*
* def appendOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Object.appendOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_prefix);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":87
* CHKERR( PetscObjectAppendOptionsPrefix(self.obj[0], cval) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( PetscObjectSetFromOptions(self.obj[0]) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_25setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_24setFromOptions[] = "Object.setFromOptions(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_25setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_24setFromOptions(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_24setFromOptions(struct PyPetscObjectObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFromOptions", 0);
/* "petsc4py/PETSc/Object.pyx":88
*
* def setFromOptions(self):
* CHKERR( PetscObjectSetFromOptions(self.obj[0]) ) # <<<<<<<<<<<<<<
*
* def viewFromOptions(self, name, Object prefix=None):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectSetFromOptions((__pyx_v_self->obj[0]))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 88, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":87
* CHKERR( PetscObjectAppendOptionsPrefix(self.obj[0], cval) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( PetscObjectSetFromOptions(self.obj[0]) )
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":90
* CHKERR( PetscObjectSetFromOptions(self.obj[0]) )
*
* def viewFromOptions(self, name, Object prefix=None): # <<<<<<<<<<<<<<
* cdef PetscObject pobj = NULL
* cdef const char *cval = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_27viewFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_26viewFromOptions[] = "Object.viewFromOptions(self, name, Object prefix=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_27viewFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
struct PyPetscObjectObject *__pyx_v_prefix = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_prefix,0};
PyObject* values[2] = {0,0};
values[1] = (PyObject *)((struct PyPetscObjectObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "viewFromOptions") < 0)) __PYX_ERR(34, 90, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_prefix = ((struct PyPetscObjectObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("viewFromOptions", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(34, 90, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "prefix", 0))) __PYX_ERR(34, 90, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_26viewFromOptions(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name, __pyx_v_prefix);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_26viewFromOptions(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_prefix) {
PetscObject __pyx_v_pobj;
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscObject __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("viewFromOptions", 0);
__Pyx_INCREF(__pyx_v_name);
/* "petsc4py/PETSc/Object.pyx":91
*
* def viewFromOptions(self, name, Object prefix=None):
* cdef PetscObject pobj = NULL # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* pobj = prefix.obj[0] if prefix is not None else NULL
*/
__pyx_v_pobj = NULL;
/* "petsc4py/PETSc/Object.pyx":92
* def viewFromOptions(self, name, Object prefix=None):
* cdef PetscObject pobj = NULL
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* pobj = prefix.obj[0] if prefix is not None else NULL
* name = str2bytes(name, &cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Object.pyx":93
* cdef PetscObject pobj = NULL
* cdef const char *cval = NULL
* pobj = prefix.obj[0] if prefix is not None else NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cval)
* CHKERR( PetscObjectViewFromOptions(self.obj[0], pobj, cval) )
*/
__pyx_t_2 = (((PyObject *)__pyx_v_prefix) != Py_None);
if ((__pyx_t_2 != 0)) {
__pyx_t_1 = (__pyx_v_prefix->obj[0]);
} else {
__pyx_t_1 = NULL;
}
__pyx_v_pobj = __pyx_t_1;
/* "petsc4py/PETSc/Object.pyx":94
* cdef const char *cval = NULL
* pobj = prefix.obj[0] if prefix is not None else NULL
* name = str2bytes(name, &cval) # <<<<<<<<<<<<<<
* CHKERR( PetscObjectViewFromOptions(self.obj[0], pobj, cval) )
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_3)) __PYX_ERR(34, 94, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Object.pyx":95
* pobj = prefix.obj[0] if prefix is not None else NULL
* name = str2bytes(name, &cval)
* CHKERR( PetscObjectViewFromOptions(self.obj[0], pobj, cval) ) # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectViewFromOptions((__pyx_v_self->obj[0]), __pyx_v_pobj, __pyx_v_cval)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 95, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":90
* CHKERR( PetscObjectSetFromOptions(self.obj[0]) )
*
* def viewFromOptions(self, name, Object prefix=None): # <<<<<<<<<<<<<<
* cdef PetscObject pobj = NULL
* cdef const char *cval = NULL
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":99
* #
*
* def getComm(self): # <<<<<<<<<<<<<<
* cdef Comm comm = Comm()
* CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_29getComm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_28getComm[] = "Object.getComm(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_29getComm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getComm (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getComm", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getComm", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_28getComm(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_28getComm(struct PyPetscObjectObject *__pyx_v_self) {
struct PyPetscCommObject *__pyx_v_comm = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getComm", 0);
/* "petsc4py/PETSc/Object.pyx":100
*
* def getComm(self):
* cdef Comm comm = Comm() # <<<<<<<<<<<<<<
* CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) )
* return comm
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_comm = ((struct PyPetscCommObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":101
* def getComm(self):
* cdef Comm comm = Comm()
* CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) ) # <<<<<<<<<<<<<<
* return comm
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm((__pyx_v_self->obj[0]), (&__pyx_v_comm->comm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 101, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":102
* cdef Comm comm = Comm()
* CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) )
* return comm # <<<<<<<<<<<<<<
*
* def getName(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_comm));
__pyx_r = ((PyObject *)__pyx_v_comm);
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":99
* #
*
* def getComm(self): # <<<<<<<<<<<<<<
* cdef Comm comm = Comm()
* CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Object.getComm", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_comm);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":104
* return comm
*
* def getName(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetName(self.obj[0], &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_31getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_30getName[] = "Object.getName(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_31getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getName (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getName", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getName", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_30getName(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_30getName(struct PyPetscObjectObject *__pyx_v_self) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getName", 0);
/* "petsc4py/PETSc/Object.pyx":105
*
* def getName(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscObjectGetName(self.obj[0], &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Object.pyx":106
* def getName(self):
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetName(self.obj[0], &cval) ) # <<<<<<<<<<<<<<
* return bytes2str(cval)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetName((__pyx_v_self->obj[0]), (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 106, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":107
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetName(self.obj[0], &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def setName(self, name):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 107, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":104
* return comm
*
* def getName(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetName(self.obj[0], &cval) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Object.getName", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":109
* return bytes2str(cval)
*
* def setName(self, name): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* name = str2bytes(name, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_33setName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_32setName[] = "Object.setName(self, name)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_33setName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setName") < 0)) __PYX_ERR(34, 109, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_name = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setName", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(34, 109, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.setName", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_32setName(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_32setName(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setName", 0);
__Pyx_INCREF(__pyx_v_name);
/* "petsc4py/PETSc/Object.pyx":110
*
* def setName(self, name):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cval)
* CHKERR( PetscObjectSetName(self.obj[0], cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Object.pyx":111
* def setName(self, name):
* cdef const char *cval = NULL
* name = str2bytes(name, &cval) # <<<<<<<<<<<<<<
* CHKERR( PetscObjectSetName(self.obj[0], cval) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 111, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":112
* cdef const char *cval = NULL
* name = str2bytes(name, &cval)
* CHKERR( PetscObjectSetName(self.obj[0], cval) ) # <<<<<<<<<<<<<<
*
* def getClassId(self):
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectSetName((__pyx_v_self->obj[0]), __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 112, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":109
* return bytes2str(cval)
*
* def setName(self, name): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* name = str2bytes(name, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Object.setName", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":114
* CHKERR( PetscObjectSetName(self.obj[0], cval) )
*
* def getClassId(self): # <<<<<<<<<<<<<<
* cdef PetscClassId classid = 0
* CHKERR( PetscObjectGetClassId(self.obj[0], &classid) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_35getClassId(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_34getClassId[] = "Object.getClassId(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_35getClassId(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getClassId (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getClassId", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getClassId", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_34getClassId(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_34getClassId(struct PyPetscObjectObject *__pyx_v_self) {
PetscClassId __pyx_v_classid;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getClassId", 0);
/* "petsc4py/PETSc/Object.pyx":115
*
* def getClassId(self):
* cdef PetscClassId classid = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscObjectGetClassId(self.obj[0], &classid) )
* return <long>classid
*/
__pyx_v_classid = 0;
/* "petsc4py/PETSc/Object.pyx":116
* def getClassId(self):
* 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(34, 116, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":117
* cdef PetscClassId classid = 0
* CHKERR( PetscObjectGetClassId(self.obj[0], &classid) )
* return <long>classid # <<<<<<<<<<<<<<
*
* def getClassName(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_long(((long)__pyx_v_classid)); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 117, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":114
* CHKERR( PetscObjectSetName(self.obj[0], cval) )
*
* def getClassId(self): # <<<<<<<<<<<<<<
* cdef PetscClassId classid = 0
* CHKERR( PetscObjectGetClassId(self.obj[0], &classid) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Object.getClassId", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":119
* return <long>classid
*
* def getClassName(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetClassName(self.obj[0], &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_37getClassName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_36getClassName[] = "Object.getClassName(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_37getClassName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getClassName (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getClassName", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getClassName", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_36getClassName(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_36getClassName(struct PyPetscObjectObject *__pyx_v_self) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getClassName", 0);
/* "petsc4py/PETSc/Object.pyx":120
*
* def getClassName(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscObjectGetClassName(self.obj[0], &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Object.pyx":121
* def getClassName(self):
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetClassName(self.obj[0], &cval) ) # <<<<<<<<<<<<<<
* return bytes2str(cval)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetClassName((__pyx_v_self->obj[0]), (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 121, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":122
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetClassName(self.obj[0], &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def getRefCount(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 122, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":119
* return <long>classid
*
* def getClassName(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscObjectGetClassName(self.obj[0], &cval) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Object.getClassName", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":124
* return bytes2str(cval)
*
* def getRefCount(self): # <<<<<<<<<<<<<<
* if self.obj[0] == NULL: return 0
* cdef PetscInt refcnt = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_39getRefCount(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_38getRefCount[] = "Object.getRefCount(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_39getRefCount(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getRefCount (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getRefCount", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRefCount", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_38getRefCount(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_38getRefCount(struct PyPetscObjectObject *__pyx_v_self) {
PetscInt __pyx_v_refcnt;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getRefCount", 0);
/* "petsc4py/PETSc/Object.pyx":125
*
* def getRefCount(self):
* if self.obj[0] == NULL: return 0 # <<<<<<<<<<<<<<
* cdef PetscInt refcnt = 0
* CHKERR( PetscObjectGetReference(self.obj[0], &refcnt) )
*/
__pyx_t_1 = (((__pyx_v_self->obj[0]) == NULL) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_int_0);
__pyx_r = __pyx_int_0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Object.pyx":126
* def getRefCount(self):
* if self.obj[0] == NULL: return 0
* cdef PetscInt refcnt = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscObjectGetReference(self.obj[0], &refcnt) )
* return toInt(refcnt)
*/
__pyx_v_refcnt = 0;
/* "petsc4py/PETSc/Object.pyx":127
* if self.obj[0] == NULL: return 0
* cdef PetscInt refcnt = 0
* CHKERR( PetscObjectGetReference(self.obj[0], &refcnt) ) # <<<<<<<<<<<<<<
* return toInt(refcnt)
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetReference((__pyx_v_self->obj[0]), (&__pyx_v_refcnt))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 127, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":128
* cdef PetscInt refcnt = 0
* CHKERR( PetscObjectGetReference(self.obj[0], &refcnt) )
* return toInt(refcnt) # <<<<<<<<<<<<<<
*
* # --- general support ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_refcnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(34, 128, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":124
* return bytes2str(cval)
*
* def getRefCount(self): # <<<<<<<<<<<<<<
* if self.obj[0] == NULL: return 0
* cdef PetscInt refcnt = 0
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.getRefCount", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":132
* # --- general support ---
*
* def compose(self, name, Object obj or None): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* cdef PetscObject cobj = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_41compose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_40compose[] = "Object.compose(self, name, Object obj)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_41compose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
struct PyPetscObjectObject *__pyx_v_obj = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_obj,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("compose", 1, 2, 2, 1); __PYX_ERR(34, 132, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compose") < 0)) __PYX_ERR(34, 132, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_name = values[0];
__pyx_v_obj = ((struct PyPetscObjectObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("compose", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(34, 132, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.compose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "obj", 0))) __PYX_ERR(34, 132, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_40compose(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name, __pyx_v_obj);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_40compose(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj) {
char const *__pyx_v_cval;
PetscObject __pyx_v_cobj;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("compose", 0);
__Pyx_INCREF(__pyx_v_name);
/* "petsc4py/PETSc/Object.pyx":133
*
* def compose(self, name, Object obj or None):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* cdef PetscObject cobj = NULL
* name = str2bytes(name, &cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Object.pyx":134
* def compose(self, name, Object obj or None):
* cdef const char *cval = NULL
* cdef PetscObject cobj = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cval)
* if obj is not None: cobj = obj.obj[0]
*/
__pyx_v_cobj = NULL;
/* "petsc4py/PETSc/Object.pyx":135
* cdef const char *cval = NULL
* cdef PetscObject cobj = NULL
* name = str2bytes(name, &cval) # <<<<<<<<<<<<<<
* if obj is not None: cobj = obj.obj[0]
* CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) )
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":136
* cdef PetscObject cobj = NULL
* name = str2bytes(name, &cval)
* if obj is not None: cobj = obj.obj[0] # <<<<<<<<<<<<<<
* CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) )
*
*/
__pyx_t_2 = (((PyObject *)__pyx_v_obj) != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_v_cobj = (__pyx_v_obj->obj[0]);
}
/* "petsc4py/PETSc/Object.pyx":137
* name = str2bytes(name, &cval)
* if obj is not None: cobj = obj.obj[0]
* CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) ) # <<<<<<<<<<<<<<
*
* def query(self, name):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectCompose((__pyx_v_self->obj[0]), __pyx_v_cval, __pyx_v_cobj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 137, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":132
* # --- general support ---
*
* def compose(self, name, Object obj or None): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* cdef PetscObject cobj = NULL
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Object.compose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":139
* CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) )
*
* def query(self, name): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* cdef PetscObject cobj = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_43query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_42query[] = "Object.query(self, name)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_43query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "query") < 0)) __PYX_ERR(34, 139, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_name = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("query", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(34, 139, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_42query(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_42query(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name) {
char const *__pyx_v_cval;
PetscObject __pyx_v_cobj;
struct PyPetscObjectObject *__pyx_v_obj = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("query", 0);
__Pyx_INCREF(__pyx_v_name);
/* "petsc4py/PETSc/Object.pyx":140
*
* def query(self, name):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* cdef PetscObject cobj = NULL
* name = str2bytes(name, &cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Object.pyx":141
* def query(self, name):
* cdef const char *cval = NULL
* cdef PetscObject cobj = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cval)
* CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) )
*/
__pyx_v_cobj = NULL;
/* "petsc4py/PETSc/Object.pyx":142
* cdef const char *cval = NULL
* cdef PetscObject cobj = NULL
* name = str2bytes(name, &cval) # <<<<<<<<<<<<<<
* CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) )
* if cobj == NULL: return None
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":143
* cdef PetscObject cobj = NULL
* name = str2bytes(name, &cval)
* CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) ) # <<<<<<<<<<<<<<
* if cobj == NULL: return None
* cdef Object obj = subtype_Object(cobj)()
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectQuery((__pyx_v_self->obj[0]), __pyx_v_cval, (&__pyx_v_cobj))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 143, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":144
* name = str2bytes(name, &cval)
* CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) )
* if cobj == NULL: return None # <<<<<<<<<<<<<<
* cdef Object obj = subtype_Object(cobj)()
* obj.obj[0] = cobj
*/
__pyx_t_3 = ((__pyx_v_cobj == NULL) != 0);
if (__pyx_t_3) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/Object.pyx":145
* CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) )
* if cobj == NULL: return None
* cdef Object obj = subtype_Object(cobj)() # <<<<<<<<<<<<<<
* obj.obj[0] = cobj
* PetscINCREF(obj.obj)
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_Object(__pyx_v_cobj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 145, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 145, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(34, 145, __pyx_L1_error)
__pyx_v_obj = ((struct PyPetscObjectObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Object.pyx":146
* if cobj == NULL: return None
* cdef Object obj = subtype_Object(cobj)()
* obj.obj[0] = cobj # <<<<<<<<<<<<<<
* PetscINCREF(obj.obj)
* return obj
*/
(__pyx_v_obj->obj[0]) = __pyx_v_cobj;
/* "petsc4py/PETSc/Object.pyx":147
* cdef Object obj = subtype_Object(cobj)()
* obj.obj[0] = cobj
* PetscINCREF(obj.obj) # <<<<<<<<<<<<<<
* return obj
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_obj->obj));
/* "petsc4py/PETSc/Object.pyx":148
* obj.obj[0] = cobj
* PetscINCREF(obj.obj)
* return obj # <<<<<<<<<<<<<<
*
* def incRef(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_obj));
__pyx_r = ((PyObject *)__pyx_v_obj);
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":139
* CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) )
*
* def query(self, name): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* cdef PetscObject cobj = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("petsc4py.PETSc.Object.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_obj);
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":150
* return obj
*
* def incRef(self): # <<<<<<<<<<<<<<
* cdef PetscObject obj = self.obj[0]
* cdef PetscInt refct = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_45incRef(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_44incRef[] = "Object.incRef(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_45incRef(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("incRef (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("incRef", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "incRef", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_44incRef(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_44incRef(struct PyPetscObjectObject *__pyx_v_self) {
PetscObject __pyx_v_obj;
PetscInt __pyx_v_refct;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("incRef", 0);
/* "petsc4py/PETSc/Object.pyx":151
*
* def incRef(self):
* cdef PetscObject obj = self.obj[0] # <<<<<<<<<<<<<<
* cdef PetscInt refct = 0
* if obj != NULL:
*/
__pyx_v_obj = (__pyx_v_self->obj[0]);
/* "petsc4py/PETSc/Object.pyx":152
* def incRef(self):
* cdef PetscObject obj = self.obj[0]
* cdef PetscInt refct = 0 # <<<<<<<<<<<<<<
* if obj != NULL:
* CHKERR( PetscObjectReference(obj) )
*/
__pyx_v_refct = 0;
/* "petsc4py/PETSc/Object.pyx":153
* cdef PetscObject obj = self.obj[0]
* cdef PetscInt refct = 0
* if obj != NULL: # <<<<<<<<<<<<<<
* CHKERR( PetscObjectReference(obj) )
* CHKERR( PetscObjectGetReference(obj, &refct) )
*/
__pyx_t_1 = ((__pyx_v_obj != NULL) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Object.pyx":154
* cdef PetscInt refct = 0
* if obj != NULL:
* CHKERR( PetscObjectReference(obj) ) # <<<<<<<<<<<<<<
* CHKERR( PetscObjectGetReference(obj, &refct) )
* return (<long>refct)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectReference(__pyx_v_obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 154, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":155
* if obj != NULL:
* CHKERR( PetscObjectReference(obj) )
* CHKERR( PetscObjectGetReference(obj, &refct) ) # <<<<<<<<<<<<<<
* return (<long>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(34, 155, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":153
* cdef PetscObject obj = self.obj[0]
* cdef PetscInt refct = 0
* if obj != NULL: # <<<<<<<<<<<<<<
* CHKERR( PetscObjectReference(obj) )
* CHKERR( PetscObjectGetReference(obj, &refct) )
*/
}
/* "petsc4py/PETSc/Object.pyx":156
* CHKERR( PetscObjectReference(obj) )
* CHKERR( PetscObjectGetReference(obj, &refct) )
* return (<long>refct) # <<<<<<<<<<<<<<
*
* def decRef(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_From_long(((long)__pyx_v_refct)); if (unlikely(!__pyx_t_3)) __PYX_ERR(34, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":150
* return obj
*
* def incRef(self): # <<<<<<<<<<<<<<
* cdef PetscObject obj = self.obj[0]
* cdef PetscInt refct = 0
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.incRef", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":158
* return (<long>refct)
*
* def decRef(self): # <<<<<<<<<<<<<<
* cdef PetscObject obj = self.obj[0]
* cdef PetscInt refct = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_47decRef(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_46decRef[] = "Object.decRef(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_47decRef(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("decRef (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("decRef", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "decRef", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_46decRef(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_46decRef(struct PyPetscObjectObject *__pyx_v_self) {
PetscObject __pyx_v_obj;
PetscInt __pyx_v_refct;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("decRef", 0);
/* "petsc4py/PETSc/Object.pyx":159
*
* def decRef(self):
* cdef PetscObject obj = self.obj[0] # <<<<<<<<<<<<<<
* cdef PetscInt refct = 0
* if obj != NULL:
*/
__pyx_v_obj = (__pyx_v_self->obj[0]);
/* "petsc4py/PETSc/Object.pyx":160
* def decRef(self):
* cdef PetscObject obj = self.obj[0]
* cdef PetscInt refct = 0 # <<<<<<<<<<<<<<
* if obj != NULL:
* CHKERR( PetscObjectGetReference(obj, &refct) )
*/
__pyx_v_refct = 0;
/* "petsc4py/PETSc/Object.pyx":161
* cdef PetscObject obj = self.obj[0]
* cdef PetscInt refct = 0
* if obj != NULL: # <<<<<<<<<<<<<<
* CHKERR( PetscObjectGetReference(obj, &refct) )
* CHKERR( PetscObjectDereference(obj) )
*/
__pyx_t_1 = ((__pyx_v_obj != NULL) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Object.pyx":162
* cdef PetscInt refct = 0
* if obj != NULL:
* CHKERR( PetscObjectGetReference(obj, &refct) ) # <<<<<<<<<<<<<<
* CHKERR( PetscObjectDereference(obj) )
* if refct == 1: self.obj[0] = NULL
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetReference(__pyx_v_obj, (&__pyx_v_refct))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 162, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":163
* if obj != NULL:
* CHKERR( PetscObjectGetReference(obj, &refct) )
* CHKERR( PetscObjectDereference(obj) ) # <<<<<<<<<<<<<<
* if refct == 1: self.obj[0] = NULL
* refct -= 1
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectDereference(__pyx_v_obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 163, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":164
* CHKERR( PetscObjectGetReference(obj, &refct) )
* CHKERR( PetscObjectDereference(obj) )
* if refct == 1: self.obj[0] = NULL # <<<<<<<<<<<<<<
* refct -= 1
* return (<long>refct)
*/
__pyx_t_1 = ((__pyx_v_refct == 1) != 0);
if (__pyx_t_1) {
(__pyx_v_self->obj[0]) = NULL;
}
/* "petsc4py/PETSc/Object.pyx":165
* CHKERR( PetscObjectDereference(obj) )
* if refct == 1: self.obj[0] = NULL
* refct -= 1 # <<<<<<<<<<<<<<
* return (<long>refct)
*
*/
__pyx_v_refct = (__pyx_v_refct - 1);
/* "petsc4py/PETSc/Object.pyx":161
* cdef PetscObject obj = self.obj[0]
* cdef PetscInt refct = 0
* if obj != NULL: # <<<<<<<<<<<<<<
* CHKERR( PetscObjectGetReference(obj, &refct) )
* CHKERR( PetscObjectDereference(obj) )
*/
}
/* "petsc4py/PETSc/Object.pyx":166
* if refct == 1: self.obj[0] = NULL
* refct -= 1
* return (<long>refct) # <<<<<<<<<<<<<<
*
* def getAttr(self, name):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_From_long(((long)__pyx_v_refct)); if (unlikely(!__pyx_t_3)) __PYX_ERR(34, 166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":158
* return (<long>refct)
*
* def decRef(self): # <<<<<<<<<<<<<<
* cdef PetscObject obj = self.obj[0]
* cdef PetscInt refct = 0
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.decRef", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":168
* return (<long>refct)
*
* def getAttr(self, name): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* name = str2bytes(name, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_49getAttr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_48getAttr[] = "Object.getAttr(self, name)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_49getAttr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getAttr") < 0)) __PYX_ERR(34, 168, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_name = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getAttr", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(34, 168, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.getAttr", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_48getAttr(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_48getAttr(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getAttr", 0);
__Pyx_INCREF(__pyx_v_name);
/* "petsc4py/PETSc/Object.pyx":169
*
* def getAttr(self, name):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cval)
* return self.get_attr(<char*>cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Object.pyx":170
* def getAttr(self, name):
* cdef const char *cval = NULL
* name = str2bytes(name, &cval) # <<<<<<<<<<<<<<
* return self.get_attr(<char*>cval)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":171
* cdef const char *cval = NULL
* name = str2bytes(name, &cval)
* return self.get_attr(<char*>cval) # <<<<<<<<<<<<<<
*
* def setAttr(self, name, attr):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)__pyx_v_self->__pyx_vtab)->get_attr(__pyx_v_self, ((char *)__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":168
* return (<long>refct)
*
* def getAttr(self, name): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* name = str2bytes(name, &cval)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Object.getAttr", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":173
* return self.get_attr(<char*>cval)
*
* def setAttr(self, name, attr): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* name = str2bytes(name, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_51setAttr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_50setAttr[] = "Object.setAttr(self, name, attr)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_51setAttr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_attr = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_attr,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attr)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setAttr", 1, 2, 2, 1); __PYX_ERR(34, 173, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setAttr") < 0)) __PYX_ERR(34, 173, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_name = values[0];
__pyx_v_attr = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setAttr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(34, 173, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.setAttr", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_50setAttr(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name, __pyx_v_attr);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_50setAttr(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_attr) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setAttr", 0);
__Pyx_INCREF(__pyx_v_name);
/* "petsc4py/PETSc/Object.pyx":174
*
* def setAttr(self, name, attr):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cval)
* self.set_attr(<char*>cval, attr)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Object.pyx":175
* def setAttr(self, name, attr):
* cdef const char *cval = NULL
* name = str2bytes(name, &cval) # <<<<<<<<<<<<<<
* self.set_attr(<char*>cval, attr)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":176
* cdef const char *cval = NULL
* name = str2bytes(name, &cval)
* self.set_attr(<char*>cval, attr) # <<<<<<<<<<<<<<
*
* def getDict(self):
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)__pyx_v_self->__pyx_vtab)->set_attr(__pyx_v_self, ((char *)__pyx_v_cval), __pyx_v_attr); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":173
* return self.get_attr(<char*>cval)
*
* def setAttr(self, name, attr): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* name = str2bytes(name, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Object.setAttr", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":178
* self.set_attr(<char*>cval, attr)
*
* def getDict(self): # <<<<<<<<<<<<<<
* return self.get_dict()
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_53getDict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_52getDict[] = "Object.getDict(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_53getDict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDict (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDict", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDict", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_52getDict(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_52getDict(struct PyPetscObjectObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDict", 0);
/* "petsc4py/PETSc/Object.pyx":179
*
* def getDict(self):
* return self.get_dict() # <<<<<<<<<<<<<<
*
* # --- state manipulation ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)__pyx_v_self->__pyx_vtab)->get_dict(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 179, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":178
* self.set_attr(<char*>cval, attr)
*
* def getDict(self): # <<<<<<<<<<<<<<
* return self.get_dict()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Object.getDict", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":182
*
* # --- state manipulation ---
* def stateIncrease(self): # <<<<<<<<<<<<<<
* PetscINCSTATE(self.obj)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_55stateIncrease(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_54stateIncrease[] = "Object.stateIncrease(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_55stateIncrease(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("stateIncrease (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("stateIncrease", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "stateIncrease", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_54stateIncrease(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_54stateIncrease(struct PyPetscObjectObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("stateIncrease", 0);
/* "petsc4py/PETSc/Object.pyx":183
* # --- state manipulation ---
* def stateIncrease(self):
* PetscINCSTATE(self.obj) # <<<<<<<<<<<<<<
*
* def stateGet(self):
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCSTATE(__pyx_v_self->obj));
/* "petsc4py/PETSc/Object.pyx":182
*
* # --- state manipulation ---
* def stateIncrease(self): # <<<<<<<<<<<<<<
* PetscINCSTATE(self.obj)
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":185
* PetscINCSTATE(self.obj)
*
* def stateGet(self): # <<<<<<<<<<<<<<
* cdef PetscObjectState state = 0
* CHKERR( PetscObjectStateGet(self.obj[0], &state) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_57stateGet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_56stateGet[] = "Object.stateGet(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_57stateGet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("stateGet (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("stateGet", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "stateGet", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_56stateGet(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_56stateGet(struct PyPetscObjectObject *__pyx_v_self) {
PetscObjectState __pyx_v_state;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("stateGet", 0);
/* "petsc4py/PETSc/Object.pyx":186
*
* def stateGet(self):
* cdef PetscObjectState state = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscObjectStateGet(self.obj[0], &state) )
* return toInt(state)
*/
__pyx_v_state = 0;
/* "petsc4py/PETSc/Object.pyx":187
* def stateGet(self):
* cdef PetscObjectState state = 0
* CHKERR( PetscObjectStateGet(self.obj[0], &state) ) # <<<<<<<<<<<<<<
* return toInt(state)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectStateGet((__pyx_v_self->obj[0]), (&__pyx_v_state))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 187, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":188
* cdef PetscObjectState state = 0
* CHKERR( PetscObjectStateGet(self.obj[0], &state) )
* return toInt(state) # <<<<<<<<<<<<<<
*
* def stateSet(self, state):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":185
* PetscINCSTATE(self.obj)
*
* def stateGet(self): # <<<<<<<<<<<<<<
* cdef PetscObjectState state = 0
* CHKERR( PetscObjectStateGet(self.obj[0], &state) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Object.stateGet", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":190
* return toInt(state)
*
* def stateSet(self, state): # <<<<<<<<<<<<<<
* cdef PetscObjectState cstate = asInt(state)
* CHKERR( PetscObjectStateSet(self.obj[0], cstate) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_59stateSet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_58stateSet[] = "Object.stateSet(self, state)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_59stateSet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_state = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stateSet") < 0)) __PYX_ERR(34, 190, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_state = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("stateSet", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(34, 190, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.stateSet", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_58stateSet(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_state);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_58stateSet(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_state) {
PetscObjectState __pyx_v_cstate;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("stateSet", 0);
/* "petsc4py/PETSc/Object.pyx":191
*
* def stateSet(self, state):
* cdef PetscObjectState cstate = asInt(state) # <<<<<<<<<<<<<<
* CHKERR( PetscObjectStateSet(self.obj[0], cstate) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_state); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(34, 191, __pyx_L1_error)
__pyx_v_cstate = __pyx_t_1;
/* "petsc4py/PETSc/Object.pyx":192
* def stateSet(self, state):
* cdef PetscObjectState cstate = asInt(state)
* CHKERR( PetscObjectStateSet(self.obj[0], cstate) ) # <<<<<<<<<<<<<<
*
* # --- tab level ---
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectStateSet((__pyx_v_self->obj[0]), __pyx_v_cstate)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 192, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":190
* return toInt(state)
*
* def stateSet(self, state): # <<<<<<<<<<<<<<
* cdef PetscObjectState cstate = asInt(state)
* CHKERR( PetscObjectStateSet(self.obj[0], cstate) )
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.stateSet", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":196
* # --- tab level ---
*
* def incrementTabLevel(self, tab, Object parent=None): # <<<<<<<<<<<<<<
* cdef PetscInt ctab = asInt(tab)
* cdef PetscObject cobj = <PetscObject> NULL if parent is None else parent.obj[0]
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_61incrementTabLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_60incrementTabLevel[] = "Object.incrementTabLevel(self, tab, Object parent=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_61incrementTabLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tab = 0;
struct PyPetscObjectObject *__pyx_v_parent = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tab,&__pyx_n_s_parent,0};
PyObject* values[2] = {0,0};
values[1] = (PyObject *)((struct PyPetscObjectObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tab)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "incrementTabLevel") < 0)) __PYX_ERR(34, 196, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_tab = values[0];
__pyx_v_parent = ((struct PyPetscObjectObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("incrementTabLevel", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(34, 196, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.incrementTabLevel", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "parent", 0))) __PYX_ERR(34, 196, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_60incrementTabLevel(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_tab, __pyx_v_parent);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_60incrementTabLevel(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_tab, struct PyPetscObjectObject *__pyx_v_parent) {
PetscInt __pyx_v_ctab;
PetscObject __pyx_v_cobj;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscObject __pyx_t_2;
int __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("incrementTabLevel", 0);
/* "petsc4py/PETSc/Object.pyx":197
*
* def incrementTabLevel(self, tab, Object parent=None):
* 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(34, 197, __pyx_L1_error)
__pyx_v_ctab = __pyx_t_1;
/* "petsc4py/PETSc/Object.pyx":198
* def incrementTabLevel(self, tab, Object parent=None):
* cdef PetscInt ctab = asInt(tab)
* cdef PetscObject cobj = <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 != 0)) {
__pyx_t_2 = ((PetscObject)NULL);
} else {
__pyx_t_2 = (__pyx_v_parent->obj[0]);
}
__pyx_v_cobj = __pyx_t_2;
/* "petsc4py/PETSc/Object.pyx":199
* cdef PetscInt ctab = asInt(tab)
* cdef PetscObject cobj = <PetscObject> NULL if parent is None else parent.obj[0]
* CHKERR( PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab) ) # <<<<<<<<<<<<<<
*
* def setTabLevel(self, level):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectIncrementTabLevel((__pyx_v_self->obj[0]), __pyx_v_cobj, __pyx_v_ctab)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 199, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":196
* # --- tab level ---
*
* def incrementTabLevel(self, tab, Object parent=None): # <<<<<<<<<<<<<<
* cdef PetscInt ctab = asInt(tab)
* cdef PetscObject cobj = <PetscObject> NULL if parent is None else parent.obj[0]
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.incrementTabLevel", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":201
* CHKERR( PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab) )
*
* def setTabLevel(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_63setTabLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_62setTabLevel[] = "Object.setTabLevel(self, level)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_63setTabLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTabLevel") < 0)) __PYX_ERR(34, 201, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_level = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setTabLevel", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(34, 201, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.setTabLevel", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_62setTabLevel(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_level);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_62setTabLevel(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_level) {
PetscInt __pyx_v_clevel;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setTabLevel", 0);
/* "petsc4py/PETSc/Object.pyx":202
*
* def setTabLevel(self, level):
* cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<<
* CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(34, 202, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/Object.pyx":203
* def setTabLevel(self, level):
* cdef PetscInt clevel = asInt(level)
* CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) ) # <<<<<<<<<<<<<<
*
* def getTabLevel(self):
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectSetTabLevel((__pyx_v_self->obj[0]), __pyx_v_clevel)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 203, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":201
* CHKERR( PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab) )
*
* def setTabLevel(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) )
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Object.setTabLevel", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":205
* CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) )
*
* def getTabLevel(self): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = 0
* CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_65getTabLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Object_64getTabLevel[] = "Object.getTabLevel(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_65getTabLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getTabLevel (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getTabLevel", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTabLevel", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_64getTabLevel(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_64getTabLevel(struct PyPetscObjectObject *__pyx_v_self) {
PetscInt __pyx_v_clevel;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getTabLevel", 0);
/* "petsc4py/PETSc/Object.pyx":206
*
* def getTabLevel(self):
* cdef PetscInt clevel = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) )
* return toInt(clevel)
*/
__pyx_v_clevel = 0;
/* "petsc4py/PETSc/Object.pyx":207
* def getTabLevel(self):
* cdef PetscInt clevel = 0
* CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) ) # <<<<<<<<<<<<<<
* return toInt(clevel)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetTabLevel((__pyx_v_self->obj[0]), (&__pyx_v_clevel))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(34, 207, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":208
* cdef PetscInt clevel = 0
* CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) )
* return toInt(clevel) # <<<<<<<<<<<<<<
*
* # --- properties ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_clevel); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 208, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":205
* CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) )
*
* def getTabLevel(self): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = 0
* CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Object.getTabLevel", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":213
*
* property type:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getType()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4type_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4type___get__(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4type___get__(struct PyPetscObjectObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Object.pyx":214
* property type:
* def __get__(self):
* return self.getType() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setType(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getType); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 214, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 214, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":213
*
* property type:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getType()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":215
* def __get__(self):
* return self.getType()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setType(value)
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_6Object_4type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_6Object_4type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4type_2__set__(((struct PyPetscObjectObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_6Object_4type_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Object.pyx":216
* return self.getType()
* def __set__(self, value):
* self.setType(value) # <<<<<<<<<<<<<<
*
* property prefix:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setType); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":215
* def __get__(self):
* return self.getType()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setType(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":219
*
* property prefix:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getOptionsPrefix()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_6prefix_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_6prefix_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_6prefix___get__(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_6prefix___get__(struct PyPetscObjectObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Object.pyx":220
* property prefix:
* def __get__(self):
* return self.getOptionsPrefix() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setOptionsPrefix(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOptionsPrefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 220, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 220, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":219
*
* property prefix:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getOptionsPrefix()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.prefix.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":221
* def __get__(self):
* return self.getOptionsPrefix()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setOptionsPrefix(value)
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_6Object_6prefix_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_6Object_6prefix_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_6prefix_2__set__(((struct PyPetscObjectObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_6Object_6prefix_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Object.pyx":222
* return self.getOptionsPrefix()
* def __set__(self, value):
* self.setOptionsPrefix(value) # <<<<<<<<<<<<<<
*
* property comm:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setOptionsPrefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 222, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 222, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":221
* def __get__(self):
* return self.getOptionsPrefix()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setOptionsPrefix(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.prefix.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":225
*
* property comm:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getComm()
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4comm_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4comm_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4comm___get__(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4comm___get__(struct PyPetscObjectObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Object.pyx":226
* property comm:
* def __get__(self):
* return self.getComm() # <<<<<<<<<<<<<<
*
* property name:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getComm); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":225
*
* property comm:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getComm()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.comm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":229
*
* property name:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getName()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4name_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4name___get__(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4name___get__(struct PyPetscObjectObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Object.pyx":230
* property name:
* def __get__(self):
* return self.getName() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setName(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getName); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":229
*
* property name:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getName()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":231
* def __get__(self):
* return self.getName()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setName(value)
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_6Object_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_6Object_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4name_2__set__(((struct PyPetscObjectObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_6Object_4name_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Object.pyx":232
* return self.getName()
* def __set__(self, value):
* self.setName(value) # <<<<<<<<<<<<<<
*
* property classid:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setName); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 232, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 232, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":231
* def __get__(self):
* return self.getName()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setName(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":235
*
* property classid:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getClassId()
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_7classid_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_7classid_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_7classid___get__(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_7classid___get__(struct PyPetscObjectObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Object.pyx":236
* property classid:
* def __get__(self):
* return self.getClassId() # <<<<<<<<<<<<<<
*
* property klass:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getClassId); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 236, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 236, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":235
*
* property classid:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getClassId()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.classid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":239
*
* property klass:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getClassName()
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_5klass_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_5klass_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_5klass___get__(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_5klass___get__(struct PyPetscObjectObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Object.pyx":240
* property klass:
* def __get__(self):
* return self.getClassName() # <<<<<<<<<<<<<<
*
* property refcount:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getClassName); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 240, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 240, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":239
*
* property klass:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getClassName()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.klass.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":243
*
* property refcount:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getRefCount()
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_8refcount_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_8refcount_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_8refcount___get__(((struct PyPetscObjectObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_8refcount___get__(struct PyPetscObjectObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Object.pyx":244
* property refcount:
* def __get__(self):
* return self.getRefCount() # <<<<<<<<<<<<<<
*
* # --- ctypes support ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getRefCount); if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":243
*
* property refcount:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getRefCount()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Object.refcount.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":249
*
* property handle:
* def __get__(self): # <<<<<<<<<<<<<<
* cdef PetscObject obj = self.obj[0]
* return PyLong_FromVoidPtr(<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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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":250
* property handle:
* def __get__(self):
* cdef PetscObject obj = self.obj[0] # <<<<<<<<<<<<<<
* return PyLong_FromVoidPtr(<void*>obj)
*
*/
__pyx_v_obj = (__pyx_v_self->obj[0]);
/* "petsc4py/PETSc/Object.pyx":251
* def __get__(self):
* cdef PetscObject obj = self.obj[0]
* return PyLong_FromVoidPtr(<void*>obj) # <<<<<<<<<<<<<<
*
* # --- Fortran support ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyLong_FromVoidPtr(((void *)__pyx_v_obj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 251, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":249
*
* property handle:
* def __get__(self): # <<<<<<<<<<<<<<
* cdef PetscObject obj = self.obj[0]
* return PyLong_FromVoidPtr(<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":256
*
* property fortran:
* def __get__(self): # <<<<<<<<<<<<<<
* cdef PetscObject obj = self.obj[0]
* return Object_toFortran(obj)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_7fortran_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_7fortran_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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
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":257
* property fortran:
* def __get__(self):
* cdef PetscObject obj = self.obj[0] # <<<<<<<<<<<<<<
* return Object_toFortran(obj)
*
*/
__pyx_v_obj = (__pyx_v_self->obj[0]);
/* "petsc4py/PETSc/Object.pyx":258
* def __get__(self):
* cdef PetscObject obj = self.obj[0]
* return Object_toFortran(obj) # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyInt_FromSsize_t(__pyx_f_8petsc4py_5PETSc_Object_toFortran(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":256
*
* property fortran:
* def __get__(self): # <<<<<<<<<<<<<<
* cdef PetscObject obj = self.obj[0]
* return Object_toFortran(obj)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Object.fortran.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/cyclicgc.pxi":22
* PetscErrorCode PetscGarbageView(MPI_Comm,PetscViewer);
*
* cdef int tp_traverse(PyObject *o, visitproc visit, void *arg): # <<<<<<<<<<<<<<
* ## printf("%s.tp_traverse(%p)\n", Py_TYPE(o).tp_name, <void*>o)
* cdef PetscObject p = (<Object>o).obj[0]
*/
static int __pyx_f_8petsc4py_5PETSc_tp_traverse(PyObject *__pyx_v_o, visitproc __pyx_v_visit, void *__pyx_v_arg) {
PetscObject __pyx_v_p;
PyObject *__pyx_v_d;
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("tp_traverse", 0);
/* "petsc4py/PETSc/cyclicgc.pxi":24
* cdef int tp_traverse(PyObject *o, visitproc visit, void *arg):
* ## printf("%s.tp_traverse(%p)\n", Py_TYPE(o).tp_name, <void*>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":25
* ## printf("%s.tp_traverse(%p)\n", Py_TYPE(o).tp_name, <void*>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) != 0);
if (__pyx_t_1) {
__pyx_r = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/cyclicgc.pxi":26
* cdef PetscObject p = (<Object>o).obj[0]
* if p == NULL: return 0
* cdef PyObject *d = <PyObject*>p.python_context # <<<<<<<<<<<<<<
* if d == NULL: return 0
* return visit(d, arg)
*/
__pyx_v_d = ((PyObject *)__pyx_v_p->python_context);
/* "petsc4py/PETSc/cyclicgc.pxi":27
* if p == NULL: return 0
* cdef PyObject *d = <PyObject*>p.python_context
* if d == NULL: return 0 # <<<<<<<<<<<<<<
* return visit(d, arg)
*
*/
__pyx_t_1 = ((__pyx_v_d == NULL) != 0);
if (__pyx_t_1) {
__pyx_r = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/cyclicgc.pxi":28
* cdef PyObject *d = <PyObject*>p.python_context
* if d == NULL: return 0
* return visit(d, arg) # <<<<<<<<<<<<<<
*
* cdef int tp_clear(PyObject *o):
*/
__pyx_r = __pyx_v_visit(__pyx_v_d, __pyx_v_arg);
goto __pyx_L0;
/* "petsc4py/PETSc/cyclicgc.pxi":22
* PetscErrorCode PetscGarbageView(MPI_Comm,PetscViewer);
*
* cdef int tp_traverse(PyObject *o, visitproc visit, void *arg): # <<<<<<<<<<<<<<
* ## printf("%s.tp_traverse(%p)\n", Py_TYPE(o).tp_name, <void*>o)
* cdef PetscObject p = (<Object>o).obj[0]
*/
/* function exit code */
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/cyclicgc.pxi":30
* return visit(d, arg)
*
* cdef int tp_clear(PyObject *o): # <<<<<<<<<<<<<<
* ## printf("%s.tp_clear(%p)\n", Py_TYPE(o).tp_name, <void*>o)
* cdef PetscObject *p = (<Object>o).obj
*/
static int __pyx_f_8petsc4py_5PETSc_tp_clear(PyObject *__pyx_v_o) {
PetscObject *__pyx_v_p;
int __pyx_r;
__Pyx_RefNannyDeclarations
PetscObject *__pyx_t_1;
__Pyx_RefNannySetupContext("tp_clear", 0);
/* "petsc4py/PETSc/cyclicgc.pxi":32
* cdef int tp_clear(PyObject *o):
* ## printf("%s.tp_clear(%p)\n", Py_TYPE(o).tp_name, <void*>o)
* 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":33
* ## printf("%s.tp_clear(%p)\n", Py_TYPE(o).tp_name, <void*>o)
* cdef PetscObject *p = (<Object>o).obj
* PetscDEALLOC(p) # <<<<<<<<<<<<<<
* return 0
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscDEALLOC(__pyx_v_p));
/* "petsc4py/PETSc/cyclicgc.pxi":34
* cdef PetscObject *p = (<Object>o).obj
* PetscDEALLOC(p)
* return 0 # <<<<<<<<<<<<<<
*
* cdef inline void TypeEnableGC(PyTypeObject *t):
*/
__pyx_r = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/cyclicgc.pxi":30
* return visit(d, arg)
*
* cdef int tp_clear(PyObject *o): # <<<<<<<<<<<<<<
* ## printf("%s.tp_clear(%p)\n", Py_TYPE(o).tp_name, <void*>o)
* cdef PetscObject *p = (<Object>o).obj
*/
/* function exit code */
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/cyclicgc.pxi":36
* return 0
*
* cdef inline void TypeEnableGC(PyTypeObject *t): # <<<<<<<<<<<<<<
* ## printf("%s: enforcing GC support\n", t.tp_name)
* t.tp_traverse = tp_traverse
*/
static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_TypeEnableGC(PyTypeObject *__pyx_v_t) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("TypeEnableGC", 0);
/* "petsc4py/PETSc/cyclicgc.pxi":38
* cdef inline void TypeEnableGC(PyTypeObject *t):
* ## printf("%s: enforcing GC support\n", t.tp_name)
* t.tp_traverse = tp_traverse # <<<<<<<<<<<<<<
* t.tp_clear = tp_clear
*
*/
__pyx_v_t->tp_traverse = __pyx_f_8petsc4py_5PETSc_tp_traverse;
/* "petsc4py/PETSc/cyclicgc.pxi":39
* ## printf("%s: enforcing GC support\n", t.tp_name)
* t.tp_traverse = tp_traverse
* t.tp_clear = tp_clear # <<<<<<<<<<<<<<
*
* def garbage_cleanup(comm=None):
*/
__pyx_v_t->tp_clear = __pyx_f_8petsc4py_5PETSc_tp_clear;
/* "petsc4py/PETSc/cyclicgc.pxi":36
* return 0
*
* cdef inline void TypeEnableGC(PyTypeObject *t): # <<<<<<<<<<<<<<
* ## printf("%s: enforcing GC support\n", t.tp_name)
* t.tp_traverse = tp_traverse
*/
/* function exit code */
__Pyx_RefNannyFinishContext();
}
/* "petsc4py/PETSc/cyclicgc.pxi":41
* t.tp_clear = tp_clear
*
* def garbage_cleanup(comm=None): # <<<<<<<<<<<<<<
* """Cleans up unused PETSc objects on the communicator `comm`. If no
* communicator is provided first clean up on PETSC_COMM_WORLD, then
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_1garbage_cleanup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_garbage_cleanup[] = "garbage_cleanup(comm=None)\nCleans up unused PETSc objects on the communicator `comm`. If no\n communicator is provided first clean up on PETSC_COMM_WORLD, then\n clean up on PETSC_COMM_SELF.\n\n Optional argument `comm=None`.\n\n No return value.\n ";
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_1garbage_cleanup = {"garbage_cleanup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_1garbage_cleanup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_garbage_cleanup};
static PyObject *__pyx_pw_8petsc4py_5PETSc_1garbage_cleanup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "garbage_cleanup") < 0)) __PYX_ERR(35, 41, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("garbage_cleanup", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(35, 41, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
MPI_Comm __pyx_t_4;
PetscErrorCode __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("garbage_cleanup", 0);
/* "petsc4py/PETSc/cyclicgc.pxi":50
* No return value.
* """
* if not (<int>PetscInitializeCalled): return # <<<<<<<<<<<<<<
* if (<int>PetscFinalizeCalled): return
* cdef MPI_Comm ccomm
*/
__pyx_t_1 = ((!(((int)PetscInitializeCalled) != 0)) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/cyclicgc.pxi":51
* """
* if not (<int>PetscInitializeCalled): return
* if (<int>PetscFinalizeCalled): return # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm
* 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":53
* if (<int>PetscFinalizeCalled): return
* cdef MPI_Comm ccomm
* if comm is None: # <<<<<<<<<<<<<<
* ccomm = GetComm(COMM_WORLD, MPI_COMM_NULL)
* CHKERR( PetscGarbageCleanup(ccomm) )
*/
__pyx_t_1 = (__pyx_v_comm == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/cyclicgc.pxi":54
* cdef MPI_Comm ccomm
* if comm is None:
* ccomm = GetComm(COMM_WORLD, MPI_COMM_NULL) # <<<<<<<<<<<<<<
* CHKERR( PetscGarbageCleanup(ccomm) )
* ccomm = GetComm(COMM_SELF, MPI_COMM_NULL)
*/
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_COMM_WORLD); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 54, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_GetComm(__pyx_t_3, MPI_COMM_NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 54, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_ccomm = __pyx_t_4;
/* "petsc4py/PETSc/cyclicgc.pxi":55
* if comm is None:
* ccomm = GetComm(COMM_WORLD, MPI_COMM_NULL)
* CHKERR( PetscGarbageCleanup(ccomm) ) # <<<<<<<<<<<<<<
* ccomm = GetComm(COMM_SELF, MPI_COMM_NULL)
* CHKERR( PetscGarbageCleanup(ccomm) )
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGarbageCleanup(__pyx_v_ccomm)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 55, __pyx_L1_error)
/* "petsc4py/PETSc/cyclicgc.pxi":56
* ccomm = GetComm(COMM_WORLD, MPI_COMM_NULL)
* CHKERR( PetscGarbageCleanup(ccomm) )
* ccomm = GetComm(COMM_SELF, MPI_COMM_NULL) # <<<<<<<<<<<<<<
* CHKERR( PetscGarbageCleanup(ccomm) )
* else:
*/
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_COMM_SELF); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 56, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_GetComm(__pyx_t_3, MPI_COMM_NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 56, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_ccomm = __pyx_t_4;
/* "petsc4py/PETSc/cyclicgc.pxi":57
* CHKERR( PetscGarbageCleanup(ccomm) )
* ccomm = GetComm(COMM_SELF, MPI_COMM_NULL)
* CHKERR( PetscGarbageCleanup(ccomm) ) # <<<<<<<<<<<<<<
* else:
* ccomm = GetComm(comm, MPI_COMM_NULL)
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGarbageCleanup(__pyx_v_ccomm)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 57, __pyx_L1_error)
/* "petsc4py/PETSc/cyclicgc.pxi":53
* if (<int>PetscFinalizeCalled): return
* cdef MPI_Comm ccomm
* if comm is None: # <<<<<<<<<<<<<<
* ccomm = GetComm(COMM_WORLD, MPI_COMM_NULL)
* CHKERR( PetscGarbageCleanup(ccomm) )
*/
goto __pyx_L5;
}
/* "petsc4py/PETSc/cyclicgc.pxi":59
* CHKERR( PetscGarbageCleanup(ccomm) )
* else:
* ccomm = GetComm(comm, MPI_COMM_NULL) # <<<<<<<<<<<<<<
* if ccomm == MPI_COMM_NULL:
* raise ValueError("null communicator")
*/
/*else*/ {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_GetComm(__pyx_v_comm, MPI_COMM_NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 59, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_4;
/* "petsc4py/PETSc/cyclicgc.pxi":60
* else:
* ccomm = GetComm(comm, MPI_COMM_NULL)
* if ccomm == MPI_COMM_NULL: # <<<<<<<<<<<<<<
* raise ValueError("null communicator")
* CHKERR( PetscGarbageCleanup(ccomm) )
*/
__pyx_t_2 = ((__pyx_v_ccomm == MPI_COMM_NULL) != 0);
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/cyclicgc.pxi":61
* ccomm = GetComm(comm, MPI_COMM_NULL)
* if ccomm == MPI_COMM_NULL:
* raise ValueError("null communicator") # <<<<<<<<<<<<<<
* CHKERR( PetscGarbageCleanup(ccomm) )
*
*/
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 61, __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, 61, __pyx_L1_error)
/* "petsc4py/PETSc/cyclicgc.pxi":60
* else:
* ccomm = GetComm(comm, MPI_COMM_NULL)
* if ccomm == MPI_COMM_NULL: # <<<<<<<<<<<<<<
* raise ValueError("null communicator")
* CHKERR( PetscGarbageCleanup(ccomm) )
*/
}
/* "petsc4py/PETSc/cyclicgc.pxi":62
* if ccomm == MPI_COMM_NULL:
* raise ValueError("null communicator")
* CHKERR( PetscGarbageCleanup(ccomm) ) # <<<<<<<<<<<<<<
*
* def garbage_view(comm=None):
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGarbageCleanup(__pyx_v_ccomm)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 62, __pyx_L1_error)
}
__pyx_L5:;
/* "petsc4py/PETSc/cyclicgc.pxi":41
* t.tp_clear = tp_clear
*
* def garbage_cleanup(comm=None): # <<<<<<<<<<<<<<
* """Cleans up unused PETSc objects on the communicator `comm`. If no
* communicator is provided first clean up on PETSC_COMM_WORLD, then
*/
/* 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.garbage_cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/cyclicgc.pxi":64
* CHKERR( PetscGarbageCleanup(ccomm) )
*
* def garbage_view(comm=None): # <<<<<<<<<<<<<<
* """Prints out summary of the unused PETSc objects on each rank of
* the communicator `comm`. If no communicator is provided then
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3garbage_view(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2garbage_view[] = "garbage_view(comm=None)\nPrints out summary of the unused PETSc objects on each rank of\n the communicator `comm`. If no communicator is provided then\n PETSC_COMM_WORLD is used.\n\n Optional argument `comm=None`.\n\n No return value.\n ";
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3garbage_view = {"garbage_view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3garbage_view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2garbage_view};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3garbage_view(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "garbage_view") < 0)) __PYX_ERR(35, 64, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("garbage_view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(35, 64, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
MPI_Comm __pyx_t_4;
PetscErrorCode __pyx_t_5;
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":73
* No return value.
* """
* if not (<int>PetscInitializeCalled): return # <<<<<<<<<<<<<<
* if (<int>PetscFinalizeCalled): return
* cdef MPI_Comm ccomm
*/
__pyx_t_1 = ((!(((int)PetscInitializeCalled) != 0)) != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/cyclicgc.pxi":74
* """
* if not (<int>PetscInitializeCalled): return
* if (<int>PetscFinalizeCalled): return # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm
* 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":76
* if (<int>PetscFinalizeCalled): return
* cdef MPI_Comm ccomm
* if comm is None: # <<<<<<<<<<<<<<
* comm = COMM_WORLD
* ccomm = GetComm(comm, MPI_COMM_NULL)
*/
__pyx_t_1 = (__pyx_v_comm == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/cyclicgc.pxi":77
* cdef MPI_Comm ccomm
* if comm is None:
* comm = COMM_WORLD # <<<<<<<<<<<<<<
* ccomm = GetComm(comm, MPI_COMM_NULL)
* if ccomm == MPI_COMM_NULL:
*/
__Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_COMM_WORLD); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 77, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_comm, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/cyclicgc.pxi":76
* if (<int>PetscFinalizeCalled): return
* cdef MPI_Comm ccomm
* if comm is None: # <<<<<<<<<<<<<<
* comm = COMM_WORLD
* ccomm = GetComm(comm, MPI_COMM_NULL)
*/
}
/* "petsc4py/PETSc/cyclicgc.pxi":78
* if comm is None:
* comm = COMM_WORLD
* ccomm = GetComm(comm, MPI_COMM_NULL) # <<<<<<<<<<<<<<
* if ccomm == MPI_COMM_NULL:
* raise ValueError("null communicator")
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_GetComm(__pyx_v_comm, MPI_COMM_NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 78, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_4;
/* "petsc4py/PETSc/cyclicgc.pxi":79
* comm = COMM_WORLD
* ccomm = GetComm(comm, MPI_COMM_NULL)
* if ccomm == MPI_COMM_NULL: # <<<<<<<<<<<<<<
* raise ValueError("null communicator")
* CHKERR( PetscGarbageView(ccomm, NULL) )
*/
__pyx_t_2 = ((__pyx_v_ccomm == MPI_COMM_NULL) != 0);
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/cyclicgc.pxi":80
* ccomm = GetComm(comm, MPI_COMM_NULL)
* if ccomm == MPI_COMM_NULL:
* raise ValueError("null communicator") # <<<<<<<<<<<<<<
* CHKERR( PetscGarbageView(ccomm, NULL) )
*
*/
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 80, __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, 80, __pyx_L1_error)
/* "petsc4py/PETSc/cyclicgc.pxi":79
* 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":81
* if ccomm == MPI_COMM_NULL:
* raise ValueError("null communicator")
* CHKERR( PetscGarbageView(ccomm, NULL) ) # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGarbageView(__pyx_v_ccomm, NULL)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 81, __pyx_L1_error)
/* "petsc4py/PETSc/cyclicgc.pxi":64
* CHKERR( PetscGarbageCleanup(ccomm) )
*
* def garbage_view(comm=None): # <<<<<<<<<<<<<<
* """Prints out summary of the unused PETSc objects on each rank of
* the communicator `comm`. If no communicator is provided then
*/
/* 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.garbage_view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_comm);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":267
* __type_registry__ = type_registry
*
* cdef int PyPetscType_Register(int classid, type cls) except -1: # <<<<<<<<<<<<<<
* global type_registry
* cdef object key = <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;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("PyPetscType_Register", 0);
/* "petsc4py/PETSc/Object.pyx":269
* 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_PyInt_From_long(((long)__pyx_v_classid)); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_key = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":270
* global type_registry
* cdef object key = <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":271
* 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":272
* cdef object value = cls
* cdef const char *dummy = NULL
* if key not in type_registry: # <<<<<<<<<<<<<<
* type_registry[key] = cls
* reg_LogClass(str2bytes(cls.__name__, &dummy),
*/
if (unlikely(__pyx_v_8petsc4py_5PETSc_type_registry == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(34, 272, __pyx_L1_error)
}
__pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_key, __pyx_v_8petsc4py_5PETSc_type_registry, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(34, 272, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Object.pyx":273
* cdef const char *dummy = NULL
* if key not in type_registry:
* type_registry[key] = cls # <<<<<<<<<<<<<<
* reg_LogClass(str2bytes(cls.__name__, &dummy),
* <PetscLogClass>classid)
*/
if (unlikely(__pyx_v_8petsc4py_5PETSc_type_registry == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(34, 273, __pyx_L1_error)
}
if (unlikely(PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_type_registry, __pyx_v_key, ((PyObject *)__pyx_v_cls)) < 0)) __PYX_ERR(34, 273, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":274
* if key not in type_registry:
* type_registry[key] = cls
* reg_LogClass(str2bytes(cls.__name__, &dummy), # <<<<<<<<<<<<<<
* <PetscLogClass>classid)
* TypeEnableGC(<PyTypeObject*>cls)
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 274, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_1, (&__pyx_v_dummy)); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 274, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":275
* 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_4, ((PetscClassId)__pyx_v_classid))); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 274, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":276
* 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":272
* cdef object value = cls
* cdef const char *dummy = NULL
* if key not in type_registry: # <<<<<<<<<<<<<<
* type_registry[key] = cls
* reg_LogClass(str2bytes(cls.__name__, &dummy),
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Object.pyx":278
* TypeEnableGC(<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(34, 278, __pyx_L1_error)
}
__pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_8petsc4py_5PETSc_type_registry, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":279
* else:
* value = type_registry[key]
* if cls is not value: # <<<<<<<<<<<<<<
* raise ValueError(
* "key: %d, cannot register: %s, " \
*/
__pyx_t_3 = (__pyx_v_cls != ((PyTypeObject*)__pyx_v_value));
__pyx_t_2 = (__pyx_t_3 != 0);
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/Object.pyx":282
* raise ValueError(
* "key: %d, cannot register: %s, " \
* "already registered: %s" % (key, cls, value)) # <<<<<<<<<<<<<<
* return 0
*
*/
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_key);
__Pyx_GIVEREF(__pyx_v_key);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
__Pyx_INCREF(((PyObject *)__pyx_v_cls));
__Pyx_GIVEREF(((PyObject *)__pyx_v_cls));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_cls));
__Pyx_INCREF(__pyx_v_value);
__Pyx_GIVEREF(__pyx_v_value);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_value);
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_key_d_cannot_register_s_already, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":280
* value = type_registry[key]
* if cls is not value:
* raise ValueError( # <<<<<<<<<<<<<<
* "key: %d, cannot register: %s, " \
* "already registered: %s" % (key, cls, value))
*/
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(34, 280, __pyx_L1_error)
/* "petsc4py/PETSc/Object.pyx":279
* else:
* value = type_registry[key]
* if cls is not value: # <<<<<<<<<<<<<<
* raise ValueError(
* "key: %d, cannot register: %s, " \
*/
}
}
__pyx_L3:;
/* "petsc4py/PETSc/Object.pyx":283
* "key: %d, cannot register: %s, " \
* "already registered: %s" % (key, cls, value))
* return 0 # <<<<<<<<<<<<<<
*
* cdef type PyPetscType_Lookup(int classid):
*/
__pyx_r = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":267
* __type_registry__ = type_registry
*
* cdef int PyPetscType_Register(int classid, type cls) except -1: # <<<<<<<<<<<<<<
* global type_registry
* cdef object key = <long>classid
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("petsc4py.PETSc.PyPetscType_Register", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_key);
__Pyx_XDECREF(__pyx_v_value);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Object.pyx":285
* return 0
*
* cdef type PyPetscType_Lookup(int classid): # <<<<<<<<<<<<<<
* global type_registry
* cdef object key = <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;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("PyPetscType_Lookup", 0);
/* "petsc4py/PETSc/Object.pyx":287
* cdef type PyPetscType_Lookup(int classid):
* global type_registry
* cdef object key = <long>classid # <<<<<<<<<<<<<<
* cdef type cls = Object
* try:
*/
__pyx_t_1 = __Pyx_PyInt_From_long(((long)__pyx_v_classid)); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 287, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_key = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":288
* global type_registry
* cdef object key = <long>classid
* cdef type cls = Object # <<<<<<<<<<<<<<
* try:
* cls = type_registry[key]
*/
__Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object));
__pyx_v_cls = __pyx_ptype_8petsc4py_5PETSc_Object;
/* "petsc4py/PETSc/Object.pyx":289
* cdef object key = <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":290
* cdef type cls = Object
* try:
* cls = type_registry[key] # <<<<<<<<<<<<<<
* except KeyError:
* cls = Object
*/
if (unlikely(__pyx_v_8petsc4py_5PETSc_type_registry == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(34, 290, __pyx_L3_error)
}
__pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_8petsc4py_5PETSc_type_registry, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 290, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(34, 290, __pyx_L3_error)
__Pyx_DECREF_SET(__pyx_v_cls, ((PyTypeObject*)__pyx_t_1));
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Object.pyx":289
* cdef object key = <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":291
* try:
* cls = type_registry[key]
* except KeyError: # <<<<<<<<<<<<<<
* cls = Object
* return cls
*/
__pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
if (__pyx_t_5) {
__Pyx_AddTraceback("petsc4py.PETSc.PyPetscType_Lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(34, 291, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_7);
/* "petsc4py/PETSc/Object.pyx":292
* cls = type_registry[key]
* except KeyError:
* cls = Object # <<<<<<<<<<<<<<
* return cls
*
*/
__Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object));
__Pyx_DECREF_SET(__pyx_v_cls, __pyx_ptype_8petsc4py_5PETSc_Object);
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L4_exception_handled;
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
/* "petsc4py/PETSc/Object.pyx":289
* cdef object key = <long>classid
* cdef type cls = Object
* try: # <<<<<<<<<<<<<<
* cls = type_registry[key]
* except KeyError:
*/
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
goto __pyx_L1_error;
__pyx_L4_exception_handled:;
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
__pyx_L8_try_end:;
}
/* "petsc4py/PETSc/Object.pyx":293
* except KeyError:
* cls = Object
* return cls # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
__Pyx_INCREF(((PyObject *)__pyx_v_cls));
__pyx_r = __pyx_v_cls;
goto __pyx_L0;
/* "petsc4py/PETSc/Object.pyx":285
* return 0
*
* cdef type PyPetscType_Lookup(int classid): # <<<<<<<<<<<<<<
* global type_registry
* cdef object key = <long>classid
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("petsc4py.PETSc.PyPetscType_Lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_key);
__Pyx_XDECREF(__pyx_v_cls);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":93
* #
*
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer___cinit__(((struct PyPetscViewerObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_6Viewer___cinit__(struct PyPetscViewerObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/Viewer.pyx":94
*
* 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":95
* def __cinit__(self):
* self.obj = <PetscObject*> &self.vwr
* self.vwr = NULL # <<<<<<<<<<<<<<
*
* def __call__(self, Object obj):
*/
__pyx_v_self->vwr = NULL;
/* "petsc4py/PETSc/Viewer.pyx":93
* #
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.vwr
* self.vwr = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":97
* self.vwr = NULL
*
* def __call__(self, Object obj): # <<<<<<<<<<<<<<
* assert obj.obj != NULL
* CHKERR( PetscObjectView(obj.obj[0], self.vwr) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(36, 97, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_obj = ((struct PyPetscObjectObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 97, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8petsc4py_5PETSc_Object, 0, "obj", 0))) __PYX_ERR(36, 97, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_2__call__(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_obj);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__call__", 0);
/* "petsc4py/PETSc/Viewer.pyx":98
*
* def __call__(self, Object obj):
* assert obj.obj != NULL # <<<<<<<<<<<<<<
* CHKERR( PetscObjectView(obj.obj[0], self.vwr) )
*
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(__pyx_assertions_enabled())) {
if (unlikely(!((__pyx_v_obj->obj != NULL) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(36, 98, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/Viewer.pyx":99
* def __call__(self, Object obj):
* assert obj.obj != NULL
* CHKERR( PetscObjectView(obj.obj[0], self.vwr) ) # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectView((__pyx_v_obj->obj[0]), __pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 99, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":97
* self.vwr = NULL
*
* def __call__(self, Object obj): # <<<<<<<<<<<<<<
* assert obj.obj != NULL
* CHKERR( PetscObjectView(obj.obj[0], self.vwr) )
*/
/* 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":103
* #
*
* def view(self, obj=None): # <<<<<<<<<<<<<<
* if obj is None:
* CHKERR( PetscViewerView(self.vwr, NULL) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_4view[] = "Viewer.view(self, obj=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_obj = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(36, 103, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_obj = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 103, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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;
int __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/Viewer.pyx":104
*
* def view(self, obj=None):
* if obj is None: # <<<<<<<<<<<<<<
* CHKERR( PetscViewerView(self.vwr, NULL) )
* elif isinstance(obj, Viewer):
*/
__pyx_t_1 = (__pyx_v_obj == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Viewer.pyx":105
* def view(self, obj=None):
* if obj is None:
* CHKERR( PetscViewerView(self.vwr, NULL) ) # <<<<<<<<<<<<<<
* elif isinstance(obj, Viewer):
* CHKERR( PetscViewerView(self.vwr, (<Viewer?>obj).vwr) )
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerView(__pyx_v_self->vwr, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 105, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":104
*
* def view(self, obj=None):
* if obj is None: # <<<<<<<<<<<<<<
* CHKERR( PetscViewerView(self.vwr, NULL) )
* elif isinstance(obj, Viewer):
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Viewer.pyx":106
* if obj is None:
* CHKERR( PetscViewerView(self.vwr, NULL) )
* elif isinstance(obj, Viewer): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerView(self.vwr, (<Viewer?>obj).vwr) )
* else:
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_8petsc4py_5PETSc_Viewer);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Viewer.pyx":107
* 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_ptype_8petsc4py_5PETSc_Viewer)))) __PYX_ERR(36, 107, __pyx_L1_error)
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerView(__pyx_v_self->vwr, ((struct PyPetscViewerObject *)__pyx_v_obj)->vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 107, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":106
* 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":109
* 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_ptype_8petsc4py_5PETSc_Object)))) __PYX_ERR(36, 109, __pyx_L1_error)
if (unlikely(!((((struct PyPetscObjectObject *)__pyx_v_obj)->obj != NULL) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(36, 109, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/Viewer.pyx":110
* else:
* assert (<Object?>obj).obj != NULL
* CHKERR( PetscObjectView((<Object?>obj).obj[0], self.vwr) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
if (!(likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_8petsc4py_5PETSc_Object)))) __PYX_ERR(36, 110, __pyx_L1_error)
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectView((((struct PyPetscObjectObject *)__pyx_v_obj)->obj[0]), __pyx_v_self->vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 110, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/Viewer.pyx":103
* #
*
* def view(self, obj=None): # <<<<<<<<<<<<<<
* if obj is None:
* CHKERR( PetscViewerView(self.vwr, NULL) )
*/
/* 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":112
* CHKERR( PetscObjectView((<Object?>obj).obj[0], self.vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerDestroy(&self.vwr) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_6destroy[] = "Viewer.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_6destroy(((struct PyPetscViewerObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_6destroy(struct PyPetscViewerObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/Viewer.pyx":113
*
* def destroy(self):
* 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(36, 113, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":114
* def destroy(self):
* CHKERR( PetscViewerDestroy(&self.vwr) )
* return self # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":112
* CHKERR( PetscObjectView((<Object?>obj).obj[0], self.vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerDestroy(&self.vwr) )
* return self
*/
/* 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":116
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscViewer newvwr = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_8create[] = "Viewer.create(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(36, 116, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 116, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":117
*
* def create(self, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(36, 117, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":118
* def create(self, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr
*/
__pyx_v_newvwr = NULL;
/* "petsc4py/PETSc/Viewer.pyx":119
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<<
* 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(36, 119, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":120
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vwr = __pyx_v_newvwr;
/* "petsc4py/PETSc/Viewer.pyx":121
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr
* return self # <<<<<<<<<<<<<<
*
* def createASCII(self, name, mode=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":116
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscViewer newvwr = NULL
*/
/* 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":123
* return self
*
* def createASCII(self, name, mode=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_11createASCII(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_10createASCII[] = "Viewer.createASCII(self, name, mode=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_11createASCII(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_mode = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createASCII") < 0)) __PYX_ERR(36, 123, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_mode = values[1];
__pyx_v_comm = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createASCII", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 123, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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;
int __pyx_t_4;
PetscFileMode __pyx_t_5;
PetscErrorCode __pyx_t_6;
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":124
*
* def createASCII(self, name, mode=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<<
* cdef const char *cname = NULL
* name = str2bytes(name, &cname)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(36, 124, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":125
* def createASCII(self, name, mode=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cname)
* cdef PetscFileMode cmode = PETSC_FILE_MODE_WRITE
*/
__pyx_v_cname = NULL;
/* "petsc4py/PETSc/Viewer.pyx":126
* 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(36, 126, __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":127
* 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":128
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_5 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(36, 128, __pyx_L1_error)
__pyx_v_cmode = __pyx_t_5;
}
/* "petsc4py/PETSc/Viewer.pyx":129
* cdef PetscFileMode cmode = PETSC_FILE_MODE_WRITE
* if mode is not None: cmode = filemode(mode)
* cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr
*/
__pyx_v_newvwr = NULL;
/* "petsc4py/PETSc/Viewer.pyx":130
* if mode is not None: cmode = filemode(mode)
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<<
* PetscCLEAR(self.obj); self.vwr = newvwr
* CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERASCII) )
*/
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerCreate(__pyx_v_ccomm, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 130, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":131
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<<
* CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERASCII) )
* CHKERR( PetscViewerFileSetMode(self.vwr, cmode) )
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vwr = __pyx_v_newvwr;
/* "petsc4py/PETSc/Viewer.pyx":132
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr
* CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERASCII) ) # <<<<<<<<<<<<<<
* CHKERR( PetscViewerFileSetMode(self.vwr, cmode) )
* CHKERR( PetscViewerFileSetName(self.vwr, cname) )
*/
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetType(__pyx_v_self->vwr, PETSCVIEWERASCII)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 132, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":133
* 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_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetMode(__pyx_v_self->vwr, __pyx_v_cmode)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 133, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":134
* CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERASCII) )
* CHKERR( PetscViewerFileSetMode(self.vwr, cmode) )
* CHKERR( PetscViewerFileSetName(self.vwr, cname) ) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetName(__pyx_v_self->vwr, __pyx_v_cname)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 134, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":135
* CHKERR( PetscViewerFileSetMode(self.vwr, cmode) )
* CHKERR( PetscViewerFileSetName(self.vwr, cname) )
* return self # <<<<<<<<<<<<<<
*
* def createBinary(self, name, mode=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":123
* return self
*
* def createASCII(self, name, mode=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.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":137
* return self
*
* def createBinary(self, name, mode=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_13createBinary(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_12createBinary[] = "Viewer.createBinary(self, name, mode=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_13createBinary(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_mode = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createBinary") < 0)) __PYX_ERR(36, 137, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_mode = values[1];
__pyx_v_comm = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createBinary", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 137, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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":138
*
* def createBinary(self, name, mode=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<<
* cdef const char *cname = NULL
* name = str2bytes(name, &cname)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(36, 138, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":139
* def createBinary(self, name, mode=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cname)
* cdef PetscFileMode cmode = filemode(mode)
*/
__pyx_v_cname = NULL;
/* "petsc4py/PETSc/Viewer.pyx":140
* 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(36, 140, __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":141
* 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(36, 141, __pyx_L1_error)
__pyx_v_cmode = __pyx_t_3;
/* "petsc4py/PETSc/Viewer.pyx":142
* name = str2bytes(name, &cname)
* cdef PetscFileMode cmode = filemode(mode)
* cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscViewerBinaryOpen(ccomm, cname, cmode, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr
*/
__pyx_v_newvwr = NULL;
/* "petsc4py/PETSc/Viewer.pyx":143
* cdef PetscFileMode cmode = filemode(mode)
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerBinaryOpen(ccomm, cname, cmode, &newvwr) ) # <<<<<<<<<<<<<<
* 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(36, 143, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":144
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerBinaryOpen(ccomm, cname, cmode, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vwr = __pyx_v_newvwr;
/* "petsc4py/PETSc/Viewer.pyx":145
* CHKERR( PetscViewerBinaryOpen(ccomm, cname, cmode, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr
* return self # <<<<<<<<<<<<<<
*
* def createMPIIO(self, name, mode=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":137
* return self
*
* def createBinary(self, name, mode=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.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":147
* return self
*
* def createMPIIO(self, name, mode=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_15createMPIIO(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_14createMPIIO[] = "Viewer.createMPIIO(self, name, mode=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_15createMPIIO(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_mode = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createMPIIO") < 0)) __PYX_ERR(36, 147, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_mode = values[1];
__pyx_v_comm = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createMPIIO", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 147, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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":148
*
* def createMPIIO(self, name, mode=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<<
* cdef const char *cname = NULL
* name = str2bytes(name, &cname)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(36, 148, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":149
* def createMPIIO(self, name, mode=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cname)
* cdef PetscFileMode cmode = filemode(mode)
*/
__pyx_v_cname = NULL;
/* "petsc4py/PETSc/Viewer.pyx":150
* 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(36, 150, __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":151
* 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(36, 151, __pyx_L1_error)
__pyx_v_cmode = __pyx_t_3;
/* "petsc4py/PETSc/Viewer.pyx":152
* name = str2bytes(name, &cname)
* cdef PetscFileMode cmode = filemode(mode)
* cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr
*/
__pyx_v_newvwr = NULL;
/* "petsc4py/PETSc/Viewer.pyx":153
* cdef PetscFileMode cmode = filemode(mode)
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<<
* 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(36, 153, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":154
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<<
* CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERBINARY) )
* CHKERR( PetscViewerBinarySetUseMPIIO(self.vwr, PETSC_TRUE) )
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vwr = __pyx_v_newvwr;
/* "petsc4py/PETSc/Viewer.pyx":155
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* 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(36, 155, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":156
* 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(36, 156, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":157
* 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(36, 157, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":158
* 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(36, 158, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":159
* CHKERR( PetscViewerFileSetMode(self.vwr, cmode) )
* CHKERR( PetscViewerFileSetName(self.vwr, cname) )
* return self # <<<<<<<<<<<<<<
*
* def createVTK(self, name, mode=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":147
* return self
*
* def createMPIIO(self, name, mode=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.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":161
* return self
*
* def createVTK(self, name, mode=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_17createVTK(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_16createVTK[] = "Viewer.createVTK(self, name, mode=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_17createVTK(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_mode = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createVTK") < 0)) __PYX_ERR(36, 161, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_mode = values[1];
__pyx_v_comm = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createVTK", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 161, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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":162
*
* def createVTK(self, name, mode=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<<
* cdef const char *cname = NULL
* name = str2bytes(name, &cname)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(36, 162, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":163
* def createVTK(self, name, mode=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cname)
* cdef PetscFileMode cmode = filemode(mode)
*/
__pyx_v_cname = NULL;
/* "petsc4py/PETSc/Viewer.pyx":164
* 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(36, 164, __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":165
* 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(36, 165, __pyx_L1_error)
__pyx_v_cmode = __pyx_t_3;
/* "petsc4py/PETSc/Viewer.pyx":166
* name = str2bytes(name, &cname)
* cdef PetscFileMode cmode = filemode(mode)
* cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr
*/
__pyx_v_newvwr = NULL;
/* "petsc4py/PETSc/Viewer.pyx":167
* cdef PetscFileMode cmode = filemode(mode)
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<<
* 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(36, 167, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":168
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<<
* CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERVTK) )
* CHKERR( PetscViewerFileSetMode(self.vwr, cmode) )
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vwr = __pyx_v_newvwr;
/* "petsc4py/PETSc/Viewer.pyx":169
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* 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(36, 169, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":170
* 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(36, 170, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":171
* 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(36, 171, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":172
* CHKERR( PetscViewerFileSetMode(self.vwr, cmode) )
* CHKERR( PetscViewerFileSetName(self.vwr, cname) )
* return self # <<<<<<<<<<<<<<
*
* def createHDF5(self, name, mode=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":161
* return self
*
* def createVTK(self, name, mode=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.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":174
* return self
*
* def createHDF5(self, name, mode=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_19createHDF5(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_18createHDF5[] = "Viewer.createHDF5(self, name, mode=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_19createHDF5(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_mode = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createHDF5") < 0)) __PYX_ERR(36, 174, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_mode = values[1];
__pyx_v_comm = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createHDF5", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 174, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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":175
*
* def createHDF5(self, name, mode=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<<
* cdef const char *cname = NULL
* name = str2bytes(name, &cname)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(36, 175, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":176
* def createHDF5(self, name, mode=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cname)
* cdef PetscFileMode cmode = filemode(mode)
*/
__pyx_v_cname = NULL;
/* "petsc4py/PETSc/Viewer.pyx":177
* 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(36, 177, __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":178
* 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(36, 178, __pyx_L1_error)
__pyx_v_cmode = __pyx_t_3;
/* "petsc4py/PETSc/Viewer.pyx":179
* name = str2bytes(name, &cname)
* cdef PetscFileMode cmode = filemode(mode)
* cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr
*/
__pyx_v_newvwr = NULL;
/* "petsc4py/PETSc/Viewer.pyx":180
* cdef PetscFileMode cmode = filemode(mode)
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<<
* 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(36, 180, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":181
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<<
* CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) )
* CHKERR( PetscViewerFileSetMode(self.vwr, cmode) )
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vwr = __pyx_v_newvwr;
/* "petsc4py/PETSc/Viewer.pyx":182
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* 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(36, 182, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":183
* 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(36, 183, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":184
* 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(36, 184, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":185
* CHKERR( PetscViewerFileSetMode(self.vwr, cmode) )
* CHKERR( PetscViewerFileSetName(self.vwr, cname) )
* return self # <<<<<<<<<<<<<<
*
* def createDraw(self, display=None, title=None,
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":174
* return self
*
* def createHDF5(self, name, mode=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.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":187
* return self
*
* def createDraw(self, display=None, title=None, # <<<<<<<<<<<<<<
* position=None, size=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_21createDraw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_20createDraw[] = "Viewer.createDraw(self, display=None, title=None, position=None, size=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_21createDraw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createDraw (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_display,&__pyx_n_s_title,&__pyx_n_s_position,&__pyx_n_s_size,&__pyx_n_s_comm,0};
PyObject* values[5] = {0,0,0,0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
/* "petsc4py/PETSc/Viewer.pyx":188
*
* def createDraw(self, display=None, title=None,
* position=None, size=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cdisplay = NULL
*/
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_display);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_title);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_position);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createDraw") < 0)) __PYX_ERR(36, 187, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_display = values[0];
__pyx_v_title = values[1];
__pyx_v_position = values[2];
__pyx_v_size = values[3];
__pyx_v_comm = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createDraw", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 187, __pyx_L3_error)
__pyx_L3_error:;
__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":187
* return self
*
* def createDraw(self, display=None, title=None, # <<<<<<<<<<<<<<
* position=None, size=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* function exit code */
__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":189
* def createDraw(self, display=None, title=None,
* position=None, size=None, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(36, 189, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":190
* position=None, size=None, comm=None):
* 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":191
* 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":192
* 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(36, 192, __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":193
* 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(36, 193, __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":195
* 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":196
* 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(36, 196, __pyx_L1_error)
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(36, 196, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
} else {
__pyx_t_3 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = __Pyx_PyInt_From_int(PETSC_DECIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(36, 196, __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(36, 196, __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(36, 196, __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 != 0);
if (__pyx_t_5) {
/* "petsc4py/PETSc/Viewer.pyx":197
* 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(36, 197, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_6 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_6);
#else
__pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(36, 197, __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(36, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext;
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(36, 197, __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(36, 197, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(36, 197, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(36, 197, __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":196
* 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":198
* 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(36, 198, __pyx_L1_error)
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(36, 198, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_3) {
} else {
__pyx_t_5 = __pyx_t_3;
goto __pyx_L9_bool_binop_done;
}
__pyx_t_2 = __Pyx_PyInt_From_int(PETSC_DECIDE); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 198, __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(36, 198, __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(36, 198, __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 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Viewer.pyx":199
* 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":200
* 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(36, 200, __pyx_L11_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_6 = PyList_GET_ITEM(sequence, 0);
__pyx_t_4 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_4);
#else
__pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(36, 200, __pyx_L11_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(36, 200, __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(36, 200, __pyx_L11_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
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(36, 200, __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(36, 200, __pyx_L11_error)
__pyx_L18_unpacking_done:;
}
__pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(36, 200, __pyx_L11_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(36, 200, __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":199
* 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":201
* try:
* w, h = size
* except TypeError: # <<<<<<<<<<<<<<
* w = h = size
* cdef PetscViewer newvwr = NULL
*/
__pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
if (__pyx_t_8) {
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.createDraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_2) < 0) __PYX_ERR(36, 201, __pyx_L13_except_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_2);
/* "petsc4py/PETSc/Viewer.pyx":202
* w, h = size
* except TypeError:
* w = h = size # <<<<<<<<<<<<<<
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerDrawOpen(ccomm, cdisplay, ctitle,
*/
__pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(36, 202, __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;
__pyx_L13_except_error:;
/* "petsc4py/PETSc/Viewer.pyx":199
* x, y = position
* if size not in (None, PETSC_DECIDE):
* try: # <<<<<<<<<<<<<<
* w, h = size
* except TypeError:
*/
__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":198
* 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":203
* 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":204
* w = h = size
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerDrawOpen(ccomm, cdisplay, ctitle, # <<<<<<<<<<<<<<
* x, y, w, h, &newvwr) )
* 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(36, 204, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":206
* CHKERR( PetscViewerDrawOpen(ccomm, cdisplay, ctitle,
* x, y, w, h, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vwr = __pyx_v_newvwr;
/* "petsc4py/PETSc/Viewer.pyx":207
* x, y, w, h, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr
* return self # <<<<<<<<<<<<<<
*
* def setType(self, vwr_type):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":187
* return self
*
* def createDraw(self, display=None, title=None, # <<<<<<<<<<<<<<
* position=None, size=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* 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":209
* return self
*
* def setType(self, vwr_type): # <<<<<<<<<<<<<<
* cdef PetscViewerType cval = NULL
* vwr_type = str2bytes(vwr_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_23setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_22setType[] = "Viewer.setType(self, vwr_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_23setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vwr_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vwr_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vwr_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(36, 209, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vwr_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 209, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":210
*
* def setType(self, vwr_type):
* cdef PetscViewerType cval = NULL # <<<<<<<<<<<<<<
* vwr_type = str2bytes(vwr_type, &cval)
* CHKERR( PetscViewerSetType(self.vwr, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Viewer.pyx":211
* def setType(self, vwr_type):
* 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(36, 211, __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":212
* cdef PetscViewerType cval = NULL
* vwr_type = str2bytes(vwr_type, &cval)
* CHKERR( PetscViewerSetType(self.vwr, cval) ) # <<<<<<<<<<<<<<
*
* def getType(self):
*/
__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(36, 212, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":209
* return self
*
* def setType(self, vwr_type): # <<<<<<<<<<<<<<
* cdef PetscViewerType cval = NULL
* vwr_type = str2bytes(vwr_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":214
* CHKERR( PetscViewerSetType(self.vwr, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscViewerType cval = NULL
* CHKERR( PetscViewerGetType(self.vwr, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_25getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_24getType[] = "Viewer.getType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_25getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_24getType(((struct PyPetscViewerObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_24getType(struct PyPetscViewerObject *__pyx_v_self) {
PetscViewerType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getType", 0);
/* "petsc4py/PETSc/Viewer.pyx":215
*
* def getType(self):
* cdef PetscViewerType cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscViewerGetType(self.vwr, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Viewer.pyx":216
* def getType(self):
* 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(36, 216, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":217
* cdef PetscViewerType cval = NULL
* CHKERR( PetscViewerGetType(self.vwr, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def getFormat(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":214
* CHKERR( PetscViewerSetType(self.vwr, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscViewerType cval = NULL
* CHKERR( PetscViewerGetType(self.vwr, &cval) )
*/
/* 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":219
* return bytes2str(cval)
*
* def getFormat(self): # <<<<<<<<<<<<<<
* cdef PetscViewerFormat format = PETSC_VIEWER_DEFAULT
* CHKERR( PetscViewerGetFormat(self.vwr, &format) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_27getFormat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_26getFormat[] = "Viewer.getFormat(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_27getFormat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFormat (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFormat", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFormat", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_26getFormat(((struct PyPetscViewerObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_26getFormat(struct PyPetscViewerObject *__pyx_v_self) {
PetscViewerFormat __pyx_v_format;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFormat", 0);
/* "petsc4py/PETSc/Viewer.pyx":220
*
* def getFormat(self):
* cdef PetscViewerFormat format = PETSC_VIEWER_DEFAULT # <<<<<<<<<<<<<<
* CHKERR( PetscViewerGetFormat(self.vwr, &format) )
* return format
*/
__pyx_v_format = PETSC_VIEWER_DEFAULT;
/* "petsc4py/PETSc/Viewer.pyx":221
* def getFormat(self):
* 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(36, 221, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":222
* cdef PetscViewerFormat format = PETSC_VIEWER_DEFAULT
* CHKERR( PetscViewerGetFormat(self.vwr, &format) )
* return format # <<<<<<<<<<<<<<
*
* def pushFormat(self, format):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_PetscViewerFormat(__pyx_v_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 222, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":219
* return bytes2str(cval)
*
* def getFormat(self): # <<<<<<<<<<<<<<
* cdef PetscViewerFormat format = PETSC_VIEWER_DEFAULT
* CHKERR( PetscViewerGetFormat(self.vwr, &format) )
*/
/* 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":224
* return format
*
* def pushFormat(self, format): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerPushFormat(self.vwr, format) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_29pushFormat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_28pushFormat[] = "Viewer.pushFormat(self, format)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_29pushFormat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_format = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_format,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pushFormat") < 0)) __PYX_ERR(36, 224, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_format = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("pushFormat", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 224, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.pushFormat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_28pushFormat(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_format);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_28pushFormat(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_format) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscViewerFormat __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pushFormat", 0);
/* "petsc4py/PETSc/Viewer.pyx":225
*
* def pushFormat(self, format):
* CHKERR( PetscViewerPushFormat(self.vwr, format) ) # <<<<<<<<<<<<<<
*
* def popFormat(self):
*/
__pyx_t_1 = ((PetscViewerFormat)__Pyx_PyInt_As_PetscViewerFormat(__pyx_v_format)); if (unlikely(PyErr_Occurred())) __PYX_ERR(36, 225, __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(36, 225, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":224
* return format
*
* def pushFormat(self, format): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerPushFormat(self.vwr, format) )
*
*/
/* 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":227
* CHKERR( PetscViewerPushFormat(self.vwr, format) )
*
* def popFormat(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerPopFormat(self.vwr) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_31popFormat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_30popFormat[] = "Viewer.popFormat(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_31popFormat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("popFormat (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("popFormat", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popFormat", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_30popFormat(((struct PyPetscViewerObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_30popFormat(struct PyPetscViewerObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("popFormat", 0);
/* "petsc4py/PETSc/Viewer.pyx":228
*
* def popFormat(self):
* CHKERR( PetscViewerPopFormat(self.vwr) ) # <<<<<<<<<<<<<<
*
* def getSubViewer(self, comm = None):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerPopFormat(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 228, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":227
* CHKERR( PetscViewerPushFormat(self.vwr, format) )
*
* def popFormat(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerPopFormat(self.vwr) )
*
*/
/* 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":230
* CHKERR( PetscViewerPopFormat(self.vwr) )
*
* def getSubViewer(self, comm = None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF)
* cdef Viewer sub = Viewer()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_33getSubViewer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_32getSubViewer[] = "Viewer.getSubViewer(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_33getSubViewer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getSubViewer") < 0)) __PYX_ERR(36, 230, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getSubViewer", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 230, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.getSubViewer", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_32getSubViewer(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_32getSubViewer(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_comm) {
MPI_Comm __pyx_v_ccomm;
struct PyPetscViewerObject *__pyx_v_sub = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getSubViewer", 0);
/* "petsc4py/PETSc/Viewer.pyx":231
*
* def getSubViewer(self, comm = None):
* 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(PyErr_Occurred())) __PYX_ERR(36, 231, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":232
* def getSubViewer(self, comm = None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF)
* cdef Viewer sub = Viewer() # <<<<<<<<<<<<<<
* CHKERR( PetscViewerGetSubViewer(self.vwr, ccomm, &sub.vwr) )
* return sub
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 232, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_sub = ((struct PyPetscViewerObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Viewer.pyx":233
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF)
* cdef Viewer sub = Viewer()
* CHKERR( PetscViewerGetSubViewer(self.vwr, ccomm, &sub.vwr) ) # <<<<<<<<<<<<<<
* return sub
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerGetSubViewer(__pyx_v_self->vwr, __pyx_v_ccomm, (&__pyx_v_sub->vwr))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 233, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":234
* cdef Viewer sub = Viewer()
* CHKERR( PetscViewerGetSubViewer(self.vwr, ccomm, &sub.vwr) )
* return sub # <<<<<<<<<<<<<<
*
* def restoreSubViewer(self, Viewer sub):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_sub));
__pyx_r = ((PyObject *)__pyx_v_sub);
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":230
* CHKERR( PetscViewerPopFormat(self.vwr) )
*
* def getSubViewer(self, comm = None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF)
* cdef Viewer sub = Viewer()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.getSubViewer", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_sub);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":236
* return sub
*
* def restoreSubViewer(self, Viewer sub): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(sub.getComm(), PETSC_COMM_SELF)
* CHKERR( PetscViewerRestoreSubViewer(self.vwr, ccomm, &sub.vwr) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_35restoreSubViewer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_34restoreSubViewer[] = "Viewer.restoreSubViewer(self, Viewer sub)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_35restoreSubViewer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_sub = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sub,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sub)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restoreSubViewer") < 0)) __PYX_ERR(36, 236, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_sub = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("restoreSubViewer", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 236, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.restoreSubViewer", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sub), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "sub", 0))) __PYX_ERR(36, 236, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_34restoreSubViewer(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_sub);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_34restoreSubViewer(struct PyPetscViewerObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_sub) {
MPI_Comm __pyx_v_ccomm;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
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":237
*
* def restoreSubViewer(self, Viewer sub):
* cdef MPI_Comm ccomm = def_Comm(sub.getComm(), PETSC_COMM_SELF) # <<<<<<<<<<<<<<
* CHKERR( PetscViewerRestoreSubViewer(self.vwr, ccomm, &sub.vwr) )
*
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sub), __pyx_n_s_getComm); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_t_1, PETSC_COMM_SELF); if (unlikely(PyErr_Occurred())) __PYX_ERR(36, 237, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ccomm = __pyx_t_4;
/* "petsc4py/PETSc/Viewer.pyx":238
* def restoreSubViewer(self, Viewer sub):
* 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(36, 238, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":236
* return sub
*
* def restoreSubViewer(self, Viewer sub): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(sub.getComm(), PETSC_COMM_SELF)
* CHKERR( PetscViewerRestoreSubViewer(self.vwr, ccomm, &sub.vwr) )
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.restoreSubViewer", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":241
*
* @classmethod
* def STDOUT(cls, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_37STDOUT(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_36STDOUT[] = "Viewer.STDOUT(type cls, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_37STDOUT(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STDOUT") < 0)) __PYX_ERR(36, 241, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("STDOUT", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 241, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.STDOUT", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_36STDOUT(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_36STDOUT(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) {
MPI_Comm __pyx_v_ccomm;
struct PyPetscViewerObject *__pyx_v_viewer = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscViewer __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("STDOUT", 0);
/* "petsc4py/PETSc/Viewer.pyx":242
* @classmethod
* def STDOUT(cls, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(36, 242, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":243
* def STDOUT(cls, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer() # <<<<<<<<<<<<<<
* viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm)
* PetscINCREF(viewer.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Viewer.pyx":244
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer()
* viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm) # <<<<<<<<<<<<<<
* PetscINCREF(viewer.obj)
* return viewer
*/
__pyx_t_3 = PETSC_VIEWER_STDOUT_(__pyx_v_ccomm); if (unlikely(__pyx_t_3 == ((PetscViewer)NULL) && PyErr_Occurred())) __PYX_ERR(36, 244, __pyx_L1_error)
__pyx_v_viewer->vwr = __pyx_t_3;
/* "petsc4py/PETSc/Viewer.pyx":245
* cdef Viewer viewer = Viewer()
* viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm)
* PetscINCREF(viewer.obj) # <<<<<<<<<<<<<<
* return viewer
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj));
/* "petsc4py/PETSc/Viewer.pyx":246
* viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm)
* 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":241
*
* @classmethod
* def STDOUT(cls, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.STDOUT", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_viewer);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":249
*
* @classmethod
* def STDERR(cls, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_39STDERR(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_38STDERR[] = "Viewer.STDERR(type cls, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_39STDERR(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STDERR") < 0)) __PYX_ERR(36, 249, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("STDERR", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 249, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.STDERR", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_38STDERR(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_38STDERR(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) {
MPI_Comm __pyx_v_ccomm;
struct PyPetscViewerObject *__pyx_v_viewer = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscViewer __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("STDERR", 0);
/* "petsc4py/PETSc/Viewer.pyx":250
* @classmethod
* def STDERR(cls, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(36, 250, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":251
* def STDERR(cls, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer() # <<<<<<<<<<<<<<
* viewer.vwr = PETSC_VIEWER_STDERR_(ccomm)
* PetscINCREF(viewer.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 251, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Viewer.pyx":252
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer()
* viewer.vwr = PETSC_VIEWER_STDERR_(ccomm) # <<<<<<<<<<<<<<
* PetscINCREF(viewer.obj)
* return viewer
*/
__pyx_t_3 = PETSC_VIEWER_STDERR_(__pyx_v_ccomm); if (unlikely(__pyx_t_3 == ((PetscViewer)NULL) && PyErr_Occurred())) __PYX_ERR(36, 252, __pyx_L1_error)
__pyx_v_viewer->vwr = __pyx_t_3;
/* "petsc4py/PETSc/Viewer.pyx":253
* cdef Viewer viewer = Viewer()
* viewer.vwr = PETSC_VIEWER_STDERR_(ccomm)
* PetscINCREF(viewer.obj) # <<<<<<<<<<<<<<
* return viewer
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj));
/* "petsc4py/PETSc/Viewer.pyx":254
* viewer.vwr = PETSC_VIEWER_STDERR_(ccomm)
* 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":249
*
* @classmethod
* def STDERR(cls, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.STDERR", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_viewer);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":257
*
* @classmethod
* def ASCII(cls, name, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_41ASCII(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_40ASCII[] = "Viewer.ASCII(type cls, name, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_41ASCII(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_comm,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ASCII") < 0)) __PYX_ERR(36, 257, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_comm = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("ASCII", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 257, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.ASCII", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_40ASCII(((PyTypeObject*)__pyx_v_cls), __pyx_v_name, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_40ASCII(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_comm) {
MPI_Comm __pyx_v_ccomm;
char const *__pyx_v_cname;
struct PyPetscViewerObject *__pyx_v_viewer = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("ASCII", 0);
__Pyx_INCREF(__pyx_v_name);
/* "petsc4py/PETSc/Viewer.pyx":258
* @classmethod
* def ASCII(cls, name, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<<
* cdef const char *cname = NULL
* name = str2bytes(name, &cname)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(36, 258, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":259
* def ASCII(cls, name, comm=None):
* 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":260
* 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(36, 260, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Viewer.pyx":261
* cdef const char *cname = NULL
* name = str2bytes(name, &cname)
* cdef Viewer viewer = Viewer() # <<<<<<<<<<<<<<
* CHKERR( PetscViewerASCIIOpen(ccomm, cname, &viewer.vwr) )
* return viewer
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Viewer.pyx":262
* name = str2bytes(name, &cname)
* cdef Viewer viewer = Viewer()
* CHKERR( PetscViewerASCIIOpen(ccomm, cname, &viewer.vwr) ) # <<<<<<<<<<<<<<
* return viewer
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIOpen(__pyx_v_ccomm, __pyx_v_cname, (&__pyx_v_viewer->vwr))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 262, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":263
* 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":257
*
* @classmethod
* def ASCII(cls, name, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.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":266
*
* @classmethod
* def BINARY(cls, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_43BINARY(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_42BINARY[] = "Viewer.BINARY(type cls, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_43BINARY(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "BINARY") < 0)) __PYX_ERR(36, 266, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("BINARY", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 266, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.BINARY", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_42BINARY(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_42BINARY(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) {
MPI_Comm __pyx_v_ccomm;
struct PyPetscViewerObject *__pyx_v_viewer = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscViewer __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("BINARY", 0);
/* "petsc4py/PETSc/Viewer.pyx":267
* @classmethod
* def BINARY(cls, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(36, 267, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":268
* def BINARY(cls, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer() # <<<<<<<<<<<<<<
* viewer.vwr = PETSC_VIEWER_BINARY_(ccomm)
* PetscINCREF(viewer.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Viewer.pyx":269
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer()
* viewer.vwr = PETSC_VIEWER_BINARY_(ccomm) # <<<<<<<<<<<<<<
* PetscINCREF(viewer.obj)
* return viewer
*/
__pyx_t_3 = PETSC_VIEWER_BINARY_(__pyx_v_ccomm); if (unlikely(__pyx_t_3 == ((PetscViewer)NULL) && PyErr_Occurred())) __PYX_ERR(36, 269, __pyx_L1_error)
__pyx_v_viewer->vwr = __pyx_t_3;
/* "petsc4py/PETSc/Viewer.pyx":270
* cdef Viewer viewer = Viewer()
* viewer.vwr = PETSC_VIEWER_BINARY_(ccomm)
* PetscINCREF(viewer.obj) # <<<<<<<<<<<<<<
* return viewer
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj));
/* "petsc4py/PETSc/Viewer.pyx":271
* viewer.vwr = PETSC_VIEWER_BINARY_(ccomm)
* 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":266
*
* @classmethod
* def BINARY(cls, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.BINARY", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_viewer);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":274
*
* @classmethod
* def DRAW(cls, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_45DRAW(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_44DRAW[] = "Viewer.DRAW(type cls, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_45DRAW(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "DRAW") < 0)) __PYX_ERR(36, 274, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("DRAW", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 274, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.DRAW", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_44DRAW(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_44DRAW(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) {
MPI_Comm __pyx_v_ccomm;
struct PyPetscViewerObject *__pyx_v_viewer = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscViewer __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("DRAW", 0);
/* "petsc4py/PETSc/Viewer.pyx":275
* @classmethod
* def DRAW(cls, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(36, 275, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":276
* def DRAW(cls, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer() # <<<<<<<<<<<<<<
* viewer.vwr = PETSC_VIEWER_DRAW_(ccomm)
* PetscINCREF(viewer.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Viewer.pyx":277
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer()
* viewer.vwr = PETSC_VIEWER_DRAW_(ccomm) # <<<<<<<<<<<<<<
* PetscINCREF(viewer.obj)
* return viewer
*/
__pyx_t_3 = PETSC_VIEWER_DRAW_(__pyx_v_ccomm); if (unlikely(__pyx_t_3 == ((PetscViewer)NULL) && PyErr_Occurred())) __PYX_ERR(36, 277, __pyx_L1_error)
__pyx_v_viewer->vwr = __pyx_t_3;
/* "petsc4py/PETSc/Viewer.pyx":278
* cdef Viewer viewer = Viewer()
* viewer.vwr = PETSC_VIEWER_DRAW_(ccomm)
* PetscINCREF(viewer.obj) # <<<<<<<<<<<<<<
* return viewer
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj));
/* "petsc4py/PETSc/Viewer.pyx":279
* viewer.vwr = PETSC_VIEWER_DRAW_(ccomm)
* 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":274
*
* @classmethod
* def DRAW(cls, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef Viewer viewer = Viewer()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.DRAW", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_viewer);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":283
* # --- ASCII viewers ---
*
* def setASCIITab(self, tabs): # <<<<<<<<<<<<<<
* cdef PetscInt ctabs = asInt(tabs)
* CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_47setASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_46setASCIITab[] = "Viewer.setASCIITab(self, tabs)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_47setASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tabs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tabs,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tabs)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setASCIITab") < 0)) __PYX_ERR(36, 283, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_tabs = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setASCIITab", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 283, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.setASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_46setASCIITab(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_tabs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_46setASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs) {
PetscInt __pyx_v_ctabs;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setASCIITab", 0);
/* "petsc4py/PETSc/Viewer.pyx":284
*
* def setASCIITab(self, tabs):
* 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(36, 284, __pyx_L1_error)
__pyx_v_ctabs = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":285
* def setASCIITab(self, tabs):
* cdef PetscInt ctabs = asInt(tabs)
* CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) ) # <<<<<<<<<<<<<<
*
* def getASCIITab(self):
*/
__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(36, 285, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":283
* # --- ASCII viewers ---
*
* def setASCIITab(self, tabs): # <<<<<<<<<<<<<<
* cdef PetscInt ctabs = asInt(tabs)
* CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) )
*/
/* 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":287
* CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) )
*
* def getASCIITab(self): # <<<<<<<<<<<<<<
* cdef PetscInt tabs = 0
* CHKERR( PetscViewerASCIIGetTab(self.vwr, &tabs) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_49getASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_48getASCIITab[] = "Viewer.getASCIITab(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_49getASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getASCIITab (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getASCIITab", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getASCIITab", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_48getASCIITab(((struct PyPetscViewerObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_48getASCIITab(struct PyPetscViewerObject *__pyx_v_self) {
PetscInt __pyx_v_tabs;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getASCIITab", 0);
/* "petsc4py/PETSc/Viewer.pyx":288
*
* def getASCIITab(self):
* cdef PetscInt tabs = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscViewerASCIIGetTab(self.vwr, &tabs) )
* return toInt(tabs)
*/
__pyx_v_tabs = 0;
/* "petsc4py/PETSc/Viewer.pyx":289
* def getASCIITab(self):
* 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(36, 289, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":290
* cdef PetscInt tabs = 0
* CHKERR( PetscViewerASCIIGetTab(self.vwr, &tabs) )
* return toInt(tabs) # <<<<<<<<<<<<<<
*
* def addASCIITab(self, tabs):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_tabs); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 290, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":287
* CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) )
*
* def getASCIITab(self): # <<<<<<<<<<<<<<
* cdef PetscInt tabs = 0
* CHKERR( PetscViewerASCIIGetTab(self.vwr, &tabs) )
*/
/* 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":292
* return toInt(tabs)
*
* def addASCIITab(self, tabs): # <<<<<<<<<<<<<<
* cdef PetscInt ctabs = asInt(tabs)
* CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_51addASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_50addASCIITab[] = "Viewer.addASCIITab(self, tabs)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_51addASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tabs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tabs,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tabs)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addASCIITab") < 0)) __PYX_ERR(36, 292, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_tabs = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("addASCIITab", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 292, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.addASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_50addASCIITab(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_tabs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_50addASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs) {
PetscInt __pyx_v_ctabs;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("addASCIITab", 0);
/* "petsc4py/PETSc/Viewer.pyx":293
*
* def addASCIITab(self, tabs):
* 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(36, 293, __pyx_L1_error)
__pyx_v_ctabs = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":294
* def addASCIITab(self, tabs):
* cdef PetscInt ctabs = asInt(tabs)
* CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) ) # <<<<<<<<<<<<<<
*
* def subtractASCIITab(self, tabs):
*/
__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(36, 294, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":292
* return toInt(tabs)
*
* def addASCIITab(self, tabs): # <<<<<<<<<<<<<<
* cdef PetscInt ctabs = asInt(tabs)
* CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) )
*/
/* 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":296
* CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) )
*
* def subtractASCIITab(self, tabs): # <<<<<<<<<<<<<<
* cdef PetscInt ctabs = asInt(tabs)
* CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_53subtractASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_52subtractASCIITab[] = "Viewer.subtractASCIITab(self, tabs)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_53subtractASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tabs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tabs,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tabs)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "subtractASCIITab") < 0)) __PYX_ERR(36, 296, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_tabs = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("subtractASCIITab", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 296, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.subtractASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_52subtractASCIITab(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_tabs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_52subtractASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs) {
PetscInt __pyx_v_ctabs;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("subtractASCIITab", 0);
/* "petsc4py/PETSc/Viewer.pyx":297
*
* def subtractASCIITab(self, tabs):
* 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(36, 297, __pyx_L1_error)
__pyx_v_ctabs = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":298
* def subtractASCIITab(self, tabs):
* cdef PetscInt ctabs = asInt(tabs)
* CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) ) # <<<<<<<<<<<<<<
*
* def pushASCIISynchronized(self):
*/
__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(36, 298, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":296
* CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) )
*
* def subtractASCIITab(self, tabs): # <<<<<<<<<<<<<<
* cdef PetscInt ctabs = asInt(tabs)
* CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) )
*/
/* 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":300
* CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) )
*
* def pushASCIISynchronized(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerASCIIPushSynchronized(self.vwr) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_55pushASCIISynchronized(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_54pushASCIISynchronized[] = "Viewer.pushASCIISynchronized(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_55pushASCIISynchronized(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pushASCIISynchronized (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("pushASCIISynchronized", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pushASCIISynchronized", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_54pushASCIISynchronized(((struct PyPetscViewerObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_54pushASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pushASCIISynchronized", 0);
/* "petsc4py/PETSc/Viewer.pyx":301
*
* def pushASCIISynchronized(self):
* CHKERR( PetscViewerASCIIPushSynchronized(self.vwr) ) # <<<<<<<<<<<<<<
*
* def popASCIISynchronized(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIPushSynchronized(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 301, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":300
* CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) )
*
* def pushASCIISynchronized(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerASCIIPushSynchronized(self.vwr) )
*
*/
/* 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":303
* CHKERR( PetscViewerASCIIPushSynchronized(self.vwr) )
*
* def popASCIISynchronized(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerASCIIPopSynchronized(self.vwr) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_57popASCIISynchronized(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_56popASCIISynchronized[] = "Viewer.popASCIISynchronized(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_57popASCIISynchronized(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("popASCIISynchronized (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("popASCIISynchronized", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popASCIISynchronized", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_56popASCIISynchronized(((struct PyPetscViewerObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_56popASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("popASCIISynchronized", 0);
/* "petsc4py/PETSc/Viewer.pyx":304
*
* def popASCIISynchronized(self):
* CHKERR( PetscViewerASCIIPopSynchronized(self.vwr) ) # <<<<<<<<<<<<<<
*
* def pushASCIITab(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIPopSynchronized(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 304, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":303
* CHKERR( PetscViewerASCIIPushSynchronized(self.vwr) )
*
* def popASCIISynchronized(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerASCIIPopSynchronized(self.vwr) )
*
*/
/* 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":306
* CHKERR( PetscViewerASCIIPopSynchronized(self.vwr) )
*
* def pushASCIITab(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerASCIIPushTab(self.vwr) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_59pushASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_58pushASCIITab[] = "Viewer.pushASCIITab(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_59pushASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pushASCIITab (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("pushASCIITab", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pushASCIITab", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_58pushASCIITab(((struct PyPetscViewerObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_58pushASCIITab(struct PyPetscViewerObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pushASCIITab", 0);
/* "petsc4py/PETSc/Viewer.pyx":307
*
* def pushASCIITab(self):
* CHKERR( PetscViewerASCIIPushTab(self.vwr) ) # <<<<<<<<<<<<<<
*
* def popASCIITab(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIPushTab(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 307, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":306
* CHKERR( PetscViewerASCIIPopSynchronized(self.vwr) )
*
* def pushASCIITab(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerASCIIPushTab(self.vwr) )
*
*/
/* 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":309
* CHKERR( PetscViewerASCIIPushTab(self.vwr) )
*
* def popASCIITab(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerASCIIPopTab(self.vwr) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_61popASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_60popASCIITab[] = "Viewer.popASCIITab(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_61popASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("popASCIITab (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("popASCIITab", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popASCIITab", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_60popASCIITab(((struct PyPetscViewerObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_60popASCIITab(struct PyPetscViewerObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("popASCIITab", 0);
/* "petsc4py/PETSc/Viewer.pyx":310
*
* def popASCIITab(self):
* CHKERR( PetscViewerASCIIPopTab(self.vwr) ) # <<<<<<<<<<<<<<
*
* def useASCIITabs(self, flag):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIPopTab(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 310, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":309
* CHKERR( PetscViewerASCIIPushTab(self.vwr) )
*
* def popASCIITab(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerASCIIPopTab(self.vwr) )
*
*/
/* 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":312
* CHKERR( PetscViewerASCIIPopTab(self.vwr) )
*
* def useASCIITabs(self, flag): # <<<<<<<<<<<<<<
* cdef PetscBool flg = flag
* CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_63useASCIITabs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_62useASCIITabs[] = "Viewer.useASCIITabs(self, flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_63useASCIITabs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flag = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "useASCIITabs") < 0)) __PYX_ERR(36, 312, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("useASCIITabs", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 312, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.useASCIITabs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_62useASCIITabs(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_flag);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_62useASCIITabs(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_flag) {
PetscBool __pyx_v_flg;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscBool __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("useASCIITabs", 0);
/* "petsc4py/PETSc/Viewer.pyx":313
*
* def useASCIITabs(self, flag):
* cdef PetscBool flg = flag # <<<<<<<<<<<<<<
* CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) )
*
*/
__pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(36, 313, __pyx_L1_error)
__pyx_v_flg = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":314
* def useASCIITabs(self, flag):
* cdef PetscBool flg = flag
* CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) ) # <<<<<<<<<<<<<<
*
* def printfASCII(self, msg):
*/
__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(36, 314, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":312
* CHKERR( PetscViewerASCIIPopTab(self.vwr) )
*
* def useASCIITabs(self, flag): # <<<<<<<<<<<<<<
* cdef PetscBool flg = flag
* CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) )
*/
/* 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":316
* CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) )
*
* def printfASCII(self, msg): # <<<<<<<<<<<<<<
* cdef const char *cmsg = NULL
* msg = str2bytes(msg, &cmsg)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_65printfASCII(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_64printfASCII[] = "Viewer.printfASCII(self, msg)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_65printfASCII(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_msg = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_msg,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msg)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "printfASCII") < 0)) __PYX_ERR(36, 316, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_msg = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("printfASCII", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 316, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.printfASCII", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_64printfASCII(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_msg);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_64printfASCII(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_msg) {
char const *__pyx_v_cmsg;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("printfASCII", 0);
__Pyx_INCREF(__pyx_v_msg);
/* "petsc4py/PETSc/Viewer.pyx":317
*
* def printfASCII(self, msg):
* cdef const char *cmsg = NULL # <<<<<<<<<<<<<<
* msg = str2bytes(msg, &cmsg)
* CHKERR( PetscViewerASCIIPrintf(self.vwr, '%s', cmsg) )
*/
__pyx_v_cmsg = NULL;
/* "petsc4py/PETSc/Viewer.pyx":318
* def printfASCII(self, msg):
* 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(36, 318, __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":319
* cdef const char *cmsg = NULL
* msg = str2bytes(msg, &cmsg)
* CHKERR( PetscViewerASCIIPrintf(self.vwr, '%s', cmsg) ) # <<<<<<<<<<<<<<
*
* def printfASCIISynchronized(self, msg):
*/
__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(36, 319, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":316
* CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) )
*
* def printfASCII(self, msg): # <<<<<<<<<<<<<<
* cdef const char *cmsg = NULL
* msg = str2bytes(msg, &cmsg)
*/
/* 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":321
* CHKERR( PetscViewerASCIIPrintf(self.vwr, '%s', cmsg) )
*
* def printfASCIISynchronized(self, msg): # <<<<<<<<<<<<<<
* cdef const char *cmsg = NULL
* msg = str2bytes(msg, &cmsg)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_67printfASCIISynchronized(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_66printfASCIISynchronized[] = "Viewer.printfASCIISynchronized(self, msg)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_67printfASCIISynchronized(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_msg = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_msg,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msg)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "printfASCIISynchronized") < 0)) __PYX_ERR(36, 321, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_msg = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("printfASCIISynchronized", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 321, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.printfASCIISynchronized", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_66printfASCIISynchronized(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_msg);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_66printfASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_msg) {
char const *__pyx_v_cmsg;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("printfASCIISynchronized", 0);
__Pyx_INCREF(__pyx_v_msg);
/* "petsc4py/PETSc/Viewer.pyx":322
*
* def printfASCIISynchronized(self, msg):
* cdef const char *cmsg = NULL # <<<<<<<<<<<<<<
* msg = str2bytes(msg, &cmsg)
* CHKERR( PetscViewerASCIISynchronizedPrintf(self.vwr, '%s', cmsg) )
*/
__pyx_v_cmsg = NULL;
/* "petsc4py/PETSc/Viewer.pyx":323
* def printfASCIISynchronized(self, msg):
* 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(36, 323, __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":324
* 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(36, 324, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":321
* CHKERR( PetscViewerASCIIPrintf(self.vwr, '%s', cmsg) )
*
* def printfASCIISynchronized(self, msg): # <<<<<<<<<<<<<<
* cdef const char *cmsg = NULL
* msg = str2bytes(msg, &cmsg)
*/
/* 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":328
* # --- methods specific to file viewers ---
*
* def flush(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerFlush(self.vwr) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_69flush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_68flush[] = "Viewer.flush(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_69flush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("flush (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("flush", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "flush", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_68flush(((struct PyPetscViewerObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_68flush(struct PyPetscViewerObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("flush", 0);
/* "petsc4py/PETSc/Viewer.pyx":329
*
* def flush(self):
* CHKERR( PetscViewerFlush(self.vwr) ) # <<<<<<<<<<<<<<
*
* def setFileMode(self, mode):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFlush(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 329, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":328
* # --- methods specific to file viewers ---
*
* def flush(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerFlush(self.vwr) )
*
*/
/* 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":331
* CHKERR( PetscViewerFlush(self.vwr) )
*
* def setFileMode(self, mode): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerFileSetMode(self.vwr, filemode(mode)) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_71setFileMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_70setFileMode[] = "Viewer.setFileMode(self, mode)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_71setFileMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFileMode") < 0)) __PYX_ERR(36, 331, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_mode = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFileMode", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 331, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.setFileMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_70setFileMode(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_70setFileMode(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_mode) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscFileMode __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFileMode", 0);
/* "petsc4py/PETSc/Viewer.pyx":332
*
* def setFileMode(self, mode):
* CHKERR( PetscViewerFileSetMode(self.vwr, filemode(mode)) ) # <<<<<<<<<<<<<<
*
* def getFileMode(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_1 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(36, 332, __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(36, 332, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":331
* CHKERR( PetscViewerFlush(self.vwr) )
*
* def setFileMode(self, mode): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerFileSetMode(self.vwr, filemode(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":334
* CHKERR( PetscViewerFileSetMode(self.vwr, filemode(mode)) )
*
* def getFileMode(self): # <<<<<<<<<<<<<<
* cdef PetscFileMode mode = PETSC_FILE_MODE_READ
* CHKERR( PetscViewerFileGetMode(self.vwr, &mode) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_73getFileMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_72getFileMode[] = "Viewer.getFileMode(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_73getFileMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFileMode (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFileMode", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFileMode", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_72getFileMode(((struct PyPetscViewerObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_72getFileMode(struct PyPetscViewerObject *__pyx_v_self) {
PetscFileMode __pyx_v_mode;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFileMode", 0);
/* "petsc4py/PETSc/Viewer.pyx":335
*
* def getFileMode(self):
* cdef PetscFileMode mode = PETSC_FILE_MODE_READ # <<<<<<<<<<<<<<
* CHKERR( PetscViewerFileGetMode(self.vwr, &mode) )
* return mode
*/
__pyx_v_mode = FILE_MODE_READ;
/* "petsc4py/PETSc/Viewer.pyx":336
* def getFileMode(self):
* 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(36, 336, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":337
* cdef PetscFileMode mode = PETSC_FILE_MODE_READ
* CHKERR( PetscViewerFileGetMode(self.vwr, &mode) )
* return mode # <<<<<<<<<<<<<<
*
* def setFileName(self, name):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_PetscFileMode(__pyx_v_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 337, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":334
* CHKERR( PetscViewerFileSetMode(self.vwr, filemode(mode)) )
*
* def getFileMode(self): # <<<<<<<<<<<<<<
* cdef PetscFileMode mode = PETSC_FILE_MODE_READ
* CHKERR( PetscViewerFileGetMode(self.vwr, &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":339
* return mode
*
* def setFileName(self, name): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* name = str2bytes(name, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_75setFileName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_74setFileName[] = "Viewer.setFileName(self, name)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_75setFileName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFileName") < 0)) __PYX_ERR(36, 339, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_name = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFileName", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 339, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.setFileName", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_74setFileName(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_name);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_74setFileName(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFileName", 0);
__Pyx_INCREF(__pyx_v_name);
/* "petsc4py/PETSc/Viewer.pyx":340
*
* def setFileName(self, name):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cval)
* CHKERR( PetscViewerFileSetName(self.vwr, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Viewer.pyx":341
* def setFileName(self, name):
* 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(36, 341, __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":342
* cdef const char *cval = NULL
* name = str2bytes(name, &cval)
* CHKERR( PetscViewerFileSetName(self.vwr, cval) ) # <<<<<<<<<<<<<<
*
* def getFileName(self):
*/
__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(36, 342, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":339
* return mode
*
* def setFileName(self, name): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* name = str2bytes(name, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":344
* CHKERR( PetscViewerFileSetName(self.vwr, cval) )
*
* def getFileName(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscViewerFileGetName(self.vwr, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_77getFileName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_76getFileName[] = "Viewer.getFileName(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_77getFileName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFileName (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFileName", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFileName", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_76getFileName(((struct PyPetscViewerObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_76getFileName(struct PyPetscViewerObject *__pyx_v_self) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFileName", 0);
/* "petsc4py/PETSc/Viewer.pyx":345
*
* def getFileName(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscViewerFileGetName(self.vwr, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Viewer.pyx":346
* def getFileName(self):
* 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(36, 346, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":347
* 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(36, 347, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":344
* CHKERR( PetscViewerFileSetName(self.vwr, cval) )
*
* def getFileName(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PetscViewerFileGetName(self.vwr, &cval) )
*/
/* 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":351
* # --- methods specific to draw viewers ---
*
* def setDrawInfo(self, display=None, title=None, position=None, size=None): # <<<<<<<<<<<<<<
* cdef const char *cdisplay = NULL
* cdef const char *ctitle = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_79setDrawInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_78setDrawInfo[] = "Viewer.setDrawInfo(self, display=None, title=None, position=None, size=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_79setDrawInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_display = 0;
PyObject *__pyx_v_title = 0;
PyObject *__pyx_v_position = 0;
PyObject *__pyx_v_size = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_display,&__pyx_n_s_title,&__pyx_n_s_position,&__pyx_n_s_size,0};
PyObject* values[4] = {0,0,0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_display);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_title);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_position);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDrawInfo") < 0)) __PYX_ERR(36, 351, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_display = values[0];
__pyx_v_title = values[1];
__pyx_v_position = values[2];
__pyx_v_size = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDrawInfo", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 351, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.setDrawInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_78setDrawInfo(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_display, __pyx_v_title, __pyx_v_position, __pyx_v_size);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_78setDrawInfo(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_display, PyObject *__pyx_v_title, PyObject *__pyx_v_position, PyObject *__pyx_v_size) {
char const *__pyx_v_cdisplay;
char const *__pyx_v_ctitle;
int __pyx_v_x;
int __pyx_v_y;
int __pyx_v_h;
int __pyx_v_w;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *(*__pyx_t_6)(PyObject *);
int __pyx_t_7;
int __pyx_t_8;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PetscErrorCode __pyx_t_12;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setDrawInfo", 0);
__Pyx_INCREF(__pyx_v_display);
__Pyx_INCREF(__pyx_v_title);
/* "petsc4py/PETSc/Viewer.pyx":352
*
* def setDrawInfo(self, display=None, title=None, position=None, size=None):
* cdef const char *cdisplay = NULL # <<<<<<<<<<<<<<
* cdef const char *ctitle = NULL
* display = str2bytes(display, &cdisplay)
*/
__pyx_v_cdisplay = NULL;
/* "petsc4py/PETSc/Viewer.pyx":353
* def setDrawInfo(self, display=None, title=None, position=None, size=None):
* 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":354
* 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(36, 354, __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":355
* 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(36, 355, __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":357
* 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":358
* 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(36, 358, __pyx_L1_error)
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(36, 358, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_3 = __Pyx_PyInt_From_int(PETSC_DECIDE); if (unlikely(!__pyx_t_3)) __PYX_ERR(36, 358, __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(36, 358, __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(36, 358, __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 != 0);
if (__pyx_t_4) {
/* "petsc4py/PETSc/Viewer.pyx":359
* 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(36, 359, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_5);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 359, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(36, 359, __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(36, 359, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
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(36, 359, __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(36, 359, __pyx_L1_error)
__pyx_L7_unpacking_done:;
}
__pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(36, 359, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(36, 359, __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":358
* 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":360
* 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(36, 360, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(36, 360, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
} else {
__pyx_t_4 = __pyx_t_2;
goto __pyx_L9_bool_binop_done;
}
__pyx_t_1 = __Pyx_PyInt_From_int(PETSC_DECIDE); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 360, __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(36, 360, __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(36, 360, __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 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Viewer.pyx":361
* 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":362
* 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(36, 362, __pyx_L11_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_5 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_3);
#else
__pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(36, 362, __pyx_L11_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(36, 362, __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(36, 362, __pyx_L11_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
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(36, 362, __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(36, 362, __pyx_L11_error)
__pyx_L18_unpacking_done:;
}
__pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(36, 362, __pyx_L11_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(36, 362, __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":361
* 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":363
* try:
* w, h = size
* except TypeError: # <<<<<<<<<<<<<<
* w = h = size
* CHKERR( PetscViewerDrawSetInfo(self.vwr,
*/
__pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
if (__pyx_t_7) {
__Pyx_AddTraceback("petsc4py.PETSc.Viewer.setDrawInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(36, 363, __pyx_L13_except_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_1);
/* "petsc4py/PETSc/Viewer.pyx":364
* w, h = size
* except TypeError:
* w = h = size # <<<<<<<<<<<<<<
* CHKERR( PetscViewerDrawSetInfo(self.vwr,
* cdisplay, ctitle,
*/
__pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(36, 364, __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;
__pyx_L13_except_error:;
/* "petsc4py/PETSc/Viewer.pyx":361
* x, y = position
* if size not in (None, PETSC_DECIDE):
* try: # <<<<<<<<<<<<<<
* w, h = size
* except TypeError:
*/
__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":360
* 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":365
* 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(36, 365, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":351
* # --- methods specific to draw viewers ---
*
* def setDrawInfo(self, display=None, title=None, position=None, size=None): # <<<<<<<<<<<<<<
* cdef const char *cdisplay = NULL
* cdef const char *ctitle = NULL
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_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":369
* x, y, w, h) )
*
* def clearDraw(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerDrawClear(self.vwr) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_81clearDraw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Viewer_80clearDraw[] = "Viewer.clearDraw(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_81clearDraw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("clearDraw (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("clearDraw", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clearDraw", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_80clearDraw(((struct PyPetscViewerObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_80clearDraw(struct PyPetscViewerObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("clearDraw", 0);
/* "petsc4py/PETSc/Viewer.pyx":370
*
* def clearDraw(self):
* CHKERR( PetscViewerDrawClear(self.vwr) ) # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerDrawClear(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 370, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":369
* x, y, w, h) )
*
* def clearDraw(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerDrawClear(self.vwr) )
*
*/
/* 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":376
* cdef class ViewerHDF5(Viewer):
*
* def create(self, name, mode=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_create[] = "ViewerHDF5.create(self, name, mode=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_mode = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(36, 376, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_mode = values[1];
__pyx_v_comm = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 376, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_create(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self), __pyx_v_name, __pyx_v_mode, __pyx_v_comm);
/* function exit code */
__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":377
*
* def create(self, name, mode=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<<
* cdef const char *cname = NULL
* name = str2bytes(name, &cname)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(36, 377, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Viewer.pyx":378
* def create(self, name, mode=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL # <<<<<<<<<<<<<<
* name = str2bytes(name, &cname)
* cdef PetscFileMode cmode = filemode(mode)
*/
__pyx_v_cname = NULL;
/* "petsc4py/PETSc/Viewer.pyx":379
* 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(36, 379, __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":380
* 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(36, 380, __pyx_L1_error)
__pyx_v_cmode = __pyx_t_3;
/* "petsc4py/PETSc/Viewer.pyx":381
* name = str2bytes(name, &cname)
* cdef PetscFileMode cmode = filemode(mode)
* cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr
*/
__pyx_v_newvwr = NULL;
/* "petsc4py/PETSc/Viewer.pyx":382
* cdef PetscFileMode cmode = filemode(mode)
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<<
* 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(36, 382, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":383
* cdef PetscViewer newvwr = NULL
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<<
* CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) )
* CHKERR( PetscViewerFileSetMode(self.vwr, cmode) )
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj));
__pyx_v_self->__pyx_base.vwr = __pyx_v_newvwr;
/* "petsc4py/PETSc/Viewer.pyx":384
* CHKERR( PetscViewerCreate(ccomm, &newvwr) )
* 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(36, 384, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":385
* 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(36, 385, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":386
* 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(36, 386, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":387
* CHKERR( PetscViewerFileSetMode(self.vwr, cmode) )
* CHKERR( PetscViewerFileSetName(self.vwr, cname) )
* return self # <<<<<<<<<<<<<<
*
* def pushTimestepping(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":376
* cdef class ViewerHDF5(Viewer):
*
* def create(self, name, mode=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef const char *cname = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_name);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":389
* return self
*
* def pushTimestepping(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerHDF5PushTimestepping(self.vwr) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_3pushTimestepping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_2pushTimestepping[] = "ViewerHDF5.pushTimestepping(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_3pushTimestepping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("pushTimestepping (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("pushTimestepping", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pushTimestepping", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_2pushTimestepping(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_2pushTimestepping(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pushTimestepping", 0);
/* "petsc4py/PETSc/Viewer.pyx":390
*
* def pushTimestepping(self):
* CHKERR( PetscViewerHDF5PushTimestepping(self.vwr) ) # <<<<<<<<<<<<<<
*
* def popTimestepping(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5PushTimestepping(__pyx_v_self->__pyx_base.vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 390, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":389
* return self
*
* def pushTimestepping(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerHDF5PushTimestepping(self.vwr) )
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.pushTimestepping", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":392
* CHKERR( PetscViewerHDF5PushTimestepping(self.vwr) )
*
* def popTimestepping(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerHDF5PopTimestepping(self.vwr) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_5popTimestepping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_4popTimestepping[] = "ViewerHDF5.popTimestepping(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_5popTimestepping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("popTimestepping (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("popTimestepping", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popTimestepping", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_4popTimestepping(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_4popTimestepping(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("popTimestepping", 0);
/* "petsc4py/PETSc/Viewer.pyx":393
*
* def popTimestepping(self):
* CHKERR( PetscViewerHDF5PopTimestepping(self.vwr) ) # <<<<<<<<<<<<<<
*
* def getTimestep(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5PopTimestepping(__pyx_v_self->__pyx_base.vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 393, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":392
* CHKERR( PetscViewerHDF5PushTimestepping(self.vwr) )
*
* def popTimestepping(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerHDF5PopTimestepping(self.vwr) )
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.popTimestepping", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":395
* CHKERR( PetscViewerHDF5PopTimestepping(self.vwr) )
*
* def getTimestep(self): # <<<<<<<<<<<<<<
* cdef PetscInt ctimestep = 0
* CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_7getTimestep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_6getTimestep[] = "ViewerHDF5.getTimestep(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_7getTimestep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getTimestep (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getTimestep", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTimestep", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_6getTimestep(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_6getTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) {
PetscInt __pyx_v_ctimestep;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getTimestep", 0);
/* "petsc4py/PETSc/Viewer.pyx":396
*
* def getTimestep(self):
* cdef PetscInt ctimestep = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) )
* return toInt(ctimestep)
*/
__pyx_v_ctimestep = 0;
/* "petsc4py/PETSc/Viewer.pyx":397
* def getTimestep(self):
* cdef PetscInt ctimestep = 0
* CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) ) # <<<<<<<<<<<<<<
* return toInt(ctimestep)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5GetTimestep(__pyx_v_self->__pyx_base.vwr, (&__pyx_v_ctimestep))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 397, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":398
* cdef PetscInt ctimestep = 0
* CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) )
* return toInt(ctimestep) # <<<<<<<<<<<<<<
*
* def setTimestep(self, timestep):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ctimestep); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 398, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Viewer.pyx":395
* CHKERR( PetscViewerHDF5PopTimestepping(self.vwr) )
*
* def getTimestep(self): # <<<<<<<<<<<<<<
* cdef PetscInt ctimestep = 0
* CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.getTimestep", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":400
* return toInt(ctimestep)
*
* def setTimestep(self, timestep): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_9setTimestep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_8setTimestep[] = "ViewerHDF5.setTimestep(self, timestep)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_9setTimestep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_timestep = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timestep,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timestep)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTimestep") < 0)) __PYX_ERR(36, 400, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_timestep = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setTimestep", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 400, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":401
*
* def setTimestep(self, timestep):
* CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) ) # <<<<<<<<<<<<<<
*
* def incrementTimestep(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_timestep); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(36, 401, __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(36, 401, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":400
* return toInt(ctimestep)
*
* def setTimestep(self, timestep): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) )
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.setTimestep", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":403
* CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) )
*
* def incrementTimestep(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_11incrementTimestep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_10incrementTimestep[] = "ViewerHDF5.incrementTimestep(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_11incrementTimestep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("incrementTimestep (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("incrementTimestep", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "incrementTimestep", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_10incrementTimestep(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_10incrementTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("incrementTimestep", 0);
/* "petsc4py/PETSc/Viewer.pyx":404
*
* def incrementTimestep(self):
* CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) ) # <<<<<<<<<<<<<<
*
* def pushGroup(self, group):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5IncrementTimestep(__pyx_v_self->__pyx_base.vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 404, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":403
* CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) )
*
* def incrementTimestep(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) )
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.incrementTimestep", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":406
* CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) )
*
* def pushGroup(self, group): # <<<<<<<<<<<<<<
* cdef const char *cgroup = NULL
* group = str2bytes(group, &cgroup)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_13pushGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_12pushGroup[] = "ViewerHDF5.pushGroup(self, group)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_13pushGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_group = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_group,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_group)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pushGroup") < 0)) __PYX_ERR(36, 406, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_group = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("pushGroup", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 406, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":407
*
* def pushGroup(self, group):
* cdef const char *cgroup = NULL # <<<<<<<<<<<<<<
* group = str2bytes(group, &cgroup)
* CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) )
*/
__pyx_v_cgroup = NULL;
/* "petsc4py/PETSc/Viewer.pyx":408
* def pushGroup(self, group):
* cdef const char *cgroup = NULL
* group = str2bytes(group, &cgroup) # <<<<<<<<<<<<<<
* CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_group, (&__pyx_v_cgroup)); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 408, __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":409
* cdef const char *cgroup = NULL
* group = str2bytes(group, &cgroup)
* CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) ) # <<<<<<<<<<<<<<
*
* def popGroup(self):
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5PushGroup(__pyx_v_self->__pyx_base.vwr, __pyx_v_cgroup)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 409, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":406
* CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) )
*
* def pushGroup(self, group): # <<<<<<<<<<<<<<
* cdef const char *cgroup = NULL
* group = str2bytes(group, &cgroup)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.pushGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_group);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":411
* CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) )
*
* def popGroup(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerHDF5PopGroup(self.vwr) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_15popGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_14popGroup[] = "ViewerHDF5.popGroup(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_15popGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("popGroup (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("popGroup", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popGroup", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_14popGroup(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_14popGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("popGroup", 0);
/* "petsc4py/PETSc/Viewer.pyx":412
*
* def popGroup(self):
* CHKERR( PetscViewerHDF5PopGroup(self.vwr) ) # <<<<<<<<<<<<<<
*
* def getGroup(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5PopGroup(__pyx_v_self->__pyx_base.vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 412, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":411
* CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) )
*
* def popGroup(self): # <<<<<<<<<<<<<<
* CHKERR( PetscViewerHDF5PopGroup(self.vwr) )
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.popGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Viewer.pyx":414
* CHKERR( PetscViewerHDF5PopGroup(self.vwr) )
*
* def getGroup(self): # <<<<<<<<<<<<<<
* cdef char *cgroup = NULL
* CHKERR( PetscViewerHDF5GetGroup(self.vwr, NULL, &cgroup) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_17getGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_16getGroup[] = "ViewerHDF5.getGroup(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_17getGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getGroup (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getGroup", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGroup", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_16getGroup(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_16getGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) {
char *__pyx_v_cgroup;
PyObject *__pyx_v_group = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getGroup", 0);
/* "petsc4py/PETSc/Viewer.pyx":415
*
* def getGroup(self):
* cdef char *cgroup = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscViewerHDF5GetGroup(self.vwr, NULL, &cgroup) )
* group = bytes2str(cgroup)
*/
__pyx_v_cgroup = NULL;
/* "petsc4py/PETSc/Viewer.pyx":416
* def getGroup(self):
* cdef char *cgroup = NULL
* CHKERR( PetscViewerHDF5GetGroup(self.vwr, NULL, &cgroup) ) # <<<<<<<<<<<<<<
* group = bytes2str(cgroup)
* CHKERR( PetscFree(cgroup) )
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5GetGroup(__pyx_v_self->__pyx_base.vwr, NULL, (&__pyx_v_cgroup))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 416, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":417
* cdef char *cgroup = NULL
* CHKERR( PetscViewerHDF5GetGroup(self.vwr, NULL, &cgroup) )
* group = bytes2str(cgroup) # <<<<<<<<<<<<<<
* CHKERR( PetscFree(cgroup) )
* return group
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cgroup); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 417, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_group = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Viewer.pyx":418
* 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(36, 418, __pyx_L1_error)
/* "petsc4py/PETSc/Viewer.pyx":419
* 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":414
* CHKERR( PetscViewerHDF5PopGroup(self.vwr) )
*
* def getGroup(self): # <<<<<<<<<<<<<<
* cdef char *cgroup = NULL
* CHKERR( PetscViewerHDF5GetGroup(self.vwr, NULL, &cgroup) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.getGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_group);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Random.pyx":16
* Type = RandomType
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random___cinit__(((struct PyPetscRandomObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_6Random___cinit__(struct PyPetscRandomObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/Random.pyx":17
*
* def __cinit__(self):
* self.obj = <PetscObject*> &self.rnd # <<<<<<<<<<<<<<
* self.rnd = NULL
*
*/
__pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->rnd));
/* "petsc4py/PETSc/Random.pyx":18
* def __cinit__(self):
* self.obj = <PetscObject*> &self.rnd
* self.rnd = NULL # <<<<<<<<<<<<<<
*
* def __call__(self):
*/
__pyx_v_self->rnd = NULL;
/* "petsc4py/PETSc/Random.pyx":16
* Type = RandomType
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.rnd
* self.rnd = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Random.pyx":20
* self.rnd = NULL
*
* def __call__(self): # <<<<<<<<<<<<<<
* return self.getValue()
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__call__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_2__call__(((struct PyPetscRandomObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_2__call__(struct PyPetscRandomObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__call__", 0);
/* "petsc4py/PETSc/Random.pyx":21
*
* def __call__(self):
* return self.getValue() # <<<<<<<<<<<<<<
*
* def view(self, Viewer viewer=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 21, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 21, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Random.pyx":20
* self.rnd = NULL
*
* def __call__(self): # <<<<<<<<<<<<<<
* return self.getValue()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.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":23
* return self.getValue()
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* assert self.obj != NULL
* cdef PetscViewer vwr = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Random_4view[] = "Random.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(37, 23, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 23, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Random.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(37, 23, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_4view(((struct PyPetscRandomObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/Random.pyx":24
*
* def view(self, Viewer viewer=None):
* 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())) {
if (unlikely(!((__pyx_v_self->__pyx_base.obj != NULL) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(37, 24, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/Random.pyx":25
* def view(self, Viewer viewer=None):
* 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":26
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
}
/* "petsc4py/PETSc/Random.pyx":27
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
* CHKERR( PetscRandomView(self.rnd, vwr) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomView(__pyx_v_self->rnd, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 27, __pyx_L1_error)
/* "petsc4py/PETSc/Random.pyx":23
* return self.getValue()
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* assert self.obj != NULL
* cdef PetscViewer vwr = NULL
*/
/* 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":29
* CHKERR( PetscRandomView(self.rnd, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PetscRandomDestroy(&self.rnd) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Random_6destroy[] = "Random.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_6destroy(((struct PyPetscRandomObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_6destroy(struct PyPetscRandomObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/Random.pyx":30
*
* def destroy(self):
* 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(37, 30, __pyx_L1_error)
/* "petsc4py/PETSc/Random.pyx":31
* def destroy(self):
* CHKERR( PetscRandomDestroy(&self.rnd) )
* return self # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Random.pyx":29
* CHKERR( PetscRandomView(self.rnd, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PetscRandomDestroy(&self.rnd) )
* return self
*/
/* 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":33
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* CHKERR( PetscRandomCreate(ccomm, &self.rnd) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Random_8create[] = "Random.create(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(37, 33, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 33, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":34
*
* def create(self, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(37, 34, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Random.pyx":35
* def create(self, comm=None):
* 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(37, 35, __pyx_L1_error)
/* "petsc4py/PETSc/Random.pyx":36
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* CHKERR( PetscRandomCreate(ccomm, &self.rnd) )
* return self # <<<<<<<<<<<<<<
*
* def setType(self, rnd_type):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Random.pyx":33
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* CHKERR( PetscRandomCreate(ccomm, &self.rnd) )
*/
/* 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":38
* return self
*
* def setType(self, rnd_type): # <<<<<<<<<<<<<<
* cdef PetscRandomType cval = NULL
* rnd_type = str2bytes(rnd_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Random_10setType[] = "Random.setType(self, rnd_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rnd_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rnd_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rnd_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(37, 38, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_rnd_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 38, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":39
*
* def setType(self, rnd_type):
* cdef PetscRandomType cval = NULL # <<<<<<<<<<<<<<
* rnd_type = str2bytes(rnd_type, &cval)
* CHKERR( PetscRandomSetType(self.rnd, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Random.pyx":40
* def setType(self, rnd_type):
* 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(37, 40, __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":41
* cdef PetscRandomType cval = NULL
* rnd_type = str2bytes(rnd_type, &cval)
* CHKERR( PetscRandomSetType(self.rnd, cval) ) # <<<<<<<<<<<<<<
*
* def getType(self):
*/
__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(37, 41, __pyx_L1_error)
/* "petsc4py/PETSc/Random.pyx":38
* return self
*
* def setType(self, rnd_type): # <<<<<<<<<<<<<<
* cdef PetscRandomType cval = NULL
* rnd_type = str2bytes(rnd_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":43
* CHKERR( PetscRandomSetType(self.rnd, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscRandomType cval = NULL
* CHKERR( PetscRandomGetType(self.rnd, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Random_12getType[] = "Random.getType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_12getType(((struct PyPetscRandomObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_12getType(struct PyPetscRandomObject *__pyx_v_self) {
PetscRandomType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getType", 0);
/* "petsc4py/PETSc/Random.pyx":44
*
* def getType(self):
* cdef PetscRandomType cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscRandomGetType(self.rnd, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Random.pyx":45
* def getType(self):
* 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(37, 45, __pyx_L1_error)
/* "petsc4py/PETSc/Random.pyx":46
* cdef PetscRandomType cval = NULL
* CHKERR( PetscRandomGetType(self.rnd, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def setFromOptions(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 46, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Random.pyx":43
* CHKERR( PetscRandomSetType(self.rnd, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscRandomType cval = NULL
* CHKERR( PetscRandomGetType(self.rnd, &cval) )
*/
/* 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":48
* return bytes2str(cval)
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( PetscRandomSetFromOptions(self.rnd) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_15setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Random_14setFromOptions[] = "Random.setFromOptions(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_15setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_14setFromOptions(((struct PyPetscRandomObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_14setFromOptions(struct PyPetscRandomObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFromOptions", 0);
/* "petsc4py/PETSc/Random.pyx":49
*
* def setFromOptions(self):
* CHKERR( PetscRandomSetFromOptions(self.rnd) ) # <<<<<<<<<<<<<<
*
* def getValue(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomSetFromOptions(__pyx_v_self->rnd)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 49, __pyx_L1_error)
/* "petsc4py/PETSc/Random.pyx":48
* return bytes2str(cval)
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( PetscRandomSetFromOptions(self.rnd) )
*
*/
/* 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":51
* CHKERR( PetscRandomSetFromOptions(self.rnd) )
*
* def getValue(self): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( PetscRandomGetValue(self.rnd, &sval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_17getValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Random_16getValue[] = "Random.getValue(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_17getValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getValue (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getValue", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getValue", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_16getValue(((struct PyPetscRandomObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_16getValue(struct PyPetscRandomObject *__pyx_v_self) {
PetscScalar __pyx_v_sval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getValue", 0);
/* "petsc4py/PETSc/Random.pyx":52
*
* def getValue(self):
* cdef PetscScalar sval = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscRandomGetValue(self.rnd, &sval) )
* return toScalar(sval)
*/
__pyx_v_sval = 0.0;
/* "petsc4py/PETSc/Random.pyx":53
* def getValue(self):
* 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(37, 53, __pyx_L1_error)
/* "petsc4py/PETSc/Random.pyx":54
* cdef PetscScalar sval = 0
* CHKERR( PetscRandomGetValue(self.rnd, &sval) )
* return toScalar(sval) # <<<<<<<<<<<<<<
*
* def getValueReal(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 54, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Random.pyx":51
* CHKERR( PetscRandomSetFromOptions(self.rnd) )
*
* def getValue(self): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( PetscRandomGetValue(self.rnd, &sval) )
*/
/* 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":56
* return toScalar(sval)
*
* def getValueReal(self): # <<<<<<<<<<<<<<
* cdef PetscReal rval = 0
* CHKERR( PetscRandomGetValueReal(self.rnd, &rval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_19getValueReal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Random_18getValueReal[] = "Random.getValueReal(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_19getValueReal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getValueReal (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getValueReal", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getValueReal", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_18getValueReal(((struct PyPetscRandomObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_18getValueReal(struct PyPetscRandomObject *__pyx_v_self) {
PetscReal __pyx_v_rval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getValueReal", 0);
/* "petsc4py/PETSc/Random.pyx":57
*
* def getValueReal(self):
* cdef PetscReal rval = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscRandomGetValueReal(self.rnd, &rval) )
* return toReal(rval)
*/
__pyx_v_rval = 0.0;
/* "petsc4py/PETSc/Random.pyx":58
* def getValueReal(self):
* 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(37, 58, __pyx_L1_error)
/* "petsc4py/PETSc/Random.pyx":59
* cdef PetscReal rval = 0
* CHKERR( PetscRandomGetValueReal(self.rnd, &rval) )
* return toReal(rval) # <<<<<<<<<<<<<<
*
* def getSeed(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 59, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Random.pyx":56
* return toScalar(sval)
*
* def getValueReal(self): # <<<<<<<<<<<<<<
* cdef PetscReal rval = 0
* CHKERR( PetscRandomGetValueReal(self.rnd, &rval) )
*/
/* 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":61
* return toReal(rval)
*
* def getSeed(self): # <<<<<<<<<<<<<<
* cdef unsigned long seed = 0
* CHKERR( PetscRandomGetSeed(self.rnd, &seed) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_21getSeed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Random_20getSeed[] = "Random.getSeed(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_21getSeed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getSeed (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getSeed", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSeed", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_20getSeed(((struct PyPetscRandomObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_20getSeed(struct PyPetscRandomObject *__pyx_v_self) {
unsigned long __pyx_v_seed;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getSeed", 0);
/* "petsc4py/PETSc/Random.pyx":62
*
* def getSeed(self):
* cdef unsigned long seed = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscRandomGetSeed(self.rnd, &seed) )
* return seed
*/
__pyx_v_seed = 0;
/* "petsc4py/PETSc/Random.pyx":63
* def getSeed(self):
* cdef unsigned long seed = 0
* CHKERR( PetscRandomGetSeed(self.rnd, &seed) ) # <<<<<<<<<<<<<<
* return seed
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomGetSeed(__pyx_v_self->rnd, (&__pyx_v_seed))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 63, __pyx_L1_error)
/* "petsc4py/PETSc/Random.pyx":64
* cdef unsigned long seed = 0
* CHKERR( PetscRandomGetSeed(self.rnd, &seed) )
* return seed # <<<<<<<<<<<<<<
*
* def setSeed(self, seed=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_unsigned_long(__pyx_v_seed); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 64, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Random.pyx":61
* return toReal(rval)
*
* def getSeed(self): # <<<<<<<<<<<<<<
* cdef unsigned long seed = 0
* CHKERR( PetscRandomGetSeed(self.rnd, &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":66
* return seed
*
* def setSeed(self, seed=None): # <<<<<<<<<<<<<<
* if seed is not None:
* CHKERR( PetscRandomSetSeed(self.rnd, seed) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_23setSeed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Random_22setSeed[] = "Random.setSeed(self, seed=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_23setSeed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_seed = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seed,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seed);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSeed") < 0)) __PYX_ERR(37, 66, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_seed = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setSeed", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 66, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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;
int __pyx_t_2;
unsigned long __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setSeed", 0);
/* "petsc4py/PETSc/Random.pyx":67
*
* def setSeed(self, seed=None):
* if seed is not None: # <<<<<<<<<<<<<<
* CHKERR( PetscRandomSetSeed(self.rnd, seed) )
* CHKERR( PetscRandomSeed(self.rnd) )
*/
__pyx_t_1 = (__pyx_v_seed != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Random.pyx":68
* def setSeed(self, seed=None):
* if seed is not None:
* CHKERR( PetscRandomSetSeed(self.rnd, seed) ) # <<<<<<<<<<<<<<
* CHKERR( PetscRandomSeed(self.rnd) )
*
*/
__pyx_t_3 = __Pyx_PyInt_As_unsigned_long(__pyx_v_seed); if (unlikely((__pyx_t_3 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(37, 68, __pyx_L1_error)
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomSetSeed(__pyx_v_self->rnd, __pyx_t_3)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 68, __pyx_L1_error)
/* "petsc4py/PETSc/Random.pyx":67
*
* def setSeed(self, seed=None):
* if seed is not None: # <<<<<<<<<<<<<<
* CHKERR( PetscRandomSetSeed(self.rnd, seed) )
* CHKERR( PetscRandomSeed(self.rnd) )
*/
}
/* "petsc4py/PETSc/Random.pyx":69
* if seed is not None:
* CHKERR( PetscRandomSetSeed(self.rnd, seed) )
* CHKERR( PetscRandomSeed(self.rnd) ) # <<<<<<<<<<<<<<
*
* def getInterval(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomSeed(__pyx_v_self->rnd)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 69, __pyx_L1_error)
/* "petsc4py/PETSc/Random.pyx":66
* return seed
*
* def setSeed(self, seed=None): # <<<<<<<<<<<<<<
* if seed is not None:
* CHKERR( PetscRandomSetSeed(self.rnd, seed) )
*/
/* 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":71
* CHKERR( PetscRandomSeed(self.rnd) )
*
* def getInterval(self): # <<<<<<<<<<<<<<
* cdef PetscScalar sval1 = 0
* cdef PetscScalar sval2 = 1
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_25getInterval(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Random_24getInterval[] = "Random.getInterval(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_25getInterval(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getInterval (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getInterval", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInterval", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_24getInterval(((struct PyPetscRandomObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_24getInterval(struct PyPetscRandomObject *__pyx_v_self) {
PetscScalar __pyx_v_sval1;
PetscScalar __pyx_v_sval2;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getInterval", 0);
/* "petsc4py/PETSc/Random.pyx":72
*
* def getInterval(self):
* cdef PetscScalar sval1 = 0 # <<<<<<<<<<<<<<
* cdef PetscScalar sval2 = 1
* CHKERR( PetscRandomGetInterval(self.rnd, &sval1, &sval2) )
*/
__pyx_v_sval1 = 0.0;
/* "petsc4py/PETSc/Random.pyx":73
* def getInterval(self):
* 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":74
* 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(37, 74, __pyx_L1_error)
/* "petsc4py/PETSc/Random.pyx":75
* cdef PetscScalar sval2 = 1
* CHKERR( PetscRandomGetInterval(self.rnd, &sval1, &sval2) )
* return (toScalar(sval1), toScalar(sval2)) # <<<<<<<<<<<<<<
*
* def setInterval(self, interval):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval1); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 75, __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(37, 75, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 75, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Random.pyx":71
* CHKERR( PetscRandomSeed(self.rnd) )
*
* def getInterval(self): # <<<<<<<<<<<<<<
* cdef PetscScalar sval1 = 0
* cdef PetscScalar sval2 = 1
*/
/* 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":77
* return (toScalar(sval1), toScalar(sval2))
*
* def setInterval(self, interval): # <<<<<<<<<<<<<<
* cdef PetscScalar sval1 = 0
* cdef PetscScalar sval2 = 1
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_27setInterval(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Random_26setInterval[] = "Random.setInterval(self, interval)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_27setInterval(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_interval = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_interval,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setInterval") < 0)) __PYX_ERR(37, 77, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_interval = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setInterval", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 77, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":78
*
* def setInterval(self, interval):
* cdef PetscScalar sval1 = 0 # <<<<<<<<<<<<<<
* cdef PetscScalar sval2 = 1
* low, high = interval
*/
__pyx_v_sval1 = 0.0;
/* "petsc4py/PETSc/Random.pyx":79
* def setInterval(self, interval):
* cdef PetscScalar sval1 = 0
* cdef PetscScalar sval2 = 1 # <<<<<<<<<<<<<<
* low, high = interval
* sval1 = asScalar(low)
*/
__pyx_v_sval2 = 1.0;
/* "petsc4py/PETSc/Random.pyx":80
* 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(37, 80, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_2 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 80, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 80, __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(37, 80, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
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(37, 80, __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(37, 80, __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":81
* cdef PetscScalar sval2 = 1
* low, high = interval
* sval1 = asScalar(low) # <<<<<<<<<<<<<<
* sval2 = asScalar(high)
* CHKERR( PetscRandomSetInterval(self.rnd, sval1, sval2) )
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_low); if (unlikely(__pyx_t_5 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(37, 81, __pyx_L1_error)
__pyx_v_sval1 = __pyx_t_5;
/* "petsc4py/PETSc/Random.pyx":82
* low, high = interval
* sval1 = asScalar(low)
* sval2 = asScalar(high) # <<<<<<<<<<<<<<
* CHKERR( PetscRandomSetInterval(self.rnd, sval1, sval2) )
*
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_high); if (unlikely(__pyx_t_5 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(37, 82, __pyx_L1_error)
__pyx_v_sval2 = __pyx_t_5;
/* "petsc4py/PETSc/Random.pyx":83
* 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(37, 83, __pyx_L1_error)
/* "petsc4py/PETSc/Random.pyx":77
* return (toScalar(sval1), toScalar(sval2))
*
* def setInterval(self, interval): # <<<<<<<<<<<<<<
* cdef PetscScalar sval1 = 0
* cdef PetscScalar sval2 = 1
*/
/* 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":88
*
* property seed:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getSeed()
* def __set__(self, value):
*/
/* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_4seed___get__(((struct PyPetscRandomObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_4seed___get__(struct PyPetscRandomObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Random.pyx":89
* property seed:
* def __get__(self):
* return self.getSeed() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setSeed(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSeed); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Random.pyx":88
*
* property seed:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getSeed()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.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":90
* def __get__(self):
* return self.getSeed()
* def __set__(self, value): # <<<<<<<<<<<<<<
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_4seed_2__set__(((struct PyPetscRandomObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_6Random_4seed_2__set__(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Random.pyx":91
* return self.getSeed()
* def __set__(self, value):
* self.setSeed(value) # <<<<<<<<<<<<<<
*
* property interval:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setSeed); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Random.pyx":90
* def __get__(self):
* return self.getSeed()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setSeed(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Random.seed.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Random.pyx":94
*
* property interval:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getInterval()
* def __set__(self, value):
*/
/* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_8interval___get__(((struct PyPetscRandomObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_8interval___get__(struct PyPetscRandomObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Random.pyx":95
* property interval:
* def __get__(self):
* return self.getInterval() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setInterval(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getInterval); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Random.pyx":94
*
* property interval:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getInterval()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.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":96
* def __get__(self):
* return self.getInterval()
* def __set__(self, value): # <<<<<<<<<<<<<<
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_8interval_2__set__(((struct PyPetscRandomObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_6Random_8interval_2__set__(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Random.pyx":97
* return self.getInterval()
* def __set__(self, value):
* self.setInterval(value) # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setInterval); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 97, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 97, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Random.pyx":96
* def __get__(self):
* return self.getInterval()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setInterval(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Random.interval.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":4
*
* class staticproperty(property):
* def __get__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* return self.fget.__get__(*args, **kwargs)()
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_14staticproperty_1__get__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_14staticproperty___get__[] = "staticproperty.__get__(self, *args, **kwargs)";
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_14staticproperty_1__get__ = {"__get__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_14staticproperty_1__get__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14staticproperty___get__};
static PyObject *__pyx_pw_8petsc4py_5PETSc_14staticproperty_1__get__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 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);
__pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kwargs);
if (PyTuple_GET_SIZE(__pyx_args) > 1) {
__pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
if (unlikely(!__pyx_v_args)) {
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_RefNannyFinishContext();
return NULL;
}
__Pyx_GOTREF(__pyx_v_args);
} else {
__pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
}
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
default:
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__get__") < 0)) __PYX_ERR(2, 4, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_self = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__get__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 4, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_AddTraceback("petsc4py.PETSc.staticproperty.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_14staticproperty___get__(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_args);
__Pyx_XDECREF(__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;
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)() # <<<<<<<<<<<<<<
*
* cdef object make_enum_class(str class_name, tuple args):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fget); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_v_args, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":4
*
* class staticproperty(property):
* def __get__(self, *args, **kwargs): # <<<<<<<<<<<<<<
* return self.fget.__get__(*args, **kwargs)()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("petsc4py.PETSc.staticproperty.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":7
* return self.fget.__get__(*args, **kwargs)()
*
* cdef object make_enum_class(str class_name, 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_args) {
PyObject *__pyx_v_enum2str = 0;
PyObject *__pyx_v_attrs = 0;
PyObject *__pyx_v_name = NULL;
PyObject *__pyx_v_c_enum = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *(*__pyx_t_7)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("make_enum_class", 0);
/* "petsc4py/PETSc/Device.pyx":8
*
* cdef object make_enum_class(str class_name, tuple args):
* cdef dict enum2str = {} # <<<<<<<<<<<<<<
* cdef dict attrs = {}
*
*/
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_enum2str = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Device.pyx":9
* cdef object make_enum_class(str class_name, tuple args):
* cdef dict enum2str = {}
* cdef dict attrs = {} # <<<<<<<<<<<<<<
*
* for name, c_enum in args:
*/
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_attrs = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Device.pyx":11
* cdef dict attrs = {}
*
* for name, c_enum in args: # <<<<<<<<<<<<<<
* enum2str[c_enum] = name
* attrs[name] = c_enum
*/
if (unlikely(__pyx_v_args == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(2, 11, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
for (;;) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 11, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 11, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
PyObject* sequence = __pyx_t_3;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(2, 11, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
#else
__pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 11, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 11, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
Py_ssize_t index = -1;
__pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 11, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(2, 11, __pyx_L1_error)
__pyx_t_7 = NULL;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_7 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(2, 11, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4);
__pyx_t_4 = 0;
__Pyx_XDECREF_SET(__pyx_v_c_enum, __pyx_t_5);
__pyx_t_5 = 0;
/* "petsc4py/PETSc/Device.pyx":12
*
* for name, c_enum in args:
* enum2str[c_enum] = name # <<<<<<<<<<<<<<
* attrs[name] = c_enum
*
*/
if (unlikely(PyDict_SetItem(__pyx_v_enum2str, __pyx_v_c_enum, __pyx_v_name) < 0)) __PYX_ERR(2, 12, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":13
* for name, c_enum in args:
* enum2str[c_enum] = name
* attrs[name] = c_enum # <<<<<<<<<<<<<<
*
* attrs['__enum2str'] = enum2str
*/
if (unlikely(PyDict_SetItem(__pyx_v_attrs, __pyx_v_name, __pyx_v_c_enum) < 0)) __PYX_ERR(2, 13, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":11
* cdef dict attrs = {}
*
* for name, c_enum in args: # <<<<<<<<<<<<<<
* enum2str[c_enum] = name
* attrs[name] = c_enum
*/
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Device.pyx":15
* attrs[name] = c_enum
*
* attrs['__enum2str'] = enum2str # <<<<<<<<<<<<<<
* return type(class_name, (object, ), attrs)
*
*/
if (unlikely(PyDict_SetItem(__pyx_v_attrs, __pyx_n_s_enum2str, __pyx_v_enum2str) < 0)) __PYX_ERR(2, 15, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":16
*
* attrs['__enum2str'] = enum2str
* return type(class_name, (object, ), attrs) # <<<<<<<<<<<<<<
*
* DeviceType = make_enum_class(
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 16, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_class_name);
__Pyx_GIVEREF(__pyx_v_class_name);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_class_name);
__Pyx_INCREF(__pyx_tuple__29);
__Pyx_GIVEREF(__pyx_tuple__29);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_tuple__29);
__Pyx_INCREF(__pyx_v_attrs);
__Pyx_GIVEREF(__pyx_v_attrs);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_attrs);
__pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyType_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 16, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":7
* return self.fget.__get__(*args, **kwargs)()
*
* cdef object make_enum_class(str class_name, 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":53
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device___cinit__(((struct PyPetscDeviceObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_6Device___cinit__(struct PyPetscDeviceObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/Device.pyx":54
*
* def __cinit__(self):
* self.device = NULL # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
__pyx_v_self->device = NULL;
/* "petsc4py/PETSc/Device.pyx":53
* Type = DeviceType
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.device = NULL
*
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":56
* 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) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__pyx_pf_8petsc4py_5PETSc_6Device_2__dealloc__(((struct PyPetscDeviceObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_pf_8petsc4py_5PETSc_6Device_2__dealloc__(struct PyPetscDeviceObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__dealloc__", 0);
/* "petsc4py/PETSc/Device.pyx":57
*
* def __dealloc__(self):
* self.destroy() # <<<<<<<<<<<<<<
*
* @classmethod
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 57, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 57, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Device.pyx":56
* self.device = NULL
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* self.destroy()
*
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_WriteUnraisable("petsc4py.PETSc.Device.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "petsc4py/PETSc/Device.pyx":60
*
* @classmethod
* def create(cls, dtype = None, device_id = PETSC_DECIDE): # <<<<<<<<<<<<<<
* cdef PetscInt cdevice_id = asInt(device_id)
* cdef PetscDeviceType cdevice_type = asDeviceType(dtype if dtype is not None else cls.Type.DEFAULT)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_5create(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Device_4create[] = "Device.create(type cls, dtype=None, device_id=PETSC_DECIDE)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_5create(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_dtype = 0;
PyObject *__pyx_v_device_id = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dtype,&__pyx_n_s_device_id,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_None);
values[1] = __pyx_k__30;
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_device_id);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(2, 60, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_dtype = values[0];
__pyx_v_device_id = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 60, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_4create(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_dtype, PyObject *__pyx_v_device_id) {
PetscInt __pyx_v_cdevice_id;
PetscDeviceType __pyx_v_cdevice_type;
struct PyPetscDeviceObject *__pyx_v_device = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PetscDeviceType __pyx_t_6;
PetscErrorCode __pyx_t_7;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("create", 0);
/* "petsc4py/PETSc/Device.pyx":61
* @classmethod
* def create(cls, dtype = None, device_id = PETSC_DECIDE):
* 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, 61, __pyx_L1_error)
__pyx_v_cdevice_id = __pyx_t_1;
/* "petsc4py/PETSc/Device.pyx":62
* def create(cls, dtype = None, device_id = PETSC_DECIDE):
* 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 != 0)) {
__Pyx_INCREF(__pyx_v_dtype);
__pyx_t_2 = __pyx_v_dtype;
} else {
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_Type); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 62, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_DEFAULT); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 62, __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, 62, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_cdevice_type = __pyx_t_6;
/* "petsc4py/PETSc/Device.pyx":63
* cdef PetscInt cdevice_id = asInt(device_id)
* cdef PetscDeviceType cdevice_type = asDeviceType(dtype if dtype is not None else cls.Type.DEFAULT)
* cdef Device device = cls() # <<<<<<<<<<<<<<
*
* CHKERR(PetscDeviceCreate(cdevice_type, cdevice_id, &device.device))
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_v_cls)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 63, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Device))))) __PYX_ERR(2, 63, __pyx_L1_error)
__pyx_v_device = ((struct PyPetscDeviceObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Device.pyx":65
* cdef Device device = cls()
*
* CHKERR(PetscDeviceCreate(cdevice_type, cdevice_id, &device.device)) # <<<<<<<<<<<<<<
* return device
*
*/
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceCreate(__pyx_v_cdevice_type, __pyx_v_cdevice_id, (&__pyx_v_device->device))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 65, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":66
*
* CHKERR(PetscDeviceCreate(cdevice_type, cdevice_id, &device.device))
* return device # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_device));
__pyx_r = ((PyObject *)__pyx_v_device);
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":60
*
* @classmethod
* def create(cls, dtype = None, device_id = PETSC_DECIDE): # <<<<<<<<<<<<<<
* cdef PetscInt cdevice_id = asInt(device_id)
* cdef PetscDeviceType cdevice_type = asDeviceType(dtype if dtype is not None else cls.Type.DEFAULT)
*/
/* 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":68
* return device
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceDestroy(&self.device))
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Device_6destroy[] = "Device.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_6destroy(((struct PyPetscDeviceObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_6destroy(struct PyPetscDeviceObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/Device.pyx":69
*
* def destroy(self):
* CHKERR(PetscDeviceDestroy(&self.device)) # <<<<<<<<<<<<<<
*
* def configure(self):
*/
__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, 69, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":68
* return device
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceDestroy(&self.device))
*
*/
/* 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":71
* CHKERR(PetscDeviceDestroy(&self.device))
*
* def configure(self): # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceConfigure(self.device))
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_9configure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Device_8configure[] = "Device.configure(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_9configure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("configure (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("configure", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "configure", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_8configure(((struct PyPetscDeviceObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_8configure(struct PyPetscDeviceObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("configure", 0);
/* "petsc4py/PETSc/Device.pyx":72
*
* def configure(self):
* CHKERR(PetscDeviceConfigure(self.device)) # <<<<<<<<<<<<<<
*
* def view(self, Viewer viewer = 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, 72, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":71
* CHKERR(PetscDeviceDestroy(&self.device))
*
* def configure(self): # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceConfigure(self.device))
*
*/
/* 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":74
* CHKERR(PetscDeviceConfigure(self.device))
*
* def view(self, Viewer viewer = None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_11view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Device_10view[] = "Device.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_11view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(2, 74, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 74, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Device.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(2, 74, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_10view(((struct PyPetscDeviceObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/Device.pyx":75
*
* def view(self, Viewer viewer = None):
* cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<<
*
* if viewer is not None:
*/
__pyx_v_vwr = NULL;
/* "petsc4py/PETSc/Device.pyx":77
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Device.pyx":78
*
* if viewer is not None:
* vwr = viewer.vwr # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceView(self.device, vwr))
*
*/
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
/* "petsc4py/PETSc/Device.pyx":77
* cdef PetscViewer vwr = NULL
*
* if viewer is not None: # <<<<<<<<<<<<<<
* vwr = viewer.vwr
* CHKERR(PetscDeviceView(self.device, vwr))
*/
}
/* "petsc4py/PETSc/Device.pyx":79
* if viewer is not None:
* vwr = viewer.vwr
* CHKERR(PetscDeviceView(self.device, vwr)) # <<<<<<<<<<<<<<
*
* def getDeviceType(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceView(__pyx_v_self->device, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 79, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":74
* CHKERR(PetscDeviceConfigure(self.device))
*
* def view(self, Viewer viewer = None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
*
*/
/* 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":81
* CHKERR(PetscDeviceView(self.device, vwr))
*
* def getDeviceType(self): # <<<<<<<<<<<<<<
* cdef PetscDeviceType cdtype
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_13getDeviceType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Device_12getDeviceType[] = "Device.getDeviceType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_13getDeviceType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDeviceType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDeviceType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDeviceType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_12getDeviceType(((struct PyPetscDeviceObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_12getDeviceType(struct PyPetscDeviceObject *__pyx_v_self) {
PetscDeviceType __pyx_v_cdtype;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDeviceType", 0);
/* "petsc4py/PETSc/Device.pyx":84
* cdef PetscDeviceType cdtype
*
* CHKERR(PetscDeviceGetType(self.device, &cdtype)) # <<<<<<<<<<<<<<
* return toDeviceType(cdtype)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceGetType(__pyx_v_self->device, (&__pyx_v_cdtype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 84, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":85
*
* CHKERR(PetscDeviceGetType(self.device, &cdtype))
* return toDeviceType(cdtype) # <<<<<<<<<<<<<<
*
* property type:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toDeviceType(__pyx_v_cdtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":81
* CHKERR(PetscDeviceView(self.device, vwr))
*
* def getDeviceType(self): # <<<<<<<<<<<<<<
* cdef PetscDeviceType cdtype
*
*/
/* 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":88
*
* property type:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_4type___get__(((struct PyPetscDeviceObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_4type___get__(struct PyPetscDeviceObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Device.pyx":89
* property type:
* def __get__(self):
* return self.getDeviceType() # <<<<<<<<<<<<<<
*
* def getDeviceId(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDeviceType); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":88
*
* property type:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getDeviceType()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Device.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":91
* return self.getDeviceType()
*
* def getDeviceId(self): # <<<<<<<<<<<<<<
* cdef PetscInt cdevice_id = 0
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_15getDeviceId(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Device_14getDeviceId[] = "Device.getDeviceId(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_15getDeviceId(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDeviceId (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDeviceId", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDeviceId", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_14getDeviceId(((struct PyPetscDeviceObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_14getDeviceId(struct PyPetscDeviceObject *__pyx_v_self) {
PetscInt __pyx_v_cdevice_id;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDeviceId", 0);
/* "petsc4py/PETSc/Device.pyx":92
*
* def getDeviceId(self):
* cdef PetscInt cdevice_id = 0 # <<<<<<<<<<<<<<
*
* CHKERR(PetscDeviceGetDeviceId(self.device, &cdevice_id))
*/
__pyx_v_cdevice_id = 0;
/* "petsc4py/PETSc/Device.pyx":94
* 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, 94, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":95
*
* CHKERR(PetscDeviceGetDeviceId(self.device, &cdevice_id))
* return toInt(cdevice_id) # <<<<<<<<<<<<<<
*
* property device_id:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cdevice_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":91
* return self.getDeviceType()
*
* def getDeviceId(self): # <<<<<<<<<<<<<<
* cdef PetscInt cdevice_id = 0
*
*/
/* 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":98
*
* property device_id:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_6Device_9device_id___get__(((struct PyPetscDeviceObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Device_9device_id___get__(struct PyPetscDeviceObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Device.pyx":99
* property device_id:
* def __get__(self):
* return self.getDeviceId() # <<<<<<<<<<<<<<
*
* @staticmethod
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDeviceId); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 99, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 99, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":98
*
* property device_id:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getDeviceId()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Device.device_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":102
*
* @staticmethod
* def setDefaultType(device_type): # <<<<<<<<<<<<<<
* cdef PetscDeviceType cdevice_type = asDeviceType(device_type)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_17setDefaultType(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_6Device_16setDefaultType[] = "Device.setDefaultType(device_type)";
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Device_17setDefaultType = {"setDefaultType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_17setDefaultType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_16setDefaultType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Device_17setDefaultType(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_device_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_device_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_device_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDefaultType") < 0)) __PYX_ERR(2, 102, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_device_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDefaultType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 102, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":103
* @staticmethod
* def setDefaultType(device_type):
* 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, 103, __pyx_L1_error)
__pyx_v_cdevice_type = __pyx_t_1;
/* "petsc4py/PETSc/Device.pyx":105
* cdef PetscDeviceType cdevice_type = asDeviceType(device_type)
*
* CHKERR(PetscDeviceSetDefaultDeviceType(cdevice_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, 105, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":102
*
* @staticmethod
* def setDefaultType(device_type): # <<<<<<<<<<<<<<
* cdef PetscDeviceType cdevice_type = asDeviceType(device_type)
*
*/
/* 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":114
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext___cinit__(((struct PyPetscDeviceContextObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_13DeviceContext___cinit__(struct PyPetscDeviceContextObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/Device.pyx":115
*
* 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":116
* def __cinit__(self):
* self.obj = <PetscObject*> &self.dctx
* self.dctx = NULL # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
__pyx_v_self->dctx = NULL;
/* "petsc4py/PETSc/Device.pyx":114
* StreamType = StreamType
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.dctx
* self.dctx = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":118
* self.dctx = NULL
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* self.destroy()
*
*/
/* Python wrapper */
static void __pyx_pw_8petsc4py_5PETSc_13DeviceContext_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8petsc4py_5PETSc_13DeviceContext_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__pyx_pf_8petsc4py_5PETSc_13DeviceContext_2__dealloc__(((struct PyPetscDeviceContextObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_pf_8petsc4py_5PETSc_13DeviceContext_2__dealloc__(struct PyPetscDeviceContextObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__dealloc__", 0);
/* "petsc4py/PETSc/Device.pyx":119
*
* def __dealloc__(self):
* self.destroy() # <<<<<<<<<<<<<<
*
* @classmethod
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Device.pyx":118
* self.dctx = NULL
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* self.destroy()
*
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_WriteUnraisable("petsc4py.PETSc.DeviceContext.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "petsc4py/PETSc/Device.pyx":122
*
* @classmethod
* def create(cls): # <<<<<<<<<<<<<<
* cdef DeviceContext dctx = cls()
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_5create(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_4create[] = "DeviceContext.create(type cls)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_5create(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("create (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("create", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "create", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_4create(((PyTypeObject*)__pyx_v_cls));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_4create(PyTypeObject *__pyx_v_cls) {
struct PyPetscDeviceContextObject *__pyx_v_dctx = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("create", 0);
/* "petsc4py/PETSc/Device.pyx":123
* @classmethod
* def create(cls):
* cdef DeviceContext dctx = cls() # <<<<<<<<<<<<<<
*
* CHKERR(PetscDeviceContextCreate(&dctx.dctx))
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_v_cls)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DeviceContext))))) __PYX_ERR(2, 123, __pyx_L1_error)
__pyx_v_dctx = ((struct PyPetscDeviceContextObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Device.pyx":125
* cdef DeviceContext dctx = cls()
*
* CHKERR(PetscDeviceContextCreate(&dctx.dctx)) # <<<<<<<<<<<<<<
* return dctx
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextCreate((&__pyx_v_dctx->dctx))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 125, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":126
*
* CHKERR(PetscDeviceContextCreate(&dctx.dctx))
* return dctx # <<<<<<<<<<<<<<
*
* def getStreamType(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_dctx));
__pyx_r = ((PyObject *)__pyx_v_dctx);
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":122
*
* @classmethod
* def create(cls): # <<<<<<<<<<<<<<
* cdef DeviceContext dctx = cls()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_dctx);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":128
* return dctx
*
* def getStreamType(self): # <<<<<<<<<<<<<<
* cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT_BLOCKING
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_7getStreamType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_6getStreamType[] = "DeviceContext.getStreamType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_7getStreamType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getStreamType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getStreamType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStreamType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_6getStreamType(((struct PyPetscDeviceContextObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_6getStreamType(struct PyPetscDeviceContextObject *__pyx_v_self) {
PetscStreamType __pyx_v_cstream_type;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getStreamType", 0);
/* "petsc4py/PETSc/Device.pyx":129
*
* def getStreamType(self):
* cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT_BLOCKING # <<<<<<<<<<<<<<
*
* CHKERR(PetscDeviceContextGetStreamType(self.dctx, &cstream_type))
*/
__pyx_v_cstream_type = PETSC_STREAM_DEFAULT_BLOCKING;
/* "petsc4py/PETSc/Device.pyx":131
* cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT_BLOCKING
*
* CHKERR(PetscDeviceContextGetStreamType(self.dctx, &cstream_type)) # <<<<<<<<<<<<<<
* return toStreamType(cstream_type)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextGetStreamType(__pyx_v_self->dctx, (&__pyx_v_cstream_type))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 131, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":132
*
* CHKERR(PetscDeviceContextGetStreamType(self.dctx, &cstream_type))
* return toStreamType(cstream_type) # <<<<<<<<<<<<<<
*
* def setStreamType(self, stream_type):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStreamType(__pyx_v_cstream_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":128
* return dctx
*
* def getStreamType(self): # <<<<<<<<<<<<<<
* cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT_BLOCKING
*
*/
/* 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":134
* return toStreamType(cstream_type)
*
* def setStreamType(self, stream_type): # <<<<<<<<<<<<<<
* cdef PetscStreamType cstream_type = asStreamType(stream_type)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_9setStreamType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_8setStreamType[] = "DeviceContext.setStreamType(self, stream_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_9setStreamType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_stream_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setStreamType") < 0)) __PYX_ERR(2, 134, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_stream_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setStreamType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 134, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":135
*
* def setStreamType(self, stream_type):
* 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, 135, __pyx_L1_error)
__pyx_v_cstream_type = __pyx_t_1;
/* "petsc4py/PETSc/Device.pyx":137
* cdef PetscStreamType cstream_type = asStreamType(stream_type)
*
* CHKERR(PetscDeviceContextSetStreamType(self.dctx, cstream_type)) # <<<<<<<<<<<<<<
*
* property stream_type:
*/
__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, 137, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":134
* return toStreamType(cstream_type)
*
* def setStreamType(self, stream_type): # <<<<<<<<<<<<<<
* cdef PetscStreamType cstream_type = asStreamType(stream_type)
*
*/
/* 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":140
*
* property stream_type:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_11stream_type___get__(((struct PyPetscDeviceContextObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_11stream_type___get__(struct PyPetscDeviceContextObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Device.pyx":141
* property stream_type:
* def __get__(self):
* return self.getStreamType() # <<<<<<<<<<<<<<
*
* def __set__(self, stype):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getStreamType); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":140
*
* property stream_type:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getStreamType()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.stream_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":143
* return self.getStreamType()
*
* def __set__(self, stype): # <<<<<<<<<<<<<<
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_11stream_type_2__set__(((struct PyPetscDeviceContextObject *)__pyx_v_self), ((PyObject *)__pyx_v_stype));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_13DeviceContext_11stream_type_2__set__(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_stype) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Device.pyx":144
*
* def __set__(self, stype):
* self.setStreamType(stype) # <<<<<<<<<<<<<<
*
* def getDevice(self):
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setStreamType); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 144, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_stype) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_stype);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 144, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Device.pyx":143
* return self.getStreamType()
*
* def __set__(self, stype): # <<<<<<<<<<<<<<
* self.setStreamType(stype)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.stream_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":146
* self.setStreamType(stype)
*
* def getDevice(self): # <<<<<<<<<<<<<<
* cdef PetscDevice device = NULL
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_11getDevice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_10getDevice[] = "DeviceContext.getDevice(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_11getDevice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDevice (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDevice", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDevice", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_10getDevice(((struct PyPetscDeviceContextObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_10getDevice(struct PyPetscDeviceContextObject *__pyx_v_self) {
PetscDevice __pyx_v_device;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDevice", 0);
/* "petsc4py/PETSc/Device.pyx":147
*
* def getDevice(self):
* cdef PetscDevice device = NULL # <<<<<<<<<<<<<<
*
* CHKERR(PetscDeviceContextGetDevice(self.dctx, &device))
*/
__pyx_v_device = NULL;
/* "petsc4py/PETSc/Device.pyx":149
* 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, 149, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":150
*
* CHKERR(PetscDeviceContextGetDevice(self.dctx, &device))
* return PyPetscDevice_New(device) # <<<<<<<<<<<<<<
*
* def setDevice(self, Device device not 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, 150, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":146
* self.setStreamType(stype)
*
* def getDevice(self): # <<<<<<<<<<<<<<
* cdef PetscDevice device = NULL
*
*/
/* 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":152
* return PyPetscDevice_New(device)
*
* def setDevice(self, Device device not None): # <<<<<<<<<<<<<<
* cdef PetscDevice cdevice = PyPetscDevice_Get(device)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_13setDevice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_12setDevice[] = "DeviceContext.setDevice(self, Device device)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_13setDevice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscDeviceObject *__pyx_v_device = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_device,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_device)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDevice") < 0)) __PYX_ERR(2, 152, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_device = ((struct PyPetscDeviceObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDevice", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 152, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.setDevice", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_device), __pyx_ptype_8petsc4py_5PETSc_Device, 0, "device", 0))) __PYX_ERR(2, 152, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_12setDevice(((struct PyPetscDeviceContextObject *)__pyx_v_self), __pyx_v_device);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":153
*
* def setDevice(self, Device device not None):
* cdef PetscDevice cdevice = PyPetscDevice_Get(device) # <<<<<<<<<<<<<<
*
* CHKERR(PetscDeviceContextSetDevice(self.dctx, cdevice))
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PyPetscDevice_Get(((PyObject *)__pyx_v_device)); if (unlikely(__pyx_t_1 == ((PetscDevice)NULL) && PyErr_Occurred())) __PYX_ERR(2, 153, __pyx_L1_error)
__pyx_v_cdevice = __pyx_t_1;
/* "petsc4py/PETSc/Device.pyx":155
* cdef PetscDevice cdevice = PyPetscDevice_Get(device)
*
* CHKERR(PetscDeviceContextSetDevice(self.dctx, cdevice)) # <<<<<<<<<<<<<<
*
* property device:
*/
__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, 155, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":152
* return PyPetscDevice_New(device)
*
* def setDevice(self, Device device not None): # <<<<<<<<<<<<<<
* cdef PetscDevice cdevice = PyPetscDevice_Get(device)
*
*/
/* 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":158
*
* property device:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_6device___get__(((struct PyPetscDeviceContextObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_6device___get__(struct PyPetscDeviceContextObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Device.pyx":159
* property device:
* def __get__(self):
* return self.getDevice() # <<<<<<<<<<<<<<
*
* def __set__(self, device):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDevice); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":158
*
* property device:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getDevice()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.device.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":161
* return self.getDevice()
*
* def __set__(self, device): # <<<<<<<<<<<<<<
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_6device_2__set__(((struct PyPetscDeviceContextObject *)__pyx_v_self), ((PyObject *)__pyx_v_device));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_13DeviceContext_6device_2__set__(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_device) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Device.pyx":162
*
* def __set__(self, device):
* self.setDevice(device) # <<<<<<<<<<<<<<
*
* def setUp(self):
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDevice); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_device) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_device);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Device.pyx":161
* return self.getDevice()
*
* def __set__(self, device): # <<<<<<<<<<<<<<
* self.setDevice(device)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.device.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":164
* self.setDevice(device)
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceContextSetUp(self.dctx))
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_15setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_14setUp[] = "DeviceContext.setUp(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_15setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setUp (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_14setUp(((struct PyPetscDeviceContextObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_14setUp(struct PyPetscDeviceContextObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setUp", 0);
/* "petsc4py/PETSc/Device.pyx":165
*
* def setUp(self):
* CHKERR(PetscDeviceContextSetUp(self.dctx)) # <<<<<<<<<<<<<<
*
* def duplicate(self):
*/
__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, 165, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":164
* self.setDevice(device)
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceContextSetUp(self.dctx))
*
*/
/* 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":167
* CHKERR(PetscDeviceContextSetUp(self.dctx))
*
* def duplicate(self): # <<<<<<<<<<<<<<
* cdef PetscDeviceContext octx = NULL
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_17duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_16duplicate[] = "DeviceContext.duplicate(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_17duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("duplicate (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("duplicate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "duplicate", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_16duplicate(((struct PyPetscDeviceContextObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_16duplicate(struct PyPetscDeviceContextObject *__pyx_v_self) {
PetscDeviceContext __pyx_v_octx;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("duplicate", 0);
/* "petsc4py/PETSc/Device.pyx":168
*
* def duplicate(self):
* cdef PetscDeviceContext octx = NULL # <<<<<<<<<<<<<<
*
* CHKERR(PetscDeviceContextDuplicate(self.dctx, &octx))
*/
__pyx_v_octx = NULL;
/* "petsc4py/PETSc/Device.pyx":170
* cdef PetscDeviceContext octx = NULL
*
* CHKERR(PetscDeviceContextDuplicate(self.dctx, &octx)) # <<<<<<<<<<<<<<
* return PyPetscDeviceContext_New(octx)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextDuplicate(__pyx_v_self->dctx, (&__pyx_v_octx))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 170, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":171
*
* CHKERR(PetscDeviceContextDuplicate(self.dctx, &octx))
* return PyPetscDeviceContext_New(octx) # <<<<<<<<<<<<<<
*
* def idle(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_New(__pyx_v_octx)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":167
* CHKERR(PetscDeviceContextSetUp(self.dctx))
*
* def duplicate(self): # <<<<<<<<<<<<<<
* cdef PetscDeviceContext octx = NULL
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":173
* return PyPetscDeviceContext_New(octx)
*
* def idle(self): # <<<<<<<<<<<<<<
* cdef PetscBool is_idle = PETSC_FALSE
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_19idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_18idle[] = "DeviceContext.idle(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_19idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("idle (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("idle", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "idle", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_18idle(((struct PyPetscDeviceContextObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_18idle(struct PyPetscDeviceContextObject *__pyx_v_self) {
PetscBool __pyx_v_is_idle;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("idle", 0);
/* "petsc4py/PETSc/Device.pyx":174
*
* def idle(self):
* cdef PetscBool is_idle = PETSC_FALSE # <<<<<<<<<<<<<<
*
* CHKERR(PetscDeviceContextQueryIdle(self.dctx, &is_idle))
*/
__pyx_v_is_idle = PETSC_FALSE;
/* "petsc4py/PETSc/Device.pyx":176
* 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, 176, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":177
*
* CHKERR(PetscDeviceContextQueryIdle(self.dctx, &is_idle))
* return toBool(is_idle) # <<<<<<<<<<<<<<
*
* def waitFor(self, other):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_is_idle); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 177, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":173
* return PyPetscDeviceContext_New(octx)
*
* def idle(self): # <<<<<<<<<<<<<<
* cdef PetscBool is_idle = PETSC_FALSE
*
*/
/* 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":179
* return toBool(is_idle)
*
* def waitFor(self, other): # <<<<<<<<<<<<<<
* cdef PetscDeviceContext cother = NULL
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_21waitFor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_20waitFor[] = "DeviceContext.waitFor(self, other)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_21waitFor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_other = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "waitFor") < 0)) __PYX_ERR(2, 179, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_other = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("waitFor", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 179, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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;
int __pyx_t_2;
PetscDeviceContext __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("waitFor", 0);
/* "petsc4py/PETSc/Device.pyx":180
*
* def waitFor(self, other):
* cdef PetscDeviceContext cother = NULL # <<<<<<<<<<<<<<
*
* if other is not None:
*/
__pyx_v_cother = NULL;
/* "petsc4py/PETSc/Device.pyx":182
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Device.pyx":183
*
* if other is not None:
* cother = PyPetscDeviceContext_Get(other) # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceContextWaitForContext(self.dctx, cother))
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_Get(__pyx_v_other); if (unlikely(__pyx_t_3 == ((PetscDeviceContext)NULL) && PyErr_Occurred())) __PYX_ERR(2, 183, __pyx_L1_error)
__pyx_v_cother = __pyx_t_3;
/* "petsc4py/PETSc/Device.pyx":182
* cdef PetscDeviceContext cother = NULL
*
* if other is not None: # <<<<<<<<<<<<<<
* cother = PyPetscDeviceContext_Get(other)
* CHKERR(PetscDeviceContextWaitForContext(self.dctx, cother))
*/
}
/* "petsc4py/PETSc/Device.pyx":184
* if other is not None:
* cother = PyPetscDeviceContext_Get(other)
* CHKERR(PetscDeviceContextWaitForContext(self.dctx, cother)) # <<<<<<<<<<<<<<
*
* def fork(self, PetscInt n, stream_type = None):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextWaitForContext(__pyx_v_self->dctx, __pyx_v_cother)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 184, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":179
* return toBool(is_idle)
*
* def waitFor(self, other): # <<<<<<<<<<<<<<
* cdef PetscDeviceContext cother = NULL
*
*/
/* 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":186
* CHKERR(PetscDeviceContextWaitForContext(self.dctx, cother))
*
* def fork(self, PetscInt n, stream_type = None): # <<<<<<<<<<<<<<
* cdef PetscDeviceContext *subctx = NULL
* cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT_BLOCKING
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_23fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_22fork[] = "DeviceContext.fork(self, PetscInt n, stream_type=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_23fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PetscInt __pyx_v_n;
PyObject *__pyx_v_stream_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_stream_type,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream_type);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fork") < 0)) __PYX_ERR(2, 186, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_n = __Pyx_PyInt_As_PetscInt(values[0]); if (unlikely((__pyx_v_n == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(2, 186, __pyx_L3_error)
__pyx_v_stream_type = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("fork", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 186, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_22fork(struct PyPetscDeviceContextObject *__pyx_v_self, PetscInt __pyx_v_n, PyObject *__pyx_v_stream_type) {
PetscDeviceContext *__pyx_v_subctx;
PetscStreamType __pyx_v_cstream_type;
PetscInt __pyx_8genexpr2__pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PetscErrorCode __pyx_t_3;
PetscStreamType __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PetscInt __pyx_t_6;
PetscInt __pyx_t_7;
PetscInt __pyx_t_8;
PyObject *__pyx_t_9 = NULL;
int __pyx_t_10;
int __pyx_t_11;
char const *__pyx_t_12;
PyObject *__pyx_t_13 = NULL;
PyObject *__pyx_t_14 = NULL;
PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
PyObject *__pyx_t_17 = NULL;
PyObject *__pyx_t_18 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("fork", 0);
/* "petsc4py/PETSc/Device.pyx":187
*
* def fork(self, PetscInt n, stream_type = None):
* cdef PetscDeviceContext *subctx = NULL # <<<<<<<<<<<<<<
* cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT_BLOCKING
*
*/
__pyx_v_subctx = NULL;
/* "petsc4py/PETSc/Device.pyx":188
* def fork(self, PetscInt n, stream_type = None):
* cdef PetscDeviceContext *subctx = NULL
* cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT_BLOCKING # <<<<<<<<<<<<<<
*
* try:
*/
__pyx_v_cstream_type = PETSC_STREAM_DEFAULT_BLOCKING;
/* "petsc4py/PETSc/Device.pyx":190
* cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT_BLOCKING
*
* try: # <<<<<<<<<<<<<<
* if stream_type is None:
* CHKERR(PetscDeviceContextFork(self.dctx, n, &subctx))
*/
/*try:*/ {
/* "petsc4py/PETSc/Device.pyx":191
*
* try:
* if stream_type is None: # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceContextFork(self.dctx, n, &subctx))
* else:
*/
__pyx_t_1 = (__pyx_v_stream_type == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Device.pyx":192
* try:
* if stream_type is None:
* CHKERR(PetscDeviceContextFork(self.dctx, n, &subctx)) # <<<<<<<<<<<<<<
* else:
* cstream_type = asStreamType(stream_type)
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextFork(__pyx_v_self->dctx, __pyx_v_n, (&__pyx_v_subctx))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 192, __pyx_L4_error)
/* "petsc4py/PETSc/Device.pyx":191
*
* try:
* if stream_type is None: # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceContextFork(self.dctx, n, &subctx))
* else:
*/
goto __pyx_L6;
}
/* "petsc4py/PETSc/Device.pyx":194
* CHKERR(PetscDeviceContextFork(self.dctx, n, &subctx))
* else:
* cstream_type = asStreamType(stream_type) # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceContextForkWithStreamType(self.dctx, cstream_type, n, &subctx))
*
*/
/*else*/ {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asStreamType(__pyx_v_stream_type); if (unlikely(__pyx_t_4 == ((PetscStreamType)((PetscStreamType)-1L)))) __PYX_ERR(2, 194, __pyx_L4_error)
__pyx_v_cstream_type = __pyx_t_4;
/* "petsc4py/PETSc/Device.pyx":195
* else:
* cstream_type = asStreamType(stream_type)
* CHKERR(PetscDeviceContextForkWithStreamType(self.dctx, cstream_type, n, &subctx)) # <<<<<<<<<<<<<<
*
* return [PyPetscDeviceContext_New(subctx[i]) for i in range(n)]
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextForkWithStreamType(__pyx_v_self->dctx, __pyx_v_cstream_type, __pyx_v_n, (&__pyx_v_subctx))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 195, __pyx_L4_error)
}
__pyx_L6:;
/* "petsc4py/PETSc/Device.pyx":197
* CHKERR(PetscDeviceContextForkWithStreamType(self.dctx, cstream_type, n, &subctx))
*
* return [PyPetscDeviceContext_New(subctx[i]) for i in range(n)] # <<<<<<<<<<<<<<
* finally:
* CHKERR(PetscFree(subctx))
*/
__Pyx_XDECREF(__pyx_r);
{ /* enter inner scope */
__pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 197, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = __pyx_v_n;
__pyx_t_7 = __pyx_t_6;
for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
__pyx_8genexpr2__pyx_v_i = __pyx_t_8;
__pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_New((__pyx_v_subctx[__pyx_8genexpr2__pyx_v_i]))); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 197, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_9);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_9))) __PYX_ERR(2, 197, __pyx_L4_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
} /* exit inner scope */
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L3_return;
}
/* "petsc4py/PETSc/Device.pyx":199
* return [PyPetscDeviceContext_New(subctx[i]) for i in range(n)]
* finally:
* CHKERR(PetscFree(subctx)) # <<<<<<<<<<<<<<
*
* def join(self, join_mode, py_sub_ctxs):
*/
/*finally:*/ {
__pyx_L4_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
__Pyx_XGOTREF(__pyx_t_13);
__Pyx_XGOTREF(__pyx_t_14);
__Pyx_XGOTREF(__pyx_t_15);
__Pyx_XGOTREF(__pyx_t_16);
__Pyx_XGOTREF(__pyx_t_17);
__Pyx_XGOTREF(__pyx_t_18);
__pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
{
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_subctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 199, __pyx_L10_error)
}
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_16);
__Pyx_XGIVEREF(__pyx_t_17);
__Pyx_XGIVEREF(__pyx_t_18);
__Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
}
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_XGIVEREF(__pyx_t_14);
__Pyx_XGIVEREF(__pyx_t_15);
__Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
__pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
__pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
goto __pyx_L1_error;
__pyx_L10_error:;
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_16);
__Pyx_XGIVEREF(__pyx_t_17);
__Pyx_XGIVEREF(__pyx_t_18);
__Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
}
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
__pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
goto __pyx_L1_error;
}
__pyx_L3_return: {
__pyx_t_18 = __pyx_r;
__pyx_r = 0;
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_subctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 199, __pyx_L1_error)
__pyx_r = __pyx_t_18;
__pyx_t_18 = 0;
goto __pyx_L0;
}
}
/* "petsc4py/PETSc/Device.pyx":186
* CHKERR(PetscDeviceContextWaitForContext(self.dctx, cother))
*
* def fork(self, PetscInt n, stream_type = None): # <<<<<<<<<<<<<<
* cdef PetscDeviceContext *subctx = NULL
* cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT_BLOCKING
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.fork", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":201
* CHKERR(PetscFree(subctx))
*
* def join(self, join_mode, py_sub_ctxs): # <<<<<<<<<<<<<<
* cdef PetscDeviceContext *np_subctx_copy = NULL
* cdef PetscDeviceContext *np_subctx = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_25join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_24join[] = "DeviceContext.join(self, join_mode, py_sub_ctxs)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_25join(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_join_mode = 0;
PyObject *__pyx_v_py_sub_ctxs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_join_mode,&__pyx_n_s_py_sub_ctxs,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_join_mode)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_py_sub_ctxs)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("join", 1, 2, 2, 1); __PYX_ERR(2, 201, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "join") < 0)) __PYX_ERR(2, 201, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_join_mode = values[0];
__pyx_v_py_sub_ctxs = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("join", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 201, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_24join(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_join_mode, PyObject *__pyx_v_py_sub_ctxs) {
PetscDeviceContext *__pyx_v_np_subctx_copy;
PetscDeviceContext *__pyx_v_np_subctx;
PetscInt __pyx_v_nsub;
PetscDeviceContextJoinMode __pyx_v_cjoin_mode;
CYTHON_UNUSED PyArrayObject *__pyx_v_tmp = NULL;
PetscInt __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscDeviceContextJoinMode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
char const *__pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
int __pyx_t_13;
PetscInt __pyx_t_14;
PetscInt __pyx_t_15;
PetscInt __pyx_t_16;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("join", 0);
/* "petsc4py/PETSc/Device.pyx":202
*
* def join(self, join_mode, py_sub_ctxs):
* cdef PetscDeviceContext *np_subctx_copy = NULL # <<<<<<<<<<<<<<
* cdef PetscDeviceContext *np_subctx = NULL
* cdef PetscInt nsub = 0
*/
__pyx_v_np_subctx_copy = NULL;
/* "petsc4py/PETSc/Device.pyx":203
* def join(self, join_mode, py_sub_ctxs):
* cdef PetscDeviceContext *np_subctx_copy = NULL
* cdef PetscDeviceContext *np_subctx = NULL # <<<<<<<<<<<<<<
* cdef PetscInt nsub = 0
* cdef PetscDeviceContextJoinMode cjoin_mode = asJoinMode(join_mode)
*/
__pyx_v_np_subctx = NULL;
/* "petsc4py/PETSc/Device.pyx":204
* cdef PetscDeviceContext *np_subctx_copy = NULL
* cdef PetscDeviceContext *np_subctx = NULL
* cdef PetscInt nsub = 0 # <<<<<<<<<<<<<<
* cdef PetscDeviceContextJoinMode cjoin_mode = asJoinMode(join_mode)
*
*/
__pyx_v_nsub = 0;
/* "petsc4py/PETSc/Device.pyx":205
* cdef PetscDeviceContext *np_subctx = NULL
* cdef PetscInt nsub = 0
* cdef PetscDeviceContextJoinMode cjoin_mode = asJoinMode(join_mode) # <<<<<<<<<<<<<<
*
* tmp = oarray_p(py_sub_ctxs, &nsub, <void**>&np_subctx)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asJoinMode(__pyx_v_join_mode); if (unlikely(__pyx_t_1 == ((PetscDeviceContextJoinMode)((PetscDeviceContextJoinMode)-1L)))) __PYX_ERR(2, 205, __pyx_L1_error)
__pyx_v_cjoin_mode = __pyx_t_1;
/* "petsc4py/PETSc/Device.pyx":207
* cdef PetscDeviceContextJoinMode cjoin_mode = asJoinMode(join_mode)
*
* tmp = oarray_p(py_sub_ctxs, &nsub, <void**>&np_subctx) # <<<<<<<<<<<<<<
* try:
* CHKERR(PetscMalloc(<size_t>(nsub) * sizeof(PetscDeviceContext *), &np_subctx_copy))
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_v_py_sub_ctxs, (&__pyx_v_nsub), ((void **)(&__pyx_v_np_subctx)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_tmp = ((PyArrayObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Device.pyx":208
*
* tmp = oarray_p(py_sub_ctxs, &nsub, <void**>&np_subctx)
* try: # <<<<<<<<<<<<<<
* CHKERR(PetscMalloc(<size_t>(nsub) * sizeof(PetscDeviceContext *), &np_subctx_copy))
* CHKERR(PetscMemcpy(np_subctx_copy, np_subctx, <size_t>(nsub) * sizeof(PetscDeviceContext *)))
*/
/*try:*/ {
/* "petsc4py/PETSc/Device.pyx":209
* tmp = oarray_p(py_sub_ctxs, &nsub, <void**>&np_subctx)
* try:
* CHKERR(PetscMalloc(<size_t>(nsub) * sizeof(PetscDeviceContext *), &np_subctx_copy)) # <<<<<<<<<<<<<<
* CHKERR(PetscMemcpy(np_subctx_copy, np_subctx, <size_t>(nsub) * sizeof(PetscDeviceContext *)))
* CHKERR(PetscDeviceContextJoin(self.dctx, nsub, cjoin_mode, &np_subctx_copy))
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_nsub) * (sizeof(PetscDeviceContext *))), (&__pyx_v_np_subctx_copy))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 209, __pyx_L4_error)
/* "petsc4py/PETSc/Device.pyx":210
* try:
* CHKERR(PetscMalloc(<size_t>(nsub) * sizeof(PetscDeviceContext *), &np_subctx_copy))
* CHKERR(PetscMemcpy(np_subctx_copy, np_subctx, <size_t>(nsub) * sizeof(PetscDeviceContext *))) # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceContextJoin(self.dctx, nsub, cjoin_mode, &np_subctx_copy))
* finally:
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMemcpy(__pyx_v_np_subctx_copy, __pyx_v_np_subctx, (((size_t)__pyx_v_nsub) * (sizeof(PetscDeviceContext *))))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 210, __pyx_L4_error)
/* "petsc4py/PETSc/Device.pyx":211
* CHKERR(PetscMalloc(<size_t>(nsub) * sizeof(PetscDeviceContext *), &np_subctx_copy))
* CHKERR(PetscMemcpy(np_subctx_copy, np_subctx, <size_t>(nsub) * sizeof(PetscDeviceContext *)))
* CHKERR(PetscDeviceContextJoin(self.dctx, nsub, cjoin_mode, &np_subctx_copy)) # <<<<<<<<<<<<<<
* finally:
* CHKERR(PetscFree(np_subctx_copy))
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextJoin(__pyx_v_self->dctx, __pyx_v_nsub, __pyx_v_cjoin_mode, (&__pyx_v_np_subctx_copy))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 211, __pyx_L4_error)
}
/* "petsc4py/PETSc/Device.pyx":213
* CHKERR(PetscDeviceContextJoin(self.dctx, nsub, cjoin_mode, &np_subctx_copy))
* finally:
* CHKERR(PetscFree(np_subctx_copy)) # <<<<<<<<<<<<<<
*
* if cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY:
*/
/*finally:*/ {
/*normal exit:*/{
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_np_subctx_copy)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 213, __pyx_L1_error)
goto __pyx_L5;
}
__pyx_L4_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_11);
__Pyx_XGOTREF(__pyx_t_12);
__pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
{
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_np_subctx_copy)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 213, __pyx_L7_error)
}
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
}
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
__pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
__pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
goto __pyx_L1_error;
__pyx_L7_error:;
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
}
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
goto __pyx_L1_error;
}
__pyx_L5:;
}
/* "petsc4py/PETSc/Device.pyx":215
* CHKERR(PetscFree(np_subctx_copy))
*
* if cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY: # <<<<<<<<<<<<<<
* for i in range(nsub):
* py_sub_ctxs[i] = None
*/
__pyx_t_13 = ((__pyx_v_cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY) != 0);
if (__pyx_t_13) {
/* "petsc4py/PETSc/Device.pyx":216
*
* if cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY:
* for i in range(nsub): # <<<<<<<<<<<<<<
* py_sub_ctxs[i] = None
*
*/
__pyx_t_14 = __pyx_v_nsub;
__pyx_t_15 = __pyx_t_14;
for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
__pyx_v_i = __pyx_t_16;
/* "petsc4py/PETSc/Device.pyx":217
* if cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY:
* for i in range(nsub):
* py_sub_ctxs[i] = None # <<<<<<<<<<<<<<
*
* def synchronize(self):
*/
if (unlikely(__Pyx_SetItemInt(__pyx_v_py_sub_ctxs, __pyx_v_i, Py_None, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1) < 0)) __PYX_ERR(2, 217, __pyx_L1_error)
}
/* "petsc4py/PETSc/Device.pyx":215
* CHKERR(PetscFree(np_subctx_copy))
*
* if cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY: # <<<<<<<<<<<<<<
* for i in range(nsub):
* py_sub_ctxs[i] = None
*/
}
/* "petsc4py/PETSc/Device.pyx":201
* CHKERR(PetscFree(subctx))
*
* def join(self, join_mode, py_sub_ctxs): # <<<<<<<<<<<<<<
* cdef PetscDeviceContext *np_subctx_copy = NULL
* cdef PetscDeviceContext *np_subctx = NULL
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tmp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":219
* py_sub_ctxs[i] = None
*
* def synchronize(self): # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceContextSynchronize(self.dctx))
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_27synchronize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_26synchronize[] = "DeviceContext.synchronize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_27synchronize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("synchronize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("synchronize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "synchronize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_26synchronize(((struct PyPetscDeviceContextObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_26synchronize(struct PyPetscDeviceContextObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("synchronize", 0);
/* "petsc4py/PETSc/Device.pyx":220
*
* def synchronize(self):
* CHKERR(PetscDeviceContextSynchronize(self.dctx)) # <<<<<<<<<<<<<<
*
* def setFromOptions(self, comm = 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, 220, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":219
* py_sub_ctxs[i] = None
*
* def synchronize(self): # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceContextSynchronize(self.dctx))
*
*/
/* 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":222
* CHKERR(PetscDeviceContextSynchronize(self.dctx))
*
* def setFromOptions(self, comm = None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_29setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_28setFromOptions[] = "DeviceContext.setFromOptions(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_29setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFromOptions") < 0)) __PYX_ERR(2, 222, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFromOptions", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 222, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":223
*
* def setFromOptions(self, comm = None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) # <<<<<<<<<<<<<<
*
* CHKERR(PetscDeviceContextSetFromOptions(ccomm, self.dctx))
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, PETSC_COMM_SELF); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 223, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Device.pyx":225
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF)
*
* CHKERR(PetscDeviceContextSetFromOptions(ccomm, self.dctx)) # <<<<<<<<<<<<<<
*
* def viewFromOptions(self, name, Object obj = None):
*/
__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, 225, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":222
* CHKERR(PetscDeviceContextSynchronize(self.dctx))
*
* def setFromOptions(self, comm = None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF)
*
*/
/* 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":227
* CHKERR(PetscDeviceContextSetFromOptions(ccomm, self.dctx))
*
* def viewFromOptions(self, name, Object obj = None): # <<<<<<<<<<<<<<
* cdef const char *cname = NULL
* cdef PetscObject cobj = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_31viewFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_30viewFromOptions[] = "DeviceContext.viewFromOptions(self, name, Object obj=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_31viewFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
struct PyPetscObjectObject *__pyx_v_obj = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_obj,0};
PyObject* values[2] = {0,0};
values[1] = (PyObject *)((struct PyPetscObjectObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "viewFromOptions") < 0)) __PYX_ERR(2, 227, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_obj = ((struct PyPetscObjectObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("viewFromOptions", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 227, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "obj", 0))) __PYX_ERR(2, 227, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_30viewFromOptions(((struct PyPetscDeviceContextObject *)__pyx_v_self), __pyx_v_name, __pyx_v_obj);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_30viewFromOptions(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj) {
char const *__pyx_v_cname;
PetscObject __pyx_v_cobj;
CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("viewFromOptions", 0);
/* "petsc4py/PETSc/Device.pyx":228
*
* def viewFromOptions(self, name, Object obj = None):
* cdef const char *cname = NULL # <<<<<<<<<<<<<<
* cdef PetscObject cobj = NULL
*
*/
__pyx_v_cname = NULL;
/* "petsc4py/PETSc/Device.pyx":229
* def viewFromOptions(self, name, Object obj = None):
* cdef const char *cname = NULL
* cdef PetscObject cobj = NULL # <<<<<<<<<<<<<<
*
* if obj is not None:
*/
__pyx_v_cobj = NULL;
/* "petsc4py/PETSc/Device.pyx":231
* cdef PetscObject cobj = NULL
*
* if obj is not None: # <<<<<<<<<<<<<<
* cobj = obj.obj[0]
*
*/
__pyx_t_1 = (((PyObject *)__pyx_v_obj) != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Device.pyx":232
*
* if obj is not None:
* cobj = obj.obj[0] # <<<<<<<<<<<<<<
*
* _ = str2bytes(name, &cname)
*/
__pyx_v_cobj = (__pyx_v_obj->obj[0]);
/* "petsc4py/PETSc/Device.pyx":231
* cdef PetscObject cobj = NULL
*
* if obj is not None: # <<<<<<<<<<<<<<
* cobj = obj.obj[0]
*
*/
}
/* "petsc4py/PETSc/Device.pyx":234
* cobj = obj.obj[0]
*
* _ = str2bytes(name, &cname) # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceContextViewFromOptions(self.dctx, cobj, cname))
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 234, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v__ = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Device.pyx":235
*
* _ = str2bytes(name, &cname)
* CHKERR(PetscDeviceContextViewFromOptions(self.dctx, cobj, cname)) # <<<<<<<<<<<<<<
*
* @staticmethod
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextViewFromOptions(__pyx_v_self->dctx, __pyx_v_cobj, __pyx_v_cname)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 235, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":227
* CHKERR(PetscDeviceContextSetFromOptions(ccomm, self.dctx))
*
* def viewFromOptions(self, name, Object obj = None): # <<<<<<<<<<<<<<
* cdef const char *cname = NULL
* cdef PetscObject cobj = NULL
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v__);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":238
*
* @staticmethod
* def getCurrent(): # <<<<<<<<<<<<<<
* cdef PetscDeviceContext dctx = NULL
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_33getCurrent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_32getCurrent[] = "DeviceContext.getCurrent()";
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_33getCurrent = {"getCurrent", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_33getCurrent, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_32getCurrent};
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_33getCurrent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getCurrent (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getCurrent", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCurrent", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_32getCurrent();
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_32getCurrent(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":239
* @staticmethod
* def getCurrent():
* cdef PetscDeviceContext dctx = NULL # <<<<<<<<<<<<<<
*
* CHKERR(PetscDeviceContextGetCurrentContext(&dctx))
*/
__pyx_v_dctx = NULL;
/* "petsc4py/PETSc/Device.pyx":241
* 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, 241, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":242
*
* 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, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":238
*
* @staticmethod
* def getCurrent(): # <<<<<<<<<<<<<<
* cdef PetscDeviceContext dctx = NULL
*
*/
/* 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":245
*
* @staticmethod
* def setCurrent(dctx): # <<<<<<<<<<<<<<
* cdef PetscDeviceContext cdctx = NULL
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_35setCurrent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_13DeviceContext_34setCurrent[] = "DeviceContext.setCurrent(dctx)";
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_35setCurrent = {"setCurrent", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_35setCurrent, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_34setCurrent};
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_35setCurrent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_dctx = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dctx,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dctx)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCurrent") < 0)) __PYX_ERR(2, 245, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_dctx = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setCurrent", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 245, __pyx_L3_error)
__pyx_L3_error:;
__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_34setCurrent(__pyx_v_dctx);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_34setCurrent(PyObject *__pyx_v_dctx) {
PetscDeviceContext __pyx_v_cdctx;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PetscDeviceContext __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setCurrent", 0);
/* "petsc4py/PETSc/Device.pyx":246
* @staticmethod
* def setCurrent(dctx):
* cdef PetscDeviceContext cdctx = NULL # <<<<<<<<<<<<<<
*
* if dctx is not None:
*/
__pyx_v_cdctx = NULL;
/* "petsc4py/PETSc/Device.pyx":248
* cdef PetscDeviceContext cdctx = NULL
*
* if dctx is not None: # <<<<<<<<<<<<<<
* cdctx = PyPetscDeviceContext_Get(dctx)
* CHKERR(PetscDeviceContextSetCurrentContext(cdctx))
*/
__pyx_t_1 = (__pyx_v_dctx != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Device.pyx":249
*
* if dctx is not None:
* cdctx = PyPetscDeviceContext_Get(dctx) # <<<<<<<<<<<<<<
* CHKERR(PetscDeviceContextSetCurrentContext(cdctx))
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_Get(__pyx_v_dctx); if (unlikely(__pyx_t_3 == ((PetscDeviceContext)NULL) && PyErr_Occurred())) __PYX_ERR(2, 249, __pyx_L1_error)
__pyx_v_cdctx = __pyx_t_3;
/* "petsc4py/PETSc/Device.pyx":248
* cdef PetscDeviceContext cdctx = NULL
*
* if dctx is not None: # <<<<<<<<<<<<<<
* cdctx = PyPetscDeviceContext_Get(dctx)
* CHKERR(PetscDeviceContextSetCurrentContext(cdctx))
*/
}
/* "petsc4py/PETSc/Device.pyx":250
* if dctx is not None:
* cdctx = PyPetscDeviceContext_Get(dctx)
* CHKERR(PetscDeviceContextSetCurrentContext(cdctx)) # <<<<<<<<<<<<<<
*
* property current:
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextSetCurrentContext(__pyx_v_cdctx)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 250, __pyx_L1_error)
/* "petsc4py/PETSc/Device.pyx":245
*
* @staticmethod
* def setCurrent(dctx): # <<<<<<<<<<<<<<
* cdef PetscDeviceContext cdctx = NULL
*
*/
/* 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":253
*
* property current:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_7current___get__(((struct PyPetscDeviceContextObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_7current___get__(struct PyPetscDeviceContextObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Device.pyx":254
* property current:
* def __get__(self):
* return self.getCurrent() # <<<<<<<<<<<<<<
*
* def __set__(self, dctx):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getCurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 254, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 254, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Device.pyx":253
*
* property current:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getCurrent()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.current.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Device.pyx":256
* return self.getCurrent()
*
* def __set__(self, dctx): # <<<<<<<<<<<<<<
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_7current_2__set__(((struct PyPetscDeviceContextObject *)__pyx_v_self), ((PyObject *)__pyx_v_dctx));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_13DeviceContext_7current_2__set__(struct PyPetscDeviceContextObject *__pyx_v_self, PyObject *__pyx_v_dctx) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Device.pyx":257
*
* def __set__(self, dctx):
* self.setCurrent(dctx) # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setCurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_dctx) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dctx);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Device.pyx":256
* return self.getCurrent()
*
* def __set__(self, dctx): # <<<<<<<<<<<<<<
* self.setCurrent(dctx)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.current.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":16
* #
*
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS___cinit__(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_2IS___cinit__(struct PyPetscISObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/IS.pyx":17
*
* 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":18
* def __cinit__(self):
* self.obj = <PetscObject*> &self.iset
* self.iset = NULL # <<<<<<<<<<<<<<
*
* # buffer interface (PEP 3118)
*/
__pyx_v_self->iset = NULL;
/* "petsc4py/PETSc/IS.pyx":16
* #
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.iset
* self.iset = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":22
* # 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 */
static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_2IS_3__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_2IS_3__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_2__getbuffer__(((struct PyPetscISObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_view), ((int)__pyx_v_flags));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_2IS_2__getbuffer__(struct PyPetscISObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) {
struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_buf = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
if (__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":23
*
* def __getbuffer__(self, Py_buffer *view, int flags):
* cdef _IS_buffer buf = _IS_buffer(self) # <<<<<<<<<<<<<<
* buf.acquirebuffer(view, flags)
*
*/
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__IS_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 23, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/IS.pyx":24
* def __getbuffer__(self, Py_buffer *view, int flags):
* cdef _IS_buffer buf = _IS_buffer(self)
* buf.acquirebuffer(view, flags) # <<<<<<<<<<<<<<
*
* def __releasebuffer__(self, Py_buffer *view):
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_buf->__pyx_vtab)->acquirebuffer(__pyx_v_buf, __pyx_v_view, __pyx_v_flags); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 24, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":22
* # buffer interface (PEP 3118)
*
* def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<<
* cdef _IS_buffer buf = _IS_buffer(self)
* buf.acquirebuffer(view, flags)
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.IS.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
if (__pyx_v_view->obj != NULL) {
__Pyx_GOTREF(__pyx_v_view->obj);
__Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0;
}
goto __pyx_L2;
__pyx_L0:;
if (__pyx_v_view->obj == Py_None) {
__Pyx_GOTREF(__pyx_v_view->obj);
__Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0;
}
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_buf);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":26
* buf.acquirebuffer(view, flags)
*
* def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<<
* cdef _IS_buffer buf = <_IS_buffer>(view.obj)
* buf.releasebuffer(view)
*/
/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_2IS_5__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view); /*proto*/
static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_2IS_5__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
__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":27
*
* 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":28
* 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(38, 28, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":29
* cdef _IS_buffer buf = <_IS_buffer>(view.obj)
* buf.releasebuffer(view)
* <void>self # unused # <<<<<<<<<<<<<<
*
*
*/
((void)__pyx_v_self);
/* "petsc4py/PETSc/IS.pyx":26
* 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":34
* # '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, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_6__enter__[] = "IS.__enter__(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_7__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_6__enter__(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_6__enter__(struct PyPetscISObject *__pyx_v_self) {
struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_buf = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__enter__", 0);
/* "petsc4py/PETSc/IS.pyx":35
*
* def __enter__(self):
* cdef _IS_buffer buf = _IS_buffer(self) # <<<<<<<<<<<<<<
* self.set_attr('__buffer__', buf)
* return buf.enter()
*/
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__IS_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 35, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/IS.pyx":36
* 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(38, 36, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/IS.pyx":37
* 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(38, 37, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":34
* # 'with' statement (PEP 343)
*
* def __enter__(self): # <<<<<<<<<<<<<<
* cdef _IS_buffer buf = _IS_buffer(self)
* self.set_attr('__buffer__', buf)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.IS.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_buf);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":39
* 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*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_8__exit__[] = "IS.__exit__(self, *exc)";
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;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_exc = __pyx_args;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_8__exit__(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_exc);
/* function exit code */
__Pyx_XDECREF(__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":40
*
* 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(38, 40, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc__IS_buffer))))) __PYX_ERR(38, 40, __pyx_L1_error)
__pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/IS.pyx":41
* 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(38, 41, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/IS.pyx":42
* 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(38, 42, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":39
* 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":45
* #
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer cviewer = NULL
* if viewer is not None: cviewer = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_11view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_10view[] = "IS.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_11view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(38, 45, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 45, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(38, 45, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_10view(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/IS.pyx":46
*
* def view(self, Viewer viewer=None):
* 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":47
* def view(self, Viewer viewer=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_cviewer = __pyx_t_3;
}
/* "petsc4py/PETSc/IS.pyx":48
* cdef PetscViewer cviewer = NULL
* if viewer is not None: cviewer = viewer.vwr
* CHKERR( ISView(self.iset, cviewer) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISView(__pyx_v_self->iset, __pyx_v_cviewer)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 48, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":45
* #
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer cviewer = NULL
* if viewer is not None: cviewer = viewer.vwr
*/
/* 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":50
* CHKERR( ISView(self.iset, cviewer) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( ISDestroy(&self.iset) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_13destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_12destroy[] = "IS.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_13destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_12destroy(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_12destroy(struct PyPetscISObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/IS.pyx":51
*
* def destroy(self):
* 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(38, 51, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":52
* def destroy(self):
* CHKERR( ISDestroy(&self.iset) )
* return self # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":50
* CHKERR( ISView(self.iset, cviewer) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( ISDestroy(&self.iset) )
* return self
*/
/* 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":54
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscIS newiset = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_15create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_14create[] = "IS.create(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_15create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(38, 54, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 54, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":55
*
* def create(self, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(38, 55, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/IS.pyx":56
* def create(self, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscIS newiset = NULL # <<<<<<<<<<<<<<
* CHKERR( ISCreate(ccomm, &newiset) )
* PetscCLEAR(self.obj); self.iset = newiset
*/
__pyx_v_newiset = NULL;
/* "petsc4py/PETSc/IS.pyx":57
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscIS newiset = NULL
* CHKERR( ISCreate(ccomm, &newiset) ) # <<<<<<<<<<<<<<
* 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(38, 57, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":58
* cdef PetscIS newiset = NULL
* CHKERR( ISCreate(ccomm, &newiset) )
* PetscCLEAR(self.obj); self.iset = newiset # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->iset = __pyx_v_newiset;
/* "petsc4py/PETSc/IS.pyx":59
* CHKERR( ISCreate(ccomm, &newiset) )
* PetscCLEAR(self.obj); self.iset = newiset
* return self # <<<<<<<<<<<<<<
*
* def setType(self, is_type):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":54
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscIS newiset = NULL
*/
/* 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":61
* return self
*
* def setType(self, is_type): # <<<<<<<<<<<<<<
* cdef PetscISType cval = NULL
* is_type = str2bytes(is_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_17setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_16setType[] = "IS.setType(self, is_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_17setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_is_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_is_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(38, 61, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_is_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 61, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":62
*
* def setType(self, is_type):
* cdef PetscISType cval = NULL # <<<<<<<<<<<<<<
* is_type = str2bytes(is_type, &cval)
* CHKERR( ISSetType(self.iset, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/IS.pyx":63
* def setType(self, is_type):
* 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(38, 63, __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":64
* cdef PetscISType cval = NULL
* is_type = str2bytes(is_type, &cval)
* CHKERR( ISSetType(self.iset, cval) ) # <<<<<<<<<<<<<<
*
* def getType(self):
*/
__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(38, 64, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":61
* return self
*
* def setType(self, is_type): # <<<<<<<<<<<<<<
* cdef PetscISType cval = NULL
* is_type = str2bytes(is_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":66
* CHKERR( ISSetType(self.iset, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscISType cval = NULL
* CHKERR( ISGetType(self.iset, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_19getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_18getType[] = "IS.getType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_19getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_18getType(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_18getType(struct PyPetscISObject *__pyx_v_self) {
ISType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getType", 0);
/* "petsc4py/PETSc/IS.pyx":67
*
* def getType(self):
* cdef PetscISType cval = NULL # <<<<<<<<<<<<<<
* CHKERR( ISGetType(self.iset, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/IS.pyx":68
* def getType(self):
* 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(38, 68, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":69
* cdef PetscISType cval = NULL
* CHKERR( ISGetType(self.iset, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def createGeneral(self, indices, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 69, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":66
* CHKERR( ISSetType(self.iset, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscISType cval = NULL
* CHKERR( ISGetType(self.iset, &cval) )
*/
/* 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":71
* return bytes2str(cval)
*
* def createGeneral(self, indices, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt nidx = 0, *idx = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_21createGeneral(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_20createGeneral[] = "IS.createGeneral(self, indices, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_21createGeneral(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_indices = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_comm,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createGeneral") < 0)) __PYX_ERR(38, 71, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_indices = values[0];
__pyx_v_comm = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createGeneral", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 71, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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":72
*
* def createGeneral(self, indices, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(38, 72, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/IS.pyx":73
* def createGeneral(self, indices, comm=None):
* 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":74
* 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":75
* 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":76
* cdef PetscCopyMode cm = PETSC_COPY_VALUES
* cdef PetscIS newiset = NULL
* indices = iarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<<
* CHKERR( ISCreateGeneral(ccomm, nidx, idx, cm, &newiset) )
* 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(38, 76, __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":77
* cdef PetscIS newiset = NULL
* indices = iarray_i(indices, &nidx, &idx)
* CHKERR( ISCreateGeneral(ccomm, nidx, idx, cm, &newiset) ) # <<<<<<<<<<<<<<
* 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(38, 77, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":78
* indices = iarray_i(indices, &nidx, &idx)
* CHKERR( ISCreateGeneral(ccomm, nidx, idx, cm, &newiset) )
* PetscCLEAR(self.obj); self.iset = newiset # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->iset = __pyx_v_newiset;
/* "petsc4py/PETSc/IS.pyx":79
* CHKERR( ISCreateGeneral(ccomm, nidx, idx, cm, &newiset) )
* PetscCLEAR(self.obj); self.iset = newiset
* return self # <<<<<<<<<<<<<<
*
* def createBlock(self, bsize, indices, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":71
* return bytes2str(cval)
*
* def createGeneral(self, indices, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt nidx = 0, *idx = NULL
*/
/* 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":81
* return self
*
* def createBlock(self, bsize, indices, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt bs = asInt(bsize)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_23createBlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_22createBlock[] = "IS.createBlock(self, bsize, indices, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_23createBlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_bsize = 0;
PyObject *__pyx_v_indices = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bsize,&__pyx_n_s_indices,&__pyx_n_s_comm,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createBlock", 0, 2, 3, 1); __PYX_ERR(38, 81, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createBlock") < 0)) __PYX_ERR(38, 81, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_bsize = values[0];
__pyx_v_indices = values[1];
__pyx_v_comm = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createBlock", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 81, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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":82
*
* def createBlock(self, bsize, indices, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(38, 82, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/IS.pyx":83
* def createBlock(self, bsize, indices, comm=None):
* 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(38, 83, __pyx_L1_error)
__pyx_v_bs = __pyx_t_2;
/* "petsc4py/PETSc/IS.pyx":84
* 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":85
* 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":86
* 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":87
* cdef PetscCopyMode cm = PETSC_COPY_VALUES
* cdef PetscIS newiset = NULL
* indices = iarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<<
* CHKERR( ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset) )
* 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(38, 87, __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":88
* cdef PetscIS newiset = NULL
* indices = iarray_i(indices, &nidx, &idx)
* CHKERR( ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset) ) # <<<<<<<<<<<<<<
* 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(38, 88, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":89
* indices = iarray_i(indices, &nidx, &idx)
* CHKERR( ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset) )
* PetscCLEAR(self.obj); self.iset = newiset # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->iset = __pyx_v_newiset;
/* "petsc4py/PETSc/IS.pyx":90
* CHKERR( ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset) )
* PetscCLEAR(self.obj); self.iset = newiset
* return self # <<<<<<<<<<<<<<
*
* def createStride(self, size, first=0, step=0, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":81
* return self
*
* def createBlock(self, bsize, indices, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt bs = asInt(bsize)
*/
/* 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":92
* return self
*
* def createStride(self, size, first=0, step=0, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt csize = asInt(size)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_25createStride(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_24createStride[] = "IS.createStride(self, size, first=0, step=0, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_25createStride(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_size = 0;
PyObject *__pyx_v_first = 0;
PyObject *__pyx_v_step = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_first,&__pyx_n_s_step,&__pyx_n_s_comm,0};
PyObject* values[4] = {0,0,0,0};
values[1] = ((PyObject *)__pyx_int_0);
values[2] = ((PyObject *)__pyx_int_0);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_first);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createStride") < 0)) __PYX_ERR(38, 92, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_first = values[1];
__pyx_v_step = values[2];
__pyx_v_comm = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createStride", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 92, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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":93
*
* def createStride(self, size, first=0, step=0, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(38, 93, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/IS.pyx":94
* def createStride(self, size, first=0, step=0, comm=None):
* 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(38, 94, __pyx_L1_error)
__pyx_v_csize = __pyx_t_2;
/* "petsc4py/PETSc/IS.pyx":95
* 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(38, 95, __pyx_L1_error)
__pyx_v_cfirst = __pyx_t_2;
/* "petsc4py/PETSc/IS.pyx":96
* 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(38, 96, __pyx_L1_error)
__pyx_v_cstep = __pyx_t_2;
/* "petsc4py/PETSc/IS.pyx":97
* cdef PetscInt cfirst = asInt(first)
* cdef PetscInt cstep = asInt(step)
* cdef PetscIS newiset = NULL # <<<<<<<<<<<<<<
* CHKERR( ISCreateStride(ccomm, csize, cfirst, cstep, &newiset) )
* PetscCLEAR(self.obj); self.iset = newiset
*/
__pyx_v_newiset = NULL;
/* "petsc4py/PETSc/IS.pyx":98
* cdef PetscInt cstep = asInt(step)
* cdef PetscIS newiset = NULL
* CHKERR( ISCreateStride(ccomm, csize, cfirst, cstep, &newiset) ) # <<<<<<<<<<<<<<
* 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(38, 98, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":99
* cdef PetscIS newiset = NULL
* CHKERR( ISCreateStride(ccomm, csize, cfirst, cstep, &newiset) )
* PetscCLEAR(self.obj); self.iset = newiset # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->iset = __pyx_v_newiset;
/* "petsc4py/PETSc/IS.pyx":100
* CHKERR( ISCreateStride(ccomm, csize, cfirst, cstep, &newiset) )
* PetscCLEAR(self.obj); self.iset = newiset
* return self # <<<<<<<<<<<<<<
*
* def duplicate(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":92
* return self
*
* def createStride(self, size, first=0, step=0, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt csize = asInt(size)
*/
/* 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":102
* return self
*
* def duplicate(self): # <<<<<<<<<<<<<<
* cdef IS iset = type(self)()
* CHKERR( ISDuplicate(self.iset, &iset.iset) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_27duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_26duplicate[] = "IS.duplicate(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_27duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("duplicate (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("duplicate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "duplicate", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_26duplicate(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_26duplicate(struct PyPetscISObject *__pyx_v_self) {
struct PyPetscISObject *__pyx_v_iset = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("duplicate", 0);
/* "petsc4py/PETSc/IS.pyx":103
*
* def duplicate(self):
* cdef IS iset = type(self)() # <<<<<<<<<<<<<<
* CHKERR( ISDuplicate(self.iset, &iset.iset) )
* return iset
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(38, 103, __pyx_L1_error)
__pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/IS.pyx":104
* def duplicate(self):
* cdef IS iset = type(self)()
* CHKERR( ISDuplicate(self.iset, &iset.iset) ) # <<<<<<<<<<<<<<
* return iset
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDuplicate(__pyx_v_self->iset, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 104, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":105
* cdef IS iset = type(self)()
* CHKERR( ISDuplicate(self.iset, &iset.iset) )
* return iset # <<<<<<<<<<<<<<
*
* def copy(self, IS result=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_iset));
__pyx_r = ((PyObject *)__pyx_v_iset);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":102
* return self
*
* def duplicate(self): # <<<<<<<<<<<<<<
* cdef IS iset = type(self)()
* CHKERR( ISDuplicate(self.iset, &iset.iset) )
*/
/* 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":107
* return iset
*
* def copy(self, IS result=None): # <<<<<<<<<<<<<<
* if result is None:
* result = type(self)()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_29copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_28copy[] = "IS.copy(self, IS result=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_29copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_result = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscISObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy") < 0)) __PYX_ERR(38, 107, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_result = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("copy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 107, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "result", 0))) __PYX_ERR(38, 107, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_28copy(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_result);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PetscErrorCode __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("copy", 0);
__Pyx_INCREF((PyObject *)__pyx_v_result);
/* "petsc4py/PETSc/IS.pyx":108
*
* def copy(self, IS result=None):
* if result is None: # <<<<<<<<<<<<<<
* result = type(self)()
* if result.iset == NULL:
*/
__pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/IS.pyx":109
* def copy(self, IS result=None):
* if result is None:
* result = type(self)() # <<<<<<<<<<<<<<
* if result.iset == NULL:
* CHKERR( ISDuplicate(self.iset, &result.iset) )
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(38, 109, __pyx_L1_error)
__Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscISObject *)__pyx_t_3));
__pyx_t_3 = 0;
/* "petsc4py/PETSc/IS.pyx":108
*
* def copy(self, IS result=None):
* if result is None: # <<<<<<<<<<<<<<
* result = type(self)()
* if result.iset == NULL:
*/
}
/* "petsc4py/PETSc/IS.pyx":110
* 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_2 = ((__pyx_v_result->iset == NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/IS.pyx":111
* 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(38, 111, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":110
* 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":112
* 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(38, 112, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":113
* CHKERR( ISDuplicate(self.iset, &result.iset) )
* CHKERR( ISCopy(self.iset, result.iset) )
* return result # <<<<<<<<<<<<<<
*
* def load(self, Viewer viewer):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":107
* return iset
*
* def copy(self, IS result=None): # <<<<<<<<<<<<<<
* if result is None:
* result = type(self)()
*/
/* 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.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":115
* return result
*
* def load(self, Viewer viewer): # <<<<<<<<<<<<<<
* cdef MPI_Comm comm = MPI_COMM_NULL
* cdef PetscObject obj = <PetscObject>(viewer.vwr)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_31load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_30load[] = "IS.load(self, Viewer viewer)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_31load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load") < 0)) __PYX_ERR(38, 115, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 115, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(38, 115, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_30load(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":116
*
* def load(self, Viewer viewer):
* 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":117
* def load(self, Viewer viewer):
* 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":118
* 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) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/IS.pyx":119
* 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(38, 119, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":120
* 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(38, 120, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":118
* 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":121
* 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(38, 121, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":122
* CHKERR( ISCreate(comm, &self.iset) )
* CHKERR( ISLoad(self.iset, viewer.vwr) )
* return self # <<<<<<<<<<<<<<
*
* def allGather(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":115
* return result
*
* def load(self, Viewer viewer): # <<<<<<<<<<<<<<
* cdef MPI_Comm comm = MPI_COMM_NULL
* cdef PetscObject obj = <PetscObject>(viewer.vwr)
*/
/* 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":124
* return self
*
* def allGather(self): # <<<<<<<<<<<<<<
* cdef IS iset = IS()
* CHKERR( ISAllGather(self.iset, &iset.iset) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_33allGather(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_32allGather[] = "IS.allGather(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_33allGather(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("allGather (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("allGather", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "allGather", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_32allGather(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_32allGather(struct PyPetscISObject *__pyx_v_self) {
struct PyPetscISObject *__pyx_v_iset = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("allGather", 0);
/* "petsc4py/PETSc/IS.pyx":125
*
* def allGather(self):
* cdef IS iset = IS() # <<<<<<<<<<<<<<
* CHKERR( ISAllGather(self.iset, &iset.iset) )
* return iset
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 125, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/IS.pyx":126
* def allGather(self):
* cdef IS iset = IS()
* CHKERR( ISAllGather(self.iset, &iset.iset) ) # <<<<<<<<<<<<<<
* return iset
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISAllGather(__pyx_v_self->iset, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 126, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":127
* cdef IS iset = IS()
* CHKERR( ISAllGather(self.iset, &iset.iset) )
* return iset # <<<<<<<<<<<<<<
*
* def toGeneral(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_iset));
__pyx_r = ((PyObject *)__pyx_v_iset);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":124
* return self
*
* def allGather(self): # <<<<<<<<<<<<<<
* cdef IS iset = IS()
* CHKERR( ISAllGather(self.iset, &iset.iset) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.IS.allGather", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_iset);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":129
* return iset
*
* def toGeneral(self): # <<<<<<<<<<<<<<
* CHKERR( ISToGeneral(self.iset) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_35toGeneral(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_34toGeneral[] = "IS.toGeneral(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_35toGeneral(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("toGeneral (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("toGeneral", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "toGeneral", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_34toGeneral(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_34toGeneral(struct PyPetscISObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("toGeneral", 0);
/* "petsc4py/PETSc/IS.pyx":130
*
* def toGeneral(self):
* 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(38, 130, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":131
* def toGeneral(self):
* CHKERR( ISToGeneral(self.iset) )
* return self # <<<<<<<<<<<<<<
*
* def buildTwoSided(self, IS toindx=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":129
* return iset
*
* def toGeneral(self): # <<<<<<<<<<<<<<
* CHKERR( ISToGeneral(self.iset) )
* return self
*/
/* 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":133
* return self
*
* def buildTwoSided(self, IS toindx=None): # <<<<<<<<<<<<<<
* cdef PetscIS ctoindx = NULL
* if toindx is not None: ctoindx = toindx.iset
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_37buildTwoSided(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_36buildTwoSided[] = "IS.buildTwoSided(self, IS toindx=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_37buildTwoSided(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_toindx = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_toindx,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscISObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_toindx);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildTwoSided") < 0)) __PYX_ERR(38, 133, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_toindx = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("buildTwoSided", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 133, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.buildTwoSided", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_toindx), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "toindx", 0))) __PYX_ERR(38, 133, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_36buildTwoSided(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_toindx);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
IS __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("buildTwoSided", 0);
/* "petsc4py/PETSc/IS.pyx":134
*
* def buildTwoSided(self, IS toindx=None):
* cdef PetscIS ctoindx = NULL # <<<<<<<<<<<<<<
* if toindx is not None: ctoindx = toindx.iset
* cdef IS result = IS()
*/
__pyx_v_ctoindx = NULL;
/* "petsc4py/PETSc/IS.pyx":135
* def buildTwoSided(self, IS toindx=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_toindx->iset;
__pyx_v_ctoindx = __pyx_t_3;
}
/* "petsc4py/PETSc/IS.pyx":136
* 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 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 136, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_result = ((struct PyPetscISObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/IS.pyx":137
* if toindx is not None: ctoindx = toindx.iset
* cdef IS result = IS()
* CHKERR( ISBuildTwoSided(self.iset, ctoindx, &result.iset) ) # <<<<<<<<<<<<<<
* return result
*
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISBuildTwoSided(__pyx_v_self->iset, __pyx_v_ctoindx, (&__pyx_v_result->iset))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 137, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":138
* cdef IS result = IS()
* CHKERR( ISBuildTwoSided(self.iset, ctoindx, &result.iset) )
* return result # <<<<<<<<<<<<<<
*
* def invertPermutation(self, nlocal=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":133
* return self
*
* def buildTwoSided(self, IS toindx=None): # <<<<<<<<<<<<<<
* cdef PetscIS ctoindx = NULL
* if toindx is not None: ctoindx = toindx.iset
*/
/* function exit code */
__pyx_L1_error:;
__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":140
* return result
*
* def invertPermutation(self, nlocal=None): # <<<<<<<<<<<<<<
* cdef PetscInt cnlocal = PETSC_DECIDE
* if nlocal is not None: cnlocal = asInt(nlocal)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_39invertPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_38invertPermutation[] = "IS.invertPermutation(self, nlocal=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_39invertPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_nlocal = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nlocal,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nlocal);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "invertPermutation") < 0)) __PYX_ERR(38, 140, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_nlocal = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("invertPermutation", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 140, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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;
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("invertPermutation", 0);
/* "petsc4py/PETSc/IS.pyx":141
*
* def invertPermutation(self, nlocal=None):
* 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":142
* def invertPermutation(self, nlocal=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nlocal); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 142, __pyx_L1_error)
__pyx_v_cnlocal = __pyx_t_3;
}
/* "petsc4py/PETSc/IS.pyx":143
* 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 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/IS.pyx":144
* if nlocal is not None: cnlocal = asInt(nlocal)
* cdef IS iset = IS()
* CHKERR( ISInvertPermutation(self.iset, cnlocal, &iset.iset) ) # <<<<<<<<<<<<<<
* return iset
*
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISInvertPermutation(__pyx_v_self->iset, __pyx_v_cnlocal, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 144, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":145
* cdef IS iset = IS()
* CHKERR( ISInvertPermutation(self.iset, cnlocal, &iset.iset) )
* return iset # <<<<<<<<<<<<<<
*
* def getSize(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_iset));
__pyx_r = ((PyObject *)__pyx_v_iset);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":140
* return result
*
* def invertPermutation(self, nlocal=None): # <<<<<<<<<<<<<<
* cdef PetscInt cnlocal = PETSC_DECIDE
* if nlocal is not None: cnlocal = asInt(nlocal)
*/
/* function exit code */
__pyx_L1_error:;
__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":147
* return iset
*
* def getSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt N = 0
* CHKERR( ISGetSize(self.iset, &N) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_41getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_40getSize[] = "IS.getSize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_41getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getSize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_40getSize(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_40getSize(struct PyPetscISObject *__pyx_v_self) {
PetscInt __pyx_v_N;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getSize", 0);
/* "petsc4py/PETSc/IS.pyx":148
*
* def getSize(self):
* cdef PetscInt N = 0 # <<<<<<<<<<<<<<
* CHKERR( ISGetSize(self.iset, &N) )
* return toInt(N)
*/
__pyx_v_N = 0;
/* "petsc4py/PETSc/IS.pyx":149
* def getSize(self):
* 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(38, 149, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":150
* cdef PetscInt N = 0
* CHKERR( ISGetSize(self.iset, &N) )
* return toInt(N) # <<<<<<<<<<<<<<
*
* def getLocalSize(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); 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/IS.pyx":147
* return iset
*
* def getSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt N = 0
* CHKERR( ISGetSize(self.iset, &N) )
*/
/* 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":152
* return toInt(N)
*
* def getLocalSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt n = 0
* CHKERR( ISGetLocalSize(self.iset, &n) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_43getLocalSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_42getLocalSize[] = "IS.getLocalSize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_43getLocalSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getLocalSize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getLocalSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalSize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_42getLocalSize(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_42getLocalSize(struct PyPetscISObject *__pyx_v_self) {
PetscInt __pyx_v_n;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getLocalSize", 0);
/* "petsc4py/PETSc/IS.pyx":153
*
* def getLocalSize(self):
* cdef PetscInt n = 0 # <<<<<<<<<<<<<<
* CHKERR( ISGetLocalSize(self.iset, &n) )
* return toInt(n)
*/
__pyx_v_n = 0;
/* "petsc4py/PETSc/IS.pyx":154
* def getLocalSize(self):
* 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(38, 154, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":155
* cdef PetscInt n = 0
* CHKERR( ISGetLocalSize(self.iset, &n) )
* return toInt(n) # <<<<<<<<<<<<<<
*
* def getSizes(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":152
* return toInt(N)
*
* def getLocalSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt n = 0
* CHKERR( ISGetLocalSize(self.iset, &n) )
*/
/* 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":157
* return toInt(n)
*
* def getSizes(self): # <<<<<<<<<<<<<<
* cdef PetscInt n = 0, N = 0
* CHKERR( ISGetLocalSize(self.iset, &n) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_45getSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_44getSizes[] = "IS.getSizes(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_45getSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getSizes (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSizes", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_44getSizes(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_44getSizes(struct PyPetscISObject *__pyx_v_self) {
PetscInt __pyx_v_n;
PetscInt __pyx_v_N;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getSizes", 0);
/* "petsc4py/PETSc/IS.pyx":158
*
* def getSizes(self):
* 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":159
* def getSizes(self):
* 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(38, 159, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":160
* 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(38, 160, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":161
* CHKERR( ISGetLocalSize(self.iset, &n) )
* CHKERR( ISGetSize(self.iset, &N) )
* return (toInt(n), toInt(N)) # <<<<<<<<<<<<<<
*
* def getBlockSize(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 161, __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(38, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":157
* return toInt(n)
*
* def getSizes(self): # <<<<<<<<<<<<<<
* cdef PetscInt n = 0, N = 0
* CHKERR( ISGetLocalSize(self.iset, &n) )
*/
/* 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":163
* return (toInt(n), toInt(N))
*
* def getBlockSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt bs = 1
* CHKERR( ISGetBlockSize(self.iset, &bs) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_47getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_46getBlockSize[] = "IS.getBlockSize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_47getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getBlockSize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_46getBlockSize(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_46getBlockSize(struct PyPetscISObject *__pyx_v_self) {
PetscInt __pyx_v_bs;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getBlockSize", 0);
/* "petsc4py/PETSc/IS.pyx":164
*
* def getBlockSize(self):
* cdef PetscInt bs = 1 # <<<<<<<<<<<<<<
* CHKERR( ISGetBlockSize(self.iset, &bs) )
* return toInt(bs)
*/
__pyx_v_bs = 1;
/* "petsc4py/PETSc/IS.pyx":165
* def getBlockSize(self):
* 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(38, 165, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":166
* cdef PetscInt bs = 1
* CHKERR( ISGetBlockSize(self.iset, &bs) )
* return toInt(bs) # <<<<<<<<<<<<<<
*
* def setBlockSize(self, bs):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":163
* return (toInt(n), toInt(N))
*
* def getBlockSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt bs = 1
* CHKERR( ISGetBlockSize(self.iset, &bs) )
*/
/* 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":168
* return toInt(bs)
*
* def setBlockSize(self, bs): # <<<<<<<<<<<<<<
* cdef PetscInt cbs = asInt(bs)
* CHKERR( ISSetBlockSize(self.iset, cbs) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_49setBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_48setBlockSize[] = "IS.setBlockSize(self, bs)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_49setBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_bs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bs,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBlockSize") < 0)) __PYX_ERR(38, 168, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_bs = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBlockSize", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 168, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.setBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_48setBlockSize(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_bs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_48setBlockSize(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bs) {
PetscInt __pyx_v_cbs;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBlockSize", 0);
/* "petsc4py/PETSc/IS.pyx":169
*
* def setBlockSize(self, bs):
* 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(38, 169, __pyx_L1_error)
__pyx_v_cbs = __pyx_t_1;
/* "petsc4py/PETSc/IS.pyx":170
* def setBlockSize(self, bs):
* cdef PetscInt cbs = asInt(bs)
* CHKERR( ISSetBlockSize(self.iset, cbs) ) # <<<<<<<<<<<<<<
*
* def sort(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(38, 170, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":168
* return toInt(bs)
*
* def setBlockSize(self, bs): # <<<<<<<<<<<<<<
* cdef PetscInt cbs = asInt(bs)
* CHKERR( ISSetBlockSize(self.iset, cbs) )
*/
/* 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":172
* CHKERR( ISSetBlockSize(self.iset, cbs) )
*
* def sort(self): # <<<<<<<<<<<<<<
* CHKERR( ISSort(self.iset) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_51sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_50sort[] = "IS.sort(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_51sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sort (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("sort", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sort", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_50sort(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_50sort(struct PyPetscISObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("sort", 0);
/* "petsc4py/PETSc/IS.pyx":173
*
* def sort(self):
* 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(38, 173, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":174
* def sort(self):
* CHKERR( ISSort(self.iset) )
* return self # <<<<<<<<<<<<<<
*
* def isSorted(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":172
* CHKERR( ISSetBlockSize(self.iset, cbs) )
*
* def sort(self): # <<<<<<<<<<<<<<
* CHKERR( ISSort(self.iset) )
* return self
*/
/* 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":176
* return self
*
* def isSorted(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( ISSorted(self.iset, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_53isSorted(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_52isSorted[] = "IS.isSorted(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_53isSorted(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isSorted (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("isSorted", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isSorted", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_52isSorted(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_52isSorted(struct PyPetscISObject *__pyx_v_self) {
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("isSorted", 0);
/* "petsc4py/PETSc/IS.pyx":177
*
* def isSorted(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( ISSorted(self.iset, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/IS.pyx":178
* def isSorted(self):
* 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(38, 178, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":179
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( ISSorted(self.iset, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def setPermutation(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 179, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":176
* return self
*
* def isSorted(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( ISSorted(self.iset, &flag) )
*/
/* 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":181
* return toBool(flag)
*
* def setPermutation(self): # <<<<<<<<<<<<<<
* CHKERR( ISSetPermutation(self.iset) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_55setPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_54setPermutation[] = "IS.setPermutation(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_55setPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setPermutation (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setPermutation", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setPermutation", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_54setPermutation(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_54setPermutation(struct PyPetscISObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setPermutation", 0);
/* "petsc4py/PETSc/IS.pyx":182
*
* def setPermutation(self):
* 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(38, 182, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":183
* def setPermutation(self):
* CHKERR( ISSetPermutation(self.iset) )
* return self # <<<<<<<<<<<<<<
*
* def isPermutation(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":181
* return toBool(flag)
*
* def setPermutation(self): # <<<<<<<<<<<<<<
* CHKERR( ISSetPermutation(self.iset) )
* return self
*/
/* 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":185
* return self
*
* def isPermutation(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( ISPermutation(self.iset, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_57isPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_56isPermutation[] = "IS.isPermutation(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_57isPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isPermutation (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("isPermutation", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isPermutation", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_56isPermutation(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_56isPermutation(struct PyPetscISObject *__pyx_v_self) {
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("isPermutation", 0);
/* "petsc4py/PETSc/IS.pyx":186
*
* def isPermutation(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( ISPermutation(self.iset, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/IS.pyx":187
* def isPermutation(self):
* 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(38, 187, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":188
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( ISPermutation(self.iset, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def setIdentity(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":185
* return self
*
* def isPermutation(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( ISPermutation(self.iset, &flag) )
*/
/* 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":190
* return toBool(flag)
*
* def setIdentity(self): # <<<<<<<<<<<<<<
* CHKERR( ISSetIdentity(self.iset) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_59setIdentity(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_58setIdentity[] = "IS.setIdentity(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_59setIdentity(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setIdentity (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setIdentity", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setIdentity", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_58setIdentity(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_58setIdentity(struct PyPetscISObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setIdentity", 0);
/* "petsc4py/PETSc/IS.pyx":191
*
* def setIdentity(self):
* 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(38, 191, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":192
* def setIdentity(self):
* CHKERR( ISSetIdentity(self.iset) )
* return self # <<<<<<<<<<<<<<
*
* def isIdentity(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":190
* return toBool(flag)
*
* def setIdentity(self): # <<<<<<<<<<<<<<
* CHKERR( ISSetIdentity(self.iset) )
* return self
*/
/* 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":194
* return self
*
* def isIdentity(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( ISIdentity(self.iset, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_61isIdentity(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_60isIdentity[] = "IS.isIdentity(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_61isIdentity(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isIdentity (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("isIdentity", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isIdentity", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_60isIdentity(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_60isIdentity(struct PyPetscISObject *__pyx_v_self) {
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("isIdentity", 0);
/* "petsc4py/PETSc/IS.pyx":195
*
* def isIdentity(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( ISIdentity(self.iset, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/IS.pyx":196
* def isIdentity(self):
* 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(38, 196, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":197
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( ISIdentity(self.iset, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def equal(self, IS iset):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":194
* return self
*
* def isIdentity(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( ISIdentity(self.iset, &flag) )
*/
/* 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":199
* return toBool(flag)
*
* def equal(self, IS iset): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( ISEqual(self.iset, iset.iset, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_63equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_62equal[] = "IS.equal(self, IS iset)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_63equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_iset = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(38, 199, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_iset = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("equal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 199, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.equal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(38, 199, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_62equal(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_62equal(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) {
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("equal", 0);
/* "petsc4py/PETSc/IS.pyx":200
*
* def equal(self, IS iset):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( ISEqual(self.iset, iset.iset, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/IS.pyx":201
* def equal(self, IS iset):
* 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(38, 201, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":202
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( ISEqual(self.iset, iset.iset, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def sum(self, IS iset):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":199
* return toBool(flag)
*
* def equal(self, IS iset): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( ISEqual(self.iset, iset.iset, &flag) )
*/
/* 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":204
* return toBool(flag)
*
* def sum(self, IS iset): # <<<<<<<<<<<<<<
* cdef IS out = IS()
* CHKERR( ISSum(self.iset, iset.iset, &out.iset) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_65sum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_64sum[] = "IS.sum(self, IS iset)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_65sum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_iset = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sum") < 0)) __PYX_ERR(38, 204, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_iset = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("sum", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 204, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(38, 204, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_64sum(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_64sum(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) {
struct PyPetscISObject *__pyx_v_out = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("sum", 0);
/* "petsc4py/PETSc/IS.pyx":205
*
* def sum(self, IS iset):
* cdef IS out = IS() # <<<<<<<<<<<<<<
* CHKERR( ISSum(self.iset, iset.iset, &out.iset) )
* return out
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_out = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/IS.pyx":206
* def sum(self, IS iset):
* cdef IS out = IS()
* CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) # <<<<<<<<<<<<<<
* return out
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSum(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 206, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":207
* cdef IS out = IS()
* CHKERR( ISSum(self.iset, iset.iset, &out.iset) )
* return out # <<<<<<<<<<<<<<
*
* def expand(self, IS iset):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_out));
__pyx_r = ((PyObject *)__pyx_v_out);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":204
* return toBool(flag)
*
* def sum(self, IS iset): # <<<<<<<<<<<<<<
* cdef IS out = IS()
* CHKERR( ISSum(self.iset, iset.iset, &out.iset) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.IS.sum", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_out);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":209
* return out
*
* def expand(self, IS iset): # <<<<<<<<<<<<<<
* cdef IS out = IS()
* CHKERR( ISExpand(self.iset, iset.iset, &out.iset) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_67expand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_66expand[] = "IS.expand(self, IS iset)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_67expand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_iset = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "expand") < 0)) __PYX_ERR(38, 209, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_iset = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("expand", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 209, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.expand", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(38, 209, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_66expand(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_66expand(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) {
struct PyPetscISObject *__pyx_v_out = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("expand", 0);
/* "petsc4py/PETSc/IS.pyx":210
*
* def expand(self, IS iset):
* cdef IS out = IS() # <<<<<<<<<<<<<<
* CHKERR( ISExpand(self.iset, iset.iset, &out.iset) )
* return out
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 210, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_out = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/IS.pyx":211
* def expand(self, IS iset):
* cdef IS out = IS()
* CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) # <<<<<<<<<<<<<<
* return out
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISExpand(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 211, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":212
* cdef IS out = IS()
* CHKERR( ISExpand(self.iset, iset.iset, &out.iset) )
* return out # <<<<<<<<<<<<<<
*
* def union(self, IS iset): # XXX review this
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_out));
__pyx_r = ((PyObject *)__pyx_v_out);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":209
* return out
*
* def expand(self, IS iset): # <<<<<<<<<<<<<<
* cdef IS out = IS()
* CHKERR( ISExpand(self.iset, iset.iset, &out.iset) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.IS.expand", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_out);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":214
* return out
*
* def union(self, IS iset): # XXX review this # <<<<<<<<<<<<<<
* cdef PetscBool flag1=PETSC_FALSE, flag2=PETSC_FALSE
* CHKERR( ISSorted(self.iset, &flag1) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_69union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_68union[] = "IS.union(self, IS iset)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_69union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_iset = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "union") < 0)) __PYX_ERR(38, 214, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_iset = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("union", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 214, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.union", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(38, 214, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_68union(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_68union(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) {
PetscBool __pyx_v_flag1;
PetscBool __pyx_v_flag2;
struct PyPetscISObject *__pyx_v_out = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("union", 0);
/* "petsc4py/PETSc/IS.pyx":215
*
* def union(self, IS iset): # XXX review this
* 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":216
* def union(self, IS iset): # XXX review this
* 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(38, 216, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":217
* 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(38, 217, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":218
* CHKERR( ISSorted(self.iset, &flag1) )
* CHKERR( ISSorted(iset.iset, &flag2) )
* cdef IS out = IS() # <<<<<<<<<<<<<<
* if flag1==PETSC_TRUE and flag2==PETSC_TRUE:
* CHKERR( ISSum(self.iset, iset.iset, &out.iset) )
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_out = ((struct PyPetscISObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/IS.pyx":219
* CHKERR( ISSorted(iset.iset, &flag2) )
* cdef IS out = IS()
* if flag1==PETSC_TRUE and flag2==PETSC_TRUE: # <<<<<<<<<<<<<<
* CHKERR( ISSum(self.iset, iset.iset, &out.iset) )
* else:
*/
__pyx_t_4 = ((__pyx_v_flag1 == PETSC_TRUE) != 0);
if (__pyx_t_4) {
} else {
__pyx_t_3 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = ((__pyx_v_flag2 == PETSC_TRUE) != 0);
__pyx_t_3 = __pyx_t_4;
__pyx_L4_bool_binop_done:;
if (__pyx_t_3) {
/* "petsc4py/PETSc/IS.pyx":220
* 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(38, 220, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":219
* 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":222
* 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(38, 222, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/IS.pyx":223
* else:
* CHKERR( ISExpand(self.iset, iset.iset, &out.iset) )
* return out # <<<<<<<<<<<<<<
*
* def difference(self, IS iset):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_out));
__pyx_r = ((PyObject *)__pyx_v_out);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":214
* return out
*
* def union(self, IS iset): # XXX review this # <<<<<<<<<<<<<<
* cdef PetscBool flag1=PETSC_FALSE, flag2=PETSC_FALSE
* CHKERR( ISSorted(self.iset, &flag1) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.IS.union", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_out);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":225
* return out
*
* def difference(self, IS iset): # <<<<<<<<<<<<<<
* cdef IS out = IS()
* CHKERR( ISDifference(self.iset, iset.iset, &out.iset) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_71difference(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_70difference[] = "IS.difference(self, IS iset)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_71difference(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_iset = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) __PYX_ERR(38, 225, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_iset = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("difference", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 225, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.difference", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(38, 225, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_70difference(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_70difference(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) {
struct PyPetscISObject *__pyx_v_out = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("difference", 0);
/* "petsc4py/PETSc/IS.pyx":226
*
* def difference(self, IS iset):
* cdef IS out = IS() # <<<<<<<<<<<<<<
* CHKERR( ISDifference(self.iset, iset.iset, &out.iset) )
* return out
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_out = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/IS.pyx":227
* def difference(self, IS iset):
* cdef IS out = IS()
* CHKERR( ISDifference(self.iset, iset.iset, &out.iset) ) # <<<<<<<<<<<<<<
* return out
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDifference(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 227, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":228
* cdef IS out = IS()
* CHKERR( ISDifference(self.iset, iset.iset, &out.iset) )
* return out # <<<<<<<<<<<<<<
*
* def complement(self, nmin, nmax):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_out));
__pyx_r = ((PyObject *)__pyx_v_out);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":225
* return out
*
* def difference(self, IS iset): # <<<<<<<<<<<<<<
* cdef IS out = IS()
* CHKERR( ISDifference(self.iset, iset.iset, &out.iset) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.IS.difference", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_out);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":230
* return out
*
* def complement(self, nmin, nmax): # <<<<<<<<<<<<<<
* cdef PetscInt cnmin = asInt(nmin)
* cdef PetscInt cnmax = asInt(nmax)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_73complement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_72complement[] = "IS.complement(self, nmin, nmax)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_73complement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_nmin = 0;
PyObject *__pyx_v_nmax = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nmin,&__pyx_n_s_nmax,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nmin)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nmax)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("complement", 1, 2, 2, 1); __PYX_ERR(38, 230, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "complement") < 0)) __PYX_ERR(38, 230, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_nmin = values[0];
__pyx_v_nmax = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("complement", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 230, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_72complement(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_nmin, __pyx_v_nmax);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_72complement(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_nmin, PyObject *__pyx_v_nmax) {
PetscInt __pyx_v_cnmin;
PetscInt __pyx_v_cnmax;
struct PyPetscISObject *__pyx_v_out = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("complement", 0);
/* "petsc4py/PETSc/IS.pyx":231
*
* def complement(self, nmin, nmax):
* 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(38, 231, __pyx_L1_error)
__pyx_v_cnmin = __pyx_t_1;
/* "petsc4py/PETSc/IS.pyx":232
* def complement(self, nmin, nmax):
* 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(38, 232, __pyx_L1_error)
__pyx_v_cnmax = __pyx_t_1;
/* "petsc4py/PETSc/IS.pyx":233
* cdef PetscInt cnmin = asInt(nmin)
* cdef PetscInt cnmax = asInt(nmax)
* cdef IS out = IS() # <<<<<<<<<<<<<<
* CHKERR( ISComplement(self.iset, cnmin, cnmax, &out.iset) )
* return out
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_out = ((struct PyPetscISObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/IS.pyx":234
* cdef PetscInt cnmax = asInt(nmax)
* cdef IS out = IS()
* CHKERR( ISComplement(self.iset, cnmin, cnmax, &out.iset) ) # <<<<<<<<<<<<<<
* return out
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISComplement(__pyx_v_self->iset, __pyx_v_cnmin, __pyx_v_cnmax, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 234, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":235
* cdef IS out = IS()
* CHKERR( ISComplement(self.iset, cnmin, cnmax, &out.iset) )
* return out # <<<<<<<<<<<<<<
*
* def embed(self, IS iset, drop):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_out));
__pyx_r = ((PyObject *)__pyx_v_out);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":230
* return out
*
* def complement(self, nmin, nmax): # <<<<<<<<<<<<<<
* cdef PetscInt cnmin = asInt(nmin)
* cdef PetscInt cnmax = asInt(nmax)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.IS.complement", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_out);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":237
* return out
*
* def embed(self, IS iset, drop): # <<<<<<<<<<<<<<
* cdef PetscBool bval = drop
* cdef IS out = IS()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_75embed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_74embed[] = "IS.embed(self, IS iset, drop)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_75embed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_iset = 0;
PyObject *__pyx_v_drop = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,&__pyx_n_s_drop,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_drop)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("embed", 1, 2, 2, 1); __PYX_ERR(38, 237, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "embed") < 0)) __PYX_ERR(38, 237, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_iset = ((struct PyPetscISObject *)values[0]);
__pyx_v_drop = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("embed", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 237, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.embed", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(38, 237, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_74embed(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_drop);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_74embed(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_drop) {
PetscBool __pyx_v_bval;
struct PyPetscISObject *__pyx_v_out = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscBool __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("embed", 0);
/* "petsc4py/PETSc/IS.pyx":238
*
* def embed(self, IS iset, drop):
* cdef PetscBool bval = drop # <<<<<<<<<<<<<<
* cdef IS out = IS()
* CHKERR( ISEmbed(self.iset, iset.iset, bval, &out.iset) )
*/
__pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_drop)); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 238, __pyx_L1_error)
__pyx_v_bval = __pyx_t_1;
/* "petsc4py/PETSc/IS.pyx":239
* def embed(self, IS iset, drop):
* cdef PetscBool bval = drop
* cdef IS out = IS() # <<<<<<<<<<<<<<
* CHKERR( ISEmbed(self.iset, iset.iset, bval, &out.iset) )
* return out
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_out = ((struct PyPetscISObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/IS.pyx":240
* cdef PetscBool bval = drop
* cdef IS out = IS()
* CHKERR( ISEmbed(self.iset, iset.iset, bval, &out.iset) ) # <<<<<<<<<<<<<<
* return out
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISEmbed(__pyx_v_self->iset, __pyx_v_iset->iset, __pyx_v_bval, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 240, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":241
* cdef IS out = IS()
* CHKERR( ISEmbed(self.iset, iset.iset, bval, &out.iset) )
* return out # <<<<<<<<<<<<<<
*
* def renumber(self, IS mult=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_out));
__pyx_r = ((PyObject *)__pyx_v_out);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":237
* return out
*
* def embed(self, IS iset, drop): # <<<<<<<<<<<<<<
* cdef PetscBool bval = drop
* cdef IS out = IS()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.IS.embed", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_out);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":243
* return out
*
* def renumber(self, IS mult=None): # <<<<<<<<<<<<<<
* cdef PetscIS mlt = NULL
* if mult is not None: mlt = mult.iset
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_77renumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_76renumber[] = "IS.renumber(self, IS mult=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_77renumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_mult = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mult,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscISObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mult);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renumber") < 0)) __PYX_ERR(38, 243, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mult = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("renumber", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 243, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.renumber", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mult), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "mult", 0))) __PYX_ERR(38, 243, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_76renumber(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_mult);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_76renumber(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_mult) {
IS __pyx_v_mlt;
struct PyPetscISObject *__pyx_v_out = 0;
PetscInt __pyx_v_n;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
IS __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PetscErrorCode __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("renumber", 0);
/* "petsc4py/PETSc/IS.pyx":244
*
* def renumber(self, IS mult=None):
* cdef PetscIS mlt = NULL # <<<<<<<<<<<<<<
* if mult is not None: mlt = mult.iset
* cdef IS out = IS()
*/
__pyx_v_mlt = NULL;
/* "petsc4py/PETSc/IS.pyx":245
* def renumber(self, IS mult=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_mult->iset;
__pyx_v_mlt = __pyx_t_3;
}
/* "petsc4py/PETSc/IS.pyx":246
* 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 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 246, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_out = ((struct PyPetscISObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/IS.pyx":247
* 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":248
* cdef IS out = IS()
* cdef PetscInt n = 0
* CHKERR( ISRenumber(self.iset, mlt, &n, &out.iset) ) # <<<<<<<<<<<<<<
* return (toInt(n), out)
* #
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISRenumber(__pyx_v_self->iset, __pyx_v_mlt, (&__pyx_v_n), (&__pyx_v_out->iset))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 248, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":249
* cdef PetscInt n = 0
* CHKERR( ISRenumber(self.iset, mlt, &n, &out.iset) )
* return (toInt(n), out) # <<<<<<<<<<<<<<
* #
*
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(38, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_out));
__Pyx_GIVEREF(((PyObject *)__pyx_v_out));
PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_out));
__pyx_t_4 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":243
* return out
*
* def renumber(self, IS mult=None): # <<<<<<<<<<<<<<
* cdef PetscIS mlt = NULL
* if mult is not None: mlt = mult.iset
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__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":252
* #
*
* def setIndices(self, indices): # <<<<<<<<<<<<<<
* cdef PetscInt nidx = 0, *idx = NULL
* cdef PetscCopyMode cm = PETSC_COPY_VALUES
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_79setIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_78setIndices[] = "IS.setIndices(self, indices)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_79setIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_indices = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setIndices") < 0)) __PYX_ERR(38, 252, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_indices = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setIndices", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 252, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.setIndices", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_78setIndices(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_indices);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_78setIndices(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_indices) {
PetscInt __pyx_v_nidx;
PetscInt *__pyx_v_idx;
PetscCopyMode __pyx_v_cm;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setIndices", 0);
__Pyx_INCREF(__pyx_v_indices);
/* "petsc4py/PETSc/IS.pyx":253
*
* def setIndices(self, indices):
* 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":254
* def setIndices(self, indices):
* 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":255
* 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(38, 255, __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":256
* cdef PetscCopyMode cm = PETSC_COPY_VALUES
* indices = iarray_i(indices, &nidx, &idx)
* CHKERR( ISGeneralSetIndices(self.iset, nidx, idx, cm) ) # <<<<<<<<<<<<<<
*
* def getIndices(self):
*/
__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(38, 256, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":252
* #
*
* def setIndices(self, indices): # <<<<<<<<<<<<<<
* cdef PetscInt nidx = 0, *idx = NULL
* cdef PetscCopyMode cm = PETSC_COPY_VALUES
*/
/* 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":258
* CHKERR( ISGeneralSetIndices(self.iset, nidx, idx, cm) )
*
* def getIndices(self): # <<<<<<<<<<<<<<
* cdef PetscInt size = 0
* cdef const PetscInt *indices = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_81getIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_80getIndices[] = "IS.getIndices(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_81getIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getIndices (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getIndices", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIndices", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_80getIndices(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_80getIndices(struct PyPetscISObject *__pyx_v_self) {
PetscInt __pyx_v_size;
PetscInt const *__pyx_v_indices;
PyObject *__pyx_v_oindices = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
char const *__pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getIndices", 0);
/* "petsc4py/PETSc/IS.pyx":259
*
* def getIndices(self):
* cdef PetscInt size = 0 # <<<<<<<<<<<<<<
* cdef const PetscInt *indices = NULL
* CHKERR( ISGetLocalSize(self.iset, &size) )
*/
__pyx_v_size = 0;
/* "petsc4py/PETSc/IS.pyx":260
* def getIndices(self):
* 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":261
* 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(38, 261, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":262
* 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(38, 262, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":263
* 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":264
* CHKERR( ISGetIndices(self.iset, &indices) )
* cdef object oindices = None
* try: # <<<<<<<<<<<<<<
* oindices = array_i(size, indices)
* finally:
*/
/*try:*/ {
/* "petsc4py/PETSc/IS.pyx":265
* 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(38, 265, __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":267
* 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(38, 267, __pyx_L1_error)
goto __pyx_L5;
}
__pyx_L4_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_11);
__pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
{
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISRestoreIndices(__pyx_v_self->iset, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 267, __pyx_L7_error)
}
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
}
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
__pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
__pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
goto __pyx_L1_error;
__pyx_L7_error:;
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
}
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
goto __pyx_L1_error;
}
__pyx_L5:;
}
/* "petsc4py/PETSc/IS.pyx":268
* finally:
* CHKERR( ISRestoreIndices(self.iset, &indices) )
* return oindices # <<<<<<<<<<<<<<
*
* def setBlockIndices(self, bsize, indices):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_oindices);
__pyx_r = __pyx_v_oindices;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":258
* CHKERR( ISGeneralSetIndices(self.iset, nidx, idx, cm) )
*
* def getIndices(self): # <<<<<<<<<<<<<<
* cdef PetscInt size = 0
* cdef const PetscInt *indices = NULL
*/
/* 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":270
* return oindices
*
* def setBlockIndices(self, bsize, indices): # <<<<<<<<<<<<<<
* cdef PetscInt bs = asInt(bsize)
* cdef PetscInt nidx = 0, *idx = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_83setBlockIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_82setBlockIndices[] = "IS.setBlockIndices(self, bsize, indices)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_83setBlockIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_bsize = 0;
PyObject *__pyx_v_indices = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bsize,&__pyx_n_s_indices,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setBlockIndices", 1, 2, 2, 1); __PYX_ERR(38, 270, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBlockIndices") < 0)) __PYX_ERR(38, 270, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_bsize = values[0];
__pyx_v_indices = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBlockIndices", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 270, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.setBlockIndices", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_82setBlockIndices(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_bsize, __pyx_v_indices);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_82setBlockIndices(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_indices) {
PetscInt __pyx_v_bs;
PetscInt __pyx_v_nidx;
PetscInt *__pyx_v_idx;
PetscCopyMode __pyx_v_cm;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBlockIndices", 0);
__Pyx_INCREF(__pyx_v_indices);
/* "petsc4py/PETSc/IS.pyx":271
*
* def setBlockIndices(self, bsize, indices):
* 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(38, 271, __pyx_L1_error)
__pyx_v_bs = __pyx_t_1;
/* "petsc4py/PETSc/IS.pyx":272
* def setBlockIndices(self, bsize, indices):
* 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":273
* 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":274
* 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(38, 274, __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":275
* cdef PetscCopyMode cm = PETSC_COPY_VALUES
* indices = iarray_i(indices, &nidx, &idx)
* CHKERR( ISBlockSetIndices(self.iset, bs, nidx, idx, cm) ) # <<<<<<<<<<<<<<
*
* def getBlockIndices(self):
*/
__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(38, 275, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":270
* return oindices
*
* def setBlockIndices(self, bsize, indices): # <<<<<<<<<<<<<<
* cdef PetscInt bs = asInt(bsize)
* cdef PetscInt nidx = 0, *idx = NULL
*/
/* 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":277
* CHKERR( ISBlockSetIndices(self.iset, bs, nidx, idx, cm) )
*
* def getBlockIndices(self): # <<<<<<<<<<<<<<
* cdef PetscInt size = 0, bs = 1
* cdef const PetscInt *indices = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_85getBlockIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_84getBlockIndices[] = "IS.getBlockIndices(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_85getBlockIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getBlockIndices (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getBlockIndices", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockIndices", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_84getBlockIndices(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_84getBlockIndices(struct PyPetscISObject *__pyx_v_self) {
PetscInt __pyx_v_size;
PetscInt __pyx_v_bs;
PetscInt const *__pyx_v_indices;
PyObject *__pyx_v_oindices = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
char const *__pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getBlockIndices", 0);
/* "petsc4py/PETSc/IS.pyx":278
*
* def getBlockIndices(self):
* 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":279
* def getBlockIndices(self):
* 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":280
* 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(38, 280, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":281
* 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(38, 281, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":282
* 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(38, 282, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":283
* 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":284
* CHKERR( ISBlockGetIndices(self.iset, &indices) )
* cdef object oindices = None
* try: # <<<<<<<<<<<<<<
* oindices = array_i(size//bs, indices)
* finally:
*/
/*try:*/ {
/* "petsc4py/PETSc/IS.pyx":285
* 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(38, 285, __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":287
* 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(38, 287, __pyx_L1_error)
goto __pyx_L5;
}
__pyx_L4_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_11);
__pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
{
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISBlockRestoreIndices(__pyx_v_self->iset, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 287, __pyx_L7_error)
}
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
}
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
__pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
__pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
goto __pyx_L1_error;
__pyx_L7_error:;
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
}
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
goto __pyx_L1_error;
}
__pyx_L5:;
}
/* "petsc4py/PETSc/IS.pyx":288
* finally:
* CHKERR( ISBlockRestoreIndices(self.iset, &indices) )
* return oindices # <<<<<<<<<<<<<<
*
* def setStride(self, size, first=0, step=1):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_oindices);
__pyx_r = __pyx_v_oindices;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":277
* CHKERR( ISBlockSetIndices(self.iset, bs, nidx, idx, cm) )
*
* def getBlockIndices(self): # <<<<<<<<<<<<<<
* cdef PetscInt size = 0, bs = 1
* cdef const PetscInt *indices = NULL
*/
/* 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":290
* return oindices
*
* def setStride(self, size, first=0, step=1): # <<<<<<<<<<<<<<
* cdef PetscInt csize = asInt(size)
* cdef PetscInt cfirst = asInt(first)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_87setStride(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_86setStride[] = "IS.setStride(self, size, first=0, step=1)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_87setStride(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_size = 0;
PyObject *__pyx_v_first = 0;
PyObject *__pyx_v_step = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_first,&__pyx_n_s_step,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)__pyx_int_0);
values[2] = ((PyObject *)__pyx_int_1);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_first);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setStride") < 0)) __PYX_ERR(38, 290, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_first = values[1];
__pyx_v_step = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setStride", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 290, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.IS.setStride", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_86setStride(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_size, __pyx_v_first, __pyx_v_step);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_86setStride(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_first, PyObject *__pyx_v_step) {
PetscInt __pyx_v_csize;
PetscInt __pyx_v_cfirst;
PetscInt __pyx_v_cstep;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setStride", 0);
/* "petsc4py/PETSc/IS.pyx":291
*
* def setStride(self, size, first=0, step=1):
* 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(38, 291, __pyx_L1_error)
__pyx_v_csize = __pyx_t_1;
/* "petsc4py/PETSc/IS.pyx":292
* def setStride(self, size, first=0, step=1):
* 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(38, 292, __pyx_L1_error)
__pyx_v_cfirst = __pyx_t_1;
/* "petsc4py/PETSc/IS.pyx":293
* 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(38, 293, __pyx_L1_error)
__pyx_v_cstep = __pyx_t_1;
/* "petsc4py/PETSc/IS.pyx":294
* cdef PetscInt cfirst = asInt(first)
* cdef PetscInt cstep = asInt(step)
* CHKERR( ISStrideSetStride(self.iset, csize, cfirst, cstep) ) # <<<<<<<<<<<<<<
*
* def getStride(self):
*/
__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(38, 294, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":290
* return oindices
*
* def setStride(self, size, first=0, step=1): # <<<<<<<<<<<<<<
* cdef PetscInt csize = asInt(size)
* cdef PetscInt cfirst = asInt(first)
*/
/* 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":296
* CHKERR( ISStrideSetStride(self.iset, csize, cfirst, cstep) )
*
* def getStride(self): # <<<<<<<<<<<<<<
* cdef PetscInt size=0, first=0, step=0
* CHKERR( ISGetLocalSize(self.iset, &size) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_89getStride(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_88getStride[] = "IS.getStride(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_89getStride(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getStride (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getStride", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStride", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_88getStride(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_88getStride(struct PyPetscISObject *__pyx_v_self) {
PetscInt __pyx_v_size;
PetscInt __pyx_v_first;
PetscInt __pyx_v_step;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getStride", 0);
/* "petsc4py/PETSc/IS.pyx":297
*
* def getStride(self):
* 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":298
* def getStride(self):
* 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(38, 298, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":299
* 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(38, 299, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":300
* CHKERR( ISGetLocalSize(self.iset, &size) )
* CHKERR( ISStrideGetInfo(self.iset, &first, &step) )
* return (toInt(size), toInt(first), toInt(step)) # <<<<<<<<<<<<<<
*
* def getInfo(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 300, __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(38, 300, __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(38, 300, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 300, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
__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":296
* CHKERR( ISStrideSetStride(self.iset, csize, cfirst, cstep) )
*
* def getStride(self): # <<<<<<<<<<<<<<
* cdef PetscInt size=0, first=0, step=0
* CHKERR( ISGetLocalSize(self.iset, &size) )
*/
/* 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":302
* return (toInt(size), toInt(first), toInt(step))
*
* def getInfo(self): # <<<<<<<<<<<<<<
* cdef PetscInt first = 0, step = 0
* CHKERR( ISStrideGetInfo(self.iset, &first, &step) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_91getInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2IS_90getInfo[] = "IS.getInfo(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_91getInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getInfo (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getInfo", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInfo", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_90getInfo(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_90getInfo(struct PyPetscISObject *__pyx_v_self) {
PetscInt __pyx_v_first;
PetscInt __pyx_v_step;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getInfo", 0);
/* "petsc4py/PETSc/IS.pyx":303
*
* def getInfo(self):
* 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":304
* def getInfo(self):
* 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(38, 304, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":305
* 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(38, 305, __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(38, 305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":302
* return (toInt(size), toInt(first), toInt(step))
*
* def getInfo(self): # <<<<<<<<<<<<<<
* cdef PetscInt first = 0, step = 0
* CHKERR( ISStrideGetInfo(self.iset, &first, &step) )
*/
/* 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":310
*
* property permutation:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_11permutation___get__(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_11permutation___get__(struct PyPetscISObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/IS.pyx":311
* property permutation:
* def __get__(self):
* return self.isPermutation() # <<<<<<<<<<<<<<
*
* property identity:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isPermutation); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":310
*
* property permutation:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.isPermutation()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.IS.permutation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":314
*
* property identity:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_8identity___get__(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_8identity___get__(struct PyPetscISObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/IS.pyx":315
* property identity:
* def __get__(self):
* return self.isIdentity() # <<<<<<<<<<<<<<
*
* property sorted:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isIdentity); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 315, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 315, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":314
*
* property identity:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.isIdentity()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.IS.identity.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":318
*
* property sorted:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_6sorted___get__(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_6sorted___get__(struct PyPetscISObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/IS.pyx":319
* property sorted:
* def __get__(self):
* return self.isSorted() # <<<<<<<<<<<<<<
*
* #
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 319, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 319, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":318
*
* property sorted:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.isSorted()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.IS.sorted.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":324
*
* property sizes:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_5sizes___get__(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_5sizes___get__(struct PyPetscISObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/IS.pyx":325
* property sizes:
* def __get__(self):
* return self.getSizes() # <<<<<<<<<<<<<<
*
* property size:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 325, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 325, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":324
*
* property sizes:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getSizes()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.IS.sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":328
*
* property size:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_4size___get__(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_4size___get__(struct PyPetscISObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/IS.pyx":329
* property size:
* def __get__(self):
* return self.getSize() # <<<<<<<<<<<<<<
*
* property local_size:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 329, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 329, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":328
*
* property size:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getSize()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.IS.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":332
*
* property local_size:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_10local_size___get__(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10local_size___get__(struct PyPetscISObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/IS.pyx":333
* property local_size:
* def __get__(self):
* return self.getLocalSize() # <<<<<<<<<<<<<<
*
* property block_size:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getLocalSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 333, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 333, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":332
*
* property local_size:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getLocalSize()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.IS.local_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":336
*
* property block_size:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_10block_size___get__(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10block_size___get__(struct PyPetscISObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/IS.pyx":337
* property block_size:
* def __get__(self):
* return self.getBlockSize() # <<<<<<<<<<<<<<
*
* property indices:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 337, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 337, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":336
*
* property block_size:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getBlockSize()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.IS.block_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":340
*
* property indices:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_7indices___get__(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_7indices___get__(struct PyPetscISObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/IS.pyx":341
* property indices:
* def __get__(self):
* return self.getIndices() # <<<<<<<<<<<<<<
*
* property array:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getIndices); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 341, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":340
*
* property indices:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getIndices()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.IS.indices.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":344
*
* property array:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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":345
* property array:
* def __get__(self):
* 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(38, 345, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":344
*
* property array:
* def __get__(self): # <<<<<<<<<<<<<<
* 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":350
*
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_19__array_interface_____get__(((struct PyPetscISObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_19__array_interface_____get__(struct PyPetscISObject *__pyx_v_self) {
struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_buf = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/IS.pyx":351
* property __array_interface__:
* def __get__(self):
* cdef _IS_buffer buf = _IS_buffer(self) # <<<<<<<<<<<<<<
* return buf.__array_interface__
*
*/
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__IS_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/IS.pyx":352
* def __get__(self):
* cdef _IS_buffer buf = _IS_buffer(self)
* return buf.__array_interface__ # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_buf), __pyx_n_s_array_interface); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":350
*
* property __array_interface__:
* def __get__(self): # <<<<<<<<<<<<<<
* cdef _IS_buffer buf = _IS_buffer(self)
* return buf.__array_interface__
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.IS.__array_interface__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_buf);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":376
* #
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap___cinit__(((struct PyPetscLGMapObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_5LGMap___cinit__(struct PyPetscLGMapObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/IS.pyx":377
*
* def __cinit__(self):
* self.obj = <PetscObject*> &self.lgm # <<<<<<<<<<<<<<
* self.lgm = NULL
*
*/
__pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->lgm));
/* "petsc4py/PETSc/IS.pyx":378
* def __cinit__(self):
* self.obj = <PetscObject*> &self.lgm
* self.lgm = NULL # <<<<<<<<<<<<<<
*
* def __call__(self, indices, result=None):
*/
__pyx_v_self->lgm = NULL;
/* "petsc4py/PETSc/IS.pyx":376
* #
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.lgm
* self.lgm = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":380
* self.lgm = NULL
*
* def __call__(self, indices, result=None): # <<<<<<<<<<<<<<
* self.apply(indices, result)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_result,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(38, 380, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_indices = values[0];
__pyx_v_result = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 380, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_2__call__(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__call__", 0);
/* "petsc4py/PETSc/IS.pyx":381
*
* def __call__(self, indices, result=None):
* self.apply(indices, result) # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_apply); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 381, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
__pyx_t_4 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
__pyx_t_4 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_indices, __pyx_v_result};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 381, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_indices, __pyx_v_result};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 381, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
__pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 381, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__pyx_t_3) {
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
}
__Pyx_INCREF(__pyx_v_indices);
__Pyx_GIVEREF(__pyx_v_indices);
PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_indices);
__Pyx_INCREF(__pyx_v_result);
__Pyx_GIVEREF(__pyx_v_result);
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_result);
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 381, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/IS.pyx":380
* self.lgm = NULL
*
* def __call__(self, indices, result=None): # <<<<<<<<<<<<<<
* self.apply(indices, result)
*
*/
/* 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_5);
__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":385
* #
*
* def setType(self, lgmap_type): # <<<<<<<<<<<<<<
* cdef PetscISLocalToGlobalMappingType cval = NULL
* lgmap_type = str2bytes(lgmap_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_5setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_4setType[] = "LGMap.setType(self, lgmap_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_5setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_lgmap_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lgmap_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lgmap_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(38, 385, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_lgmap_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 385, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":386
*
* def setType(self, lgmap_type):
* cdef PetscISLocalToGlobalMappingType cval = NULL # <<<<<<<<<<<<<<
* lgmap_type = str2bytes(lgmap_type, &cval)
* CHKERR( ISLocalToGlobalMappingSetType(self.lgm, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/IS.pyx":387
* def setType(self, lgmap_type):
* 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(38, 387, __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":388
* cdef PetscISLocalToGlobalMappingType cval = NULL
* lgmap_type = str2bytes(lgmap_type, &cval)
* CHKERR( ISLocalToGlobalMappingSetType(self.lgm, cval) ) # <<<<<<<<<<<<<<
*
* def setFromOptions(self):
*/
__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(38, 388, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":385
* #
*
* def setType(self, lgmap_type): # <<<<<<<<<<<<<<
* cdef PetscISLocalToGlobalMappingType cval = NULL
* lgmap_type = str2bytes(lgmap_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":390
* CHKERR( ISLocalToGlobalMappingSetType(self.lgm, cval) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( ISLocalToGlobalMappingSetFromOptions(self.lgm) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_7setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_6setFromOptions[] = "LGMap.setFromOptions(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_7setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_6setFromOptions(((struct PyPetscLGMapObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_6setFromOptions(struct PyPetscLGMapObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFromOptions", 0);
/* "petsc4py/PETSc/IS.pyx":391
*
* def setFromOptions(self):
* CHKERR( ISLocalToGlobalMappingSetFromOptions(self.lgm) ) # <<<<<<<<<<<<<<
*
* def view(self, Viewer viewer=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(38, 391, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":390
* CHKERR( ISLocalToGlobalMappingSetType(self.lgm, cval) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( ISLocalToGlobalMappingSetFromOptions(self.lgm) )
*
*/
/* 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":393
* CHKERR( ISLocalToGlobalMappingSetFromOptions(self.lgm) )
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer cviewer = NULL
* if viewer is not None: cviewer = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_9view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_8view[] = "LGMap.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_9view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(38, 393, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 393, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(38, 393, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_8view(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/IS.pyx":394
*
* def view(self, Viewer viewer=None):
* 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":395
* def view(self, Viewer viewer=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_cviewer = __pyx_t_3;
}
/* "petsc4py/PETSc/IS.pyx":396
* cdef PetscViewer cviewer = NULL
* if viewer is not None: cviewer = viewer.vwr
* CHKERR( ISLocalToGlobalMappingView(self.lgm, cviewer) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingView(__pyx_v_self->lgm, __pyx_v_cviewer)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 396, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":393
* CHKERR( ISLocalToGlobalMappingSetFromOptions(self.lgm) )
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer cviewer = NULL
* if viewer is not None: cviewer = viewer.vwr
*/
/* 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":398
* CHKERR( ISLocalToGlobalMappingView(self.lgm, cviewer) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( ISLocalToGlobalMappingDestroy(&self.lgm) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_11destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_10destroy[] = "LGMap.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_11destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_10destroy(((struct PyPetscLGMapObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10destroy(struct PyPetscLGMapObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/IS.pyx":399
*
* def destroy(self):
* 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(38, 399, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":400
* def destroy(self):
* CHKERR( ISLocalToGlobalMappingDestroy(&self.lgm) )
* return self # <<<<<<<<<<<<<<
*
* def create(self, indices, bsize=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":398
* CHKERR( ISLocalToGlobalMappingView(self.lgm, cviewer) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( ISLocalToGlobalMappingDestroy(&self.lgm) )
* return self
*/
/* 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":402
* return self
*
* def create(self, indices, bsize=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt bs = 1, nidx = 0, *idx = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_13create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_12create[] = "LGMap.create(self, indices, bsize=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_13create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_indices = 0;
PyObject *__pyx_v_bsize = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_bsize,&__pyx_n_s_comm,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(38, 402, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_indices = values[0];
__pyx_v_bsize = values[1];
__pyx_v_comm = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 402, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_12create(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_bsize, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_12create(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) {
MPI_Comm __pyx_v_ccomm;
PetscInt __pyx_v_bs;
PetscInt __pyx_v_nidx;
PetscInt *__pyx_v_idx;
PetscCopyMode __pyx_v_cm;
ISLocalToGlobalMapping __pyx_v_newlgm;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
PetscInt __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("create", 0);
__Pyx_INCREF(__pyx_v_indices);
/* "petsc4py/PETSc/IS.pyx":403
*
* def create(self, indices, bsize=None, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(38, 403, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/IS.pyx":404
* def create(self, indices, bsize=None, comm=None):
* 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":405
* 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":406
* 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":407
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 407, __pyx_L1_error)
__pyx_v_bs = __pyx_t_4;
}
/* "petsc4py/PETSc/IS.pyx":408
* 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_3 = ((__pyx_v_bs == PETSC_DECIDE) != 0);
if (__pyx_t_3) {
__pyx_v_bs = 1;
}
/* "petsc4py/PETSc/IS.pyx":409
* 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_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_nidx), (&__pyx_v_idx))); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_5);
__pyx_t_5 = 0;
/* "petsc4py/PETSc/IS.pyx":410
* if bs == PETSC_DECIDE: bs = 1
* indices = iarray_i(indices, &nidx, &idx)
* CHKERR( ISLocalToGlobalMappingCreate( # <<<<<<<<<<<<<<
* ccomm, bs, nidx, idx, cm, &newlgm) )
* PetscCLEAR(self.obj); self.lgm = newlgm
*/
__pyx_t_6 = __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_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 410, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":412
* CHKERR( ISLocalToGlobalMappingCreate(
* ccomm, bs, nidx, idx, cm, &newlgm) )
* PetscCLEAR(self.obj); self.lgm = newlgm # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->lgm = __pyx_v_newlgm;
/* "petsc4py/PETSc/IS.pyx":413
* ccomm, bs, nidx, idx, cm, &newlgm) )
* PetscCLEAR(self.obj); self.lgm = newlgm
* return self # <<<<<<<<<<<<<<
*
* def createIS(self, IS iset):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":402
* return self
*
* def create(self, indices, bsize=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt bs = 1, nidx = 0, *idx = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__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":415
* return self
*
* def createIS(self, IS iset): # <<<<<<<<<<<<<<
* cdef PetscLGMap newlgm = NULL
* CHKERR( ISLocalToGlobalMappingCreateIS(
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_15createIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_14createIS[] = "LGMap.createIS(self, IS iset)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_15createIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_iset = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createIS") < 0)) __PYX_ERR(38, 415, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_iset = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createIS", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 415, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.createIS", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(38, 415, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_14createIS(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_iset);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_14createIS(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) {
ISLocalToGlobalMapping __pyx_v_newlgm;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createIS", 0);
/* "petsc4py/PETSc/IS.pyx":416
*
* def createIS(self, IS iset):
* cdef PetscLGMap newlgm = NULL # <<<<<<<<<<<<<<
* CHKERR( ISLocalToGlobalMappingCreateIS(
* iset.iset, &newlgm) )
*/
__pyx_v_newlgm = NULL;
/* "petsc4py/PETSc/IS.pyx":417
* def createIS(self, IS iset):
* cdef PetscLGMap newlgm = NULL
* CHKERR( ISLocalToGlobalMappingCreateIS( # <<<<<<<<<<<<<<
* iset.iset, &newlgm) )
* 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(38, 417, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":419
* CHKERR( ISLocalToGlobalMappingCreateIS(
* iset.iset, &newlgm) )
* PetscCLEAR(self.obj); self.lgm = newlgm # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->lgm = __pyx_v_newlgm;
/* "petsc4py/PETSc/IS.pyx":420
* iset.iset, &newlgm) )
* PetscCLEAR(self.obj); self.lgm = newlgm
* return self # <<<<<<<<<<<<<<
*
* def createSF(self, SF sf, start):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":415
* return self
*
* def createIS(self, IS iset): # <<<<<<<<<<<<<<
* cdef PetscLGMap newlgm = NULL
* CHKERR( ISLocalToGlobalMappingCreateIS(
*/
/* 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":422
* return self
*
* def createSF(self, SF sf, start): # <<<<<<<<<<<<<<
* cdef PetscLGMap newlgm = NULL
* cdef PetscInt cstart = asInt(start)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_17createSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_16createSF[] = "LGMap.createSF(self, SF sf, start)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_17createSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscSFObject *__pyx_v_sf = 0;
PyObject *__pyx_v_start = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,&__pyx_n_s_start,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sf)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createSF", 1, 2, 2, 1); __PYX_ERR(38, 422, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSF") < 0)) __PYX_ERR(38, 422, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_sf = ((struct PyPetscSFObject *)values[0]);
__pyx_v_start = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createSF", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 422, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.createSF", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(38, 422, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_16createSF(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_sf, __pyx_v_start);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_16createSF(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf, PyObject *__pyx_v_start) {
ISLocalToGlobalMapping __pyx_v_newlgm;
PetscInt __pyx_v_cstart;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createSF", 0);
/* "petsc4py/PETSc/IS.pyx":423
*
* def createSF(self, SF sf, start):
* cdef PetscLGMap newlgm = NULL # <<<<<<<<<<<<<<
* cdef PetscInt cstart = asInt(start)
* CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) )
*/
__pyx_v_newlgm = NULL;
/* "petsc4py/PETSc/IS.pyx":424
* def createSF(self, SF sf, start):
* cdef PetscLGMap newlgm = NULL
* cdef PetscInt cstart = asInt(start) # <<<<<<<<<<<<<<
* CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) )
* 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(38, 424, __pyx_L1_error)
__pyx_v_cstart = __pyx_t_1;
/* "petsc4py/PETSc/IS.pyx":425
* cdef PetscLGMap newlgm = NULL
* cdef PetscInt cstart = asInt(start)
* CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) ) # <<<<<<<<<<<<<<
* 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(38, 425, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":426
* cdef PetscInt cstart = asInt(start)
* CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) )
* PetscCLEAR(self.obj); self.lgm = newlgm # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->lgm = __pyx_v_newlgm;
/* "petsc4py/PETSc/IS.pyx":427
* CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) )
* PetscCLEAR(self.obj); self.lgm = newlgm
* return self # <<<<<<<<<<<<<<
*
* def getSize(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":422
* return self
*
* def createSF(self, SF sf, start): # <<<<<<<<<<<<<<
* cdef PetscLGMap newlgm = NULL
* cdef PetscInt cstart = asInt(start)
*/
/* 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":429
* return self
*
* def getSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt n = 0
* CHKERR( ISLocalToGlobalMappingGetSize(self.lgm, &n) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_19getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_18getSize[] = "LGMap.getSize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_19getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getSize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_18getSize(((struct PyPetscLGMapObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_18getSize(struct PyPetscLGMapObject *__pyx_v_self) {
PetscInt __pyx_v_n;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getSize", 0);
/* "petsc4py/PETSc/IS.pyx":430
*
* def getSize(self):
* cdef PetscInt n = 0 # <<<<<<<<<<<<<<
* CHKERR( ISLocalToGlobalMappingGetSize(self.lgm, &n) )
* return toInt(n)
*/
__pyx_v_n = 0;
/* "petsc4py/PETSc/IS.pyx":431
* def getSize(self):
* 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(38, 431, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":432
* cdef PetscInt n = 0
* CHKERR( ISLocalToGlobalMappingGetSize(self.lgm, &n) )
* return toInt(n) # <<<<<<<<<<<<<<
*
* def getBlockSize(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":429
* return self
*
* def getSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt n = 0
* CHKERR( ISLocalToGlobalMappingGetSize(self.lgm, &n) )
*/
/* 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":434
* return toInt(n)
*
* def getBlockSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt bs = 1
* CHKERR( ISLocalToGlobalMappingGetBlockSize(self.lgm, &bs) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_21getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_20getBlockSize[] = "LGMap.getBlockSize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_21getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getBlockSize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_20getBlockSize(((struct PyPetscLGMapObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_20getBlockSize(struct PyPetscLGMapObject *__pyx_v_self) {
PetscInt __pyx_v_bs;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getBlockSize", 0);
/* "petsc4py/PETSc/IS.pyx":435
*
* def getBlockSize(self):
* cdef PetscInt bs = 1 # <<<<<<<<<<<<<<
* CHKERR( ISLocalToGlobalMappingGetBlockSize(self.lgm, &bs) )
* return toInt(bs)
*/
__pyx_v_bs = 1;
/* "petsc4py/PETSc/IS.pyx":436
* def getBlockSize(self):
* 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(38, 436, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":437
* cdef PetscInt bs = 1
* CHKERR( ISLocalToGlobalMappingGetBlockSize(self.lgm, &bs) )
* return toInt(bs) # <<<<<<<<<<<<<<
*
* def getIndices(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 437, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":434
* return toInt(n)
*
* def getBlockSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt bs = 1
* CHKERR( ISLocalToGlobalMappingGetBlockSize(self.lgm, &bs) )
*/
/* 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":439
* return toInt(bs)
*
* def getIndices(self): # <<<<<<<<<<<<<<
* cdef PetscInt size = 0
* cdef const PetscInt *indices = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_23getIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_22getIndices[] = "LGMap.getIndices(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_23getIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getIndices (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getIndices", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIndices", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_22getIndices(((struct PyPetscLGMapObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_22getIndices(struct PyPetscLGMapObject *__pyx_v_self) {
PetscInt __pyx_v_size;
PetscInt const *__pyx_v_indices;
PyObject *__pyx_v_oindices = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
char const *__pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getIndices", 0);
/* "petsc4py/PETSc/IS.pyx":440
*
* def getIndices(self):
* cdef PetscInt size = 0 # <<<<<<<<<<<<<<
* cdef const PetscInt *indices = NULL
* CHKERR( ISLocalToGlobalMappingGetSize(
*/
__pyx_v_size = 0;
/* "petsc4py/PETSc/IS.pyx":441
* def getIndices(self):
* cdef PetscInt size = 0
* cdef const PetscInt *indices = NULL # <<<<<<<<<<<<<<
* CHKERR( ISLocalToGlobalMappingGetSize(
* self.lgm, &size) )
*/
__pyx_v_indices = NULL;
/* "petsc4py/PETSc/IS.pyx":442
* 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(38, 442, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":444
* 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(38, 444, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":446
* 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":447
* self.lgm, &indices) )
* cdef object oindices = None
* try: # <<<<<<<<<<<<<<
* oindices = array_i(size, indices)
* finally:
*/
/*try:*/ {
/* "petsc4py/PETSc/IS.pyx":448
* 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(38, 448, __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":450
* oindices = array_i(size, indices)
* finally:
* CHKERR( ISLocalToGlobalMappingRestoreIndices( # <<<<<<<<<<<<<<
* self.lgm, &indices) )
* return oindices
*/
/*finally:*/ {
/*normal exit:*/{
/* "petsc4py/PETSc/IS.pyx":451
* 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(38, 450, __pyx_L1_error)
goto __pyx_L5;
}
__pyx_L4_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_11);
__pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
{
/* "petsc4py/PETSc/IS.pyx":450
* 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(38, 450, __pyx_L7_error)
}
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
}
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
__pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
__pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
goto __pyx_L1_error;
__pyx_L7_error:;
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
}
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
goto __pyx_L1_error;
}
__pyx_L5:;
}
/* "petsc4py/PETSc/IS.pyx":452
* CHKERR( ISLocalToGlobalMappingRestoreIndices(
* self.lgm, &indices) )
* return oindices # <<<<<<<<<<<<<<
*
* def getBlockIndices(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_oindices);
__pyx_r = __pyx_v_oindices;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":439
* return toInt(bs)
*
* def getIndices(self): # <<<<<<<<<<<<<<
* cdef PetscInt size = 0
* cdef const PetscInt *indices = NULL
*/
/* 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":454
* return oindices
*
* def getBlockIndices(self): # <<<<<<<<<<<<<<
* cdef PetscInt size = 0, bs = 1
* cdef const PetscInt *indices = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_25getBlockIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_24getBlockIndices[] = "LGMap.getBlockIndices(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_25getBlockIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getBlockIndices (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getBlockIndices", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockIndices", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_24getBlockIndices(((struct PyPetscLGMapObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_24getBlockIndices(struct PyPetscLGMapObject *__pyx_v_self) {
PetscInt __pyx_v_size;
PetscInt __pyx_v_bs;
PetscInt const *__pyx_v_indices;
PyObject *__pyx_v_oindices = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
char const *__pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getBlockIndices", 0);
/* "petsc4py/PETSc/IS.pyx":455
*
* def getBlockIndices(self):
* 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":456
* def getBlockIndices(self):
* cdef PetscInt size = 0, bs = 1
* cdef const PetscInt *indices = NULL # <<<<<<<<<<<<<<
* CHKERR( ISLocalToGlobalMappingGetSize(
* self.lgm, &size) )
*/
__pyx_v_indices = NULL;
/* "petsc4py/PETSc/IS.pyx":457
* 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(38, 457, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":459
* 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(38, 459, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":461
* 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(38, 461, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":463
* 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":464
* self.lgm, &indices) )
* cdef object oindices = None
* try: # <<<<<<<<<<<<<<
* oindices = array_i(size//bs, indices)
* finally:
*/
/*try:*/ {
/* "petsc4py/PETSc/IS.pyx":465
* 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(38, 465, __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":467
* oindices = array_i(size//bs, indices)
* finally:
* CHKERR( ISLocalToGlobalMappingRestoreBlockIndices( # <<<<<<<<<<<<<<
* self.lgm, &indices) )
* return oindices
*/
/*finally:*/ {
/*normal exit:*/{
/* "petsc4py/PETSc/IS.pyx":468
* 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(38, 467, __pyx_L1_error)
goto __pyx_L5;
}
__pyx_L4_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_11);
__pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
{
/* "petsc4py/PETSc/IS.pyx":467
* 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(38, 467, __pyx_L7_error)
}
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
}
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
__pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
__pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
goto __pyx_L1_error;
__pyx_L7_error:;
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
}
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
goto __pyx_L1_error;
}
__pyx_L5:;
}
/* "petsc4py/PETSc/IS.pyx":469
* CHKERR( ISLocalToGlobalMappingRestoreBlockIndices(
* self.lgm, &indices) )
* return oindices # <<<<<<<<<<<<<<
*
* def getInfo(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_oindices);
__pyx_r = __pyx_v_oindices;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":454
* return oindices
*
* def getBlockIndices(self): # <<<<<<<<<<<<<<
* cdef PetscInt size = 0, bs = 1
* cdef const PetscInt *indices = NULL
*/
/* 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":471
* return oindices
*
* def getInfo(self): # <<<<<<<<<<<<<<
* cdef PetscInt i, nproc = 0, *procs = NULL,
* cdef PetscInt *numprocs = NULL, **indices = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_27getInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_26getInfo[] = "LGMap.getInfo(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_27getInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getInfo (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getInfo", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInfo", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_26getInfo(((struct PyPetscLGMapObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_26getInfo(struct PyPetscLGMapObject *__pyx_v_self) {
PetscInt __pyx_v_i;
PetscInt __pyx_v_nproc;
PetscInt *__pyx_v_procs;
PetscInt *__pyx_v_numprocs;
PetscInt **__pyx_v_indices;
PyObject *__pyx_v_neighs = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
PetscInt __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
int __pyx_t_6;
char const *__pyx_t_7;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getInfo", 0);
/* "petsc4py/PETSc/IS.pyx":472
*
* def getInfo(self):
* cdef PetscInt i, nproc = 0, *procs = NULL, # <<<<<<<<<<<<<<
* cdef PetscInt *numprocs = NULL, **indices = NULL
* cdef object neighs = { }
*/
__pyx_v_nproc = 0;
__pyx_v_procs = NULL;
/* "petsc4py/PETSc/IS.pyx":473
* def getInfo(self):
* cdef PetscInt i, nproc = 0, *procs = NULL,
* cdef PetscInt *numprocs = NULL, **indices = NULL # <<<<<<<<<<<<<<
* cdef object neighs = { }
* CHKERR( ISLocalToGlobalMappingGetInfo(
*/
__pyx_v_numprocs = NULL;
__pyx_v_indices = NULL;
/* "petsc4py/PETSc/IS.pyx":474
* cdef PetscInt i, nproc = 0, *procs = NULL,
* cdef PetscInt *numprocs = NULL, **indices = NULL
* cdef object neighs = { } # <<<<<<<<<<<<<<
* CHKERR( ISLocalToGlobalMappingGetInfo(
* self.lgm, &nproc, &procs, &numprocs, &indices) )
*/
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_neighs = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/IS.pyx":475
* cdef PetscInt *numprocs = NULL, **indices = NULL
* cdef object neighs = { }
* CHKERR( ISLocalToGlobalMappingGetInfo( # <<<<<<<<<<<<<<
* self.lgm, &nproc, &procs, &numprocs, &indices) )
* try:
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 475, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":477
* 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":478
* 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":479
* 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(38, 479, __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(38, 479, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_4);
if (unlikely(PyObject_SetItem(__pyx_v_neighs, __pyx_t_4, __pyx_t_1) < 0)) __PYX_ERR(38, 479, __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":481
* 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":482
* finally:
* ISLocalToGlobalMappingRestoreInfo(
* self.lgm, &nproc, &procs, &numprocs, &indices) # <<<<<<<<<<<<<<
* return neighs
*
*/
(void)(ISLocalToGlobalMappingRestoreInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices)));
goto __pyx_L5;
}
__pyx_L4_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_11);
__Pyx_XGOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_t_13);
__pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename;
{
/* "petsc4py/PETSc/IS.pyx":481
* neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i])
* finally:
* ISLocalToGlobalMappingRestoreInfo( # <<<<<<<<<<<<<<
* self.lgm, &nproc, &procs, &numprocs, &indices)
* return neighs
*/
(void)(ISLocalToGlobalMappingRestoreInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices)));
}
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
}
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
__pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
__pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7;
goto __pyx_L1_error;
}
__pyx_L5:;
}
/* "petsc4py/PETSc/IS.pyx":483
* ISLocalToGlobalMappingRestoreInfo(
* self.lgm, &nproc, &procs, &numprocs, &indices)
* return neighs # <<<<<<<<<<<<<<
*
* def getBlockInfo(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_neighs);
__pyx_r = __pyx_v_neighs;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":471
* return oindices
*
* def getInfo(self): # <<<<<<<<<<<<<<
* cdef PetscInt i, nproc = 0, *procs = NULL,
* cdef PetscInt *numprocs = NULL, **indices = NULL
*/
/* 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":485
* return neighs
*
* def getBlockInfo(self): # <<<<<<<<<<<<<<
* cdef PetscInt i, nproc = 0, *procs = NULL,
* cdef PetscInt *numprocs = NULL, **indices = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_29getBlockInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_28getBlockInfo[] = "LGMap.getBlockInfo(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_29getBlockInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getBlockInfo (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getBlockInfo", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockInfo", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_28getBlockInfo(((struct PyPetscLGMapObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_28getBlockInfo(struct PyPetscLGMapObject *__pyx_v_self) {
PetscInt __pyx_v_i;
PetscInt __pyx_v_nproc;
PetscInt *__pyx_v_procs;
PetscInt *__pyx_v_numprocs;
PetscInt **__pyx_v_indices;
PyObject *__pyx_v_neighs = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
PetscInt __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
int __pyx_t_6;
char const *__pyx_t_7;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getBlockInfo", 0);
/* "petsc4py/PETSc/IS.pyx":486
*
* def getBlockInfo(self):
* cdef PetscInt i, nproc = 0, *procs = NULL, # <<<<<<<<<<<<<<
* cdef PetscInt *numprocs = NULL, **indices = NULL
* cdef object neighs = { }
*/
__pyx_v_nproc = 0;
__pyx_v_procs = NULL;
/* "petsc4py/PETSc/IS.pyx":487
* def getBlockInfo(self):
* cdef PetscInt i, nproc = 0, *procs = NULL,
* cdef PetscInt *numprocs = NULL, **indices = NULL # <<<<<<<<<<<<<<
* cdef object neighs = { }
* CHKERR( ISLocalToGlobalMappingGetBlockInfo(
*/
__pyx_v_numprocs = NULL;
__pyx_v_indices = NULL;
/* "petsc4py/PETSc/IS.pyx":488
* cdef PetscInt i, nproc = 0, *procs = NULL,
* cdef PetscInt *numprocs = NULL, **indices = NULL
* cdef object neighs = { } # <<<<<<<<<<<<<<
* CHKERR( ISLocalToGlobalMappingGetBlockInfo(
* self.lgm, &nproc, &procs, &numprocs, &indices) )
*/
__pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 488, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_neighs = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/IS.pyx":489
* cdef PetscInt *numprocs = NULL, **indices = NULL
* cdef object neighs = { }
* CHKERR( ISLocalToGlobalMappingGetBlockInfo( # <<<<<<<<<<<<<<
* self.lgm, &nproc, &procs, &numprocs, &indices) )
* try:
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetBlockInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 489, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":491
* 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":492
* 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":493
* 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(38, 493, __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(38, 493, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_4);
if (unlikely(PyObject_SetItem(__pyx_v_neighs, __pyx_t_4, __pyx_t_1) < 0)) __PYX_ERR(38, 493, __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":495
* 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":496
* finally:
* ISLocalToGlobalMappingRestoreBlockInfo(
* self.lgm, &nproc, &procs, &numprocs, &indices) # <<<<<<<<<<<<<<
* return neighs
*
*/
(void)(ISLocalToGlobalMappingRestoreBlockInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices)));
goto __pyx_L5;
}
__pyx_L4_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_11);
__Pyx_XGOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_t_13);
__pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename;
{
/* "petsc4py/PETSc/IS.pyx":495
* neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i])
* finally:
* ISLocalToGlobalMappingRestoreBlockInfo( # <<<<<<<<<<<<<<
* self.lgm, &nproc, &procs, &numprocs, &indices)
* return neighs
*/
(void)(ISLocalToGlobalMappingRestoreBlockInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices)));
}
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
}
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
__pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
__pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7;
goto __pyx_L1_error;
}
__pyx_L5:;
}
/* "petsc4py/PETSc/IS.pyx":497
* 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":485
* return neighs
*
* def getBlockInfo(self): # <<<<<<<<<<<<<<
* cdef PetscInt i, nproc = 0, *procs = NULL,
* cdef PetscInt *numprocs = NULL, **indices = NULL
*/
/* 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":501
* #
*
* def apply(self, indices, result=None): # <<<<<<<<<<<<<<
* cdef PetscInt niidx = 0, *iidx = NULL
* cdef PetscInt noidx = 0, *oidx = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_31apply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_30apply[] = "LGMap.apply(self, indices, result=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_31apply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_indices = 0;
PyObject *__pyx_v_result = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_result,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply") < 0)) __PYX_ERR(38, 501, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_indices = values[0];
__pyx_v_result = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("apply", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 501, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_30apply(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_result);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_30apply(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result) {
PetscInt __pyx_v_niidx;
PetscInt *__pyx_v_iidx;
PetscInt __pyx_v_noidx;
PetscInt *__pyx_v_oidx;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
PetscErrorCode __pyx_t_4;
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":502
*
* def apply(self, indices, result=None):
* 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":503
* def apply(self, indices, result=None):
* 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":504
* 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(38, 504, __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":505
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_niidx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 505, __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":506
* 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(38, 506, __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":507
* 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())) {
if (unlikely(!((__pyx_v_niidx == __pyx_v_noidx) != 0))) {
PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_incompatible_array_sizes);
__PYX_ERR(38, 507, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/IS.pyx":508
* result = oarray_i(result, &noidx, &oidx)
* assert niidx == noidx, "incompatible array sizes"
* CHKERR( ISLocalToGlobalMappingApply( # <<<<<<<<<<<<<<
* self.lgm, niidx, iidx, oidx) )
* return result
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingApply(__pyx_v_self->lgm, __pyx_v_niidx, __pyx_v_iidx, __pyx_v_oidx)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 508, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":510
* CHKERR( ISLocalToGlobalMappingApply(
* self.lgm, niidx, iidx, oidx) )
* return result # <<<<<<<<<<<<<<
*
* def applyBlock(self, indices, result=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":501
* #
*
* def apply(self, indices, result=None): # <<<<<<<<<<<<<<
* cdef PetscInt niidx = 0, *iidx = NULL
* cdef PetscInt noidx = 0, *oidx = NULL
*/
/* 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":512
* return result
*
* def applyBlock(self, indices, result=None): # <<<<<<<<<<<<<<
* cdef PetscInt niidx = 0, *iidx = NULL
* cdef PetscInt noidx = 0, *oidx = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_33applyBlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_32applyBlock[] = "LGMap.applyBlock(self, indices, result=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_33applyBlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_indices = 0;
PyObject *__pyx_v_result = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_result,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applyBlock") < 0)) __PYX_ERR(38, 512, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_indices = values[0];
__pyx_v_result = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("applyBlock", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 512, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyBlock", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_32applyBlock(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_result);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_32applyBlock(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result) {
PetscInt __pyx_v_niidx;
PetscInt *__pyx_v_iidx;
PetscInt __pyx_v_noidx;
PetscInt *__pyx_v_oidx;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
PetscErrorCode __pyx_t_4;
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":513
*
* def applyBlock(self, indices, result=None):
* 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":514
* def applyBlock(self, indices, result=None):
* 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":515
* 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(38, 515, __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":516
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_niidx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 516, __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":517
* 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(38, 517, __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":518
* 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())) {
if (unlikely(!((__pyx_v_niidx == __pyx_v_noidx) != 0))) {
PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_incompatible_array_sizes);
__PYX_ERR(38, 518, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/IS.pyx":519
* result = oarray_i(result, &noidx, &oidx)
* assert niidx == noidx, "incompatible array sizes"
* CHKERR( ISLocalToGlobalMappingApplyBlock( # <<<<<<<<<<<<<<
* self.lgm, niidx, iidx, oidx) )
* return result
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingApplyBlock(__pyx_v_self->lgm, __pyx_v_niidx, __pyx_v_iidx, __pyx_v_oidx)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 519, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":521
* CHKERR( ISLocalToGlobalMappingApplyBlock(
* self.lgm, niidx, iidx, oidx) )
* return result # <<<<<<<<<<<<<<
*
* def applyIS(self, IS iset):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":512
* return result
*
* def applyBlock(self, indices, result=None): # <<<<<<<<<<<<<<
* cdef PetscInt niidx = 0, *iidx = NULL
* cdef PetscInt noidx = 0, *oidx = NULL
*/
/* 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":523
* return result
*
* def applyIS(self, IS iset): # <<<<<<<<<<<<<<
* cdef IS result = IS()
* CHKERR( ISLocalToGlobalMappingApplyIS(
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_35applyIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_34applyIS[] = "LGMap.applyIS(self, IS iset)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_35applyIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_iset = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applyIS") < 0)) __PYX_ERR(38, 523, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_iset = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("applyIS", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 523, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyIS", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(38, 523, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_34applyIS(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_iset);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_34applyIS(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) {
struct PyPetscISObject *__pyx_v_result = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("applyIS", 0);
/* "petsc4py/PETSc/IS.pyx":524
*
* def applyIS(self, IS iset):
* cdef IS result = IS() # <<<<<<<<<<<<<<
* CHKERR( ISLocalToGlobalMappingApplyIS(
* self.lgm, iset.iset, &result.iset) )
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 524, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_result = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/IS.pyx":525
* def applyIS(self, IS iset):
* cdef IS result = IS()
* CHKERR( ISLocalToGlobalMappingApplyIS( # <<<<<<<<<<<<<<
* self.lgm, iset.iset, &result.iset) )
* return result
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingApplyIS(__pyx_v_self->lgm, __pyx_v_iset->iset, (&__pyx_v_result->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 525, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":527
* CHKERR( ISLocalToGlobalMappingApplyIS(
* self.lgm, iset.iset, &result.iset) )
* return result # <<<<<<<<<<<<<<
*
* def applyInverse(self, indices, mode=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":523
* return result
*
* def applyIS(self, IS iset): # <<<<<<<<<<<<<<
* cdef IS result = IS()
* CHKERR( ISLocalToGlobalMappingApplyIS(
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyIS", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":529
* return result
*
* def applyInverse(self, indices, mode=None): # <<<<<<<<<<<<<<
* cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK
* if mode is not None: cmode = mode
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_37applyInverse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_36applyInverse[] = "LGMap.applyInverse(self, indices, mode=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_37applyInverse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_indices = 0;
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_mode,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applyInverse") < 0)) __PYX_ERR(38, 529, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_indices = values[0];
__pyx_v_mode = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("applyInverse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 529, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyInverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_36applyInverse(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_36applyInverse(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_mode) {
ISGlobalToLocalMappingMode __pyx_v_cmode;
PetscInt __pyx_v_n;
PetscInt *__pyx_v_idx;
PetscInt __pyx_v_nout;
PetscInt *__pyx_v_idxout;
PyArrayObject *__pyx_v_result = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
ISGlobalToLocalMappingMode __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PetscErrorCode __pyx_t_5;
PyObject *__pyx_t_6 = 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":530
*
* def applyInverse(self, indices, mode=None):
* 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":531
* def applyInverse(self, indices, mode=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = ((ISGlobalToLocalMappingMode)__Pyx_PyInt_As_ISGlobalToLocalMappingMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 531, __pyx_L1_error)
__pyx_v_cmode = __pyx_t_3;
}
/* "petsc4py/PETSc/IS.pyx":532
* 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":533
* 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_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_n), (&__pyx_v_idx))); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 533, __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":534
* 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":535
* 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_2 = ((__pyx_v_cmode != IS_GTOLM_MASK) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/IS.pyx":536
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 536, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":535
* 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":538
* 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_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_nout)); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_t_4, (&__pyx_v_nout), (&__pyx_v_idxout))); if (unlikely(!__pyx_t_6)) __PYX_ERR(38, 538, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_result = ((PyArrayObject *)__pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/IS.pyx":539
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 539, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":541
* CHKERR( ISGlobalToLocalMappingApply(
* self.lgm, cmode, n, idx, &nout, idxout) )
* return result # <<<<<<<<<<<<<<
*
* def applyBlockInverse(self, indices, mode=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":529
* return result
*
* def applyInverse(self, indices, mode=None): # <<<<<<<<<<<<<<
* cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK
* if mode is not None: cmode = mode
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__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":543
* return result
*
* def applyBlockInverse(self, indices, mode=None): # <<<<<<<<<<<<<<
* cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK
* if mode is not None: cmode = mode
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_39applyBlockInverse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_5LGMap_38applyBlockInverse[] = "LGMap.applyBlockInverse(self, indices, mode=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_39applyBlockInverse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_indices = 0;
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_mode,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applyBlockInverse") < 0)) __PYX_ERR(38, 543, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_indices = values[0];
__pyx_v_mode = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("applyBlockInverse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 543, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyBlockInverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_38applyBlockInverse(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_38applyBlockInverse(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_mode) {
ISGlobalToLocalMappingMode __pyx_v_cmode;
PetscInt __pyx_v_n;
PetscInt *__pyx_v_idx;
PetscInt __pyx_v_nout;
PetscInt *__pyx_v_idxout;
PyArrayObject *__pyx_v_result = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
ISGlobalToLocalMappingMode __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PetscErrorCode __pyx_t_5;
PyObject *__pyx_t_6 = 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":544
*
* def applyBlockInverse(self, indices, mode=None):
* 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":545
* def applyBlockInverse(self, indices, mode=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = ((ISGlobalToLocalMappingMode)__Pyx_PyInt_As_ISGlobalToLocalMappingMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 545, __pyx_L1_error)
__pyx_v_cmode = __pyx_t_3;
}
/* "petsc4py/PETSc/IS.pyx":546
* 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":547
* 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_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_n), (&__pyx_v_idx))); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 547, __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":548
* 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":549
* 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_2 = ((__pyx_v_cmode != IS_GTOLM_MASK) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/IS.pyx":550
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 550, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":549
* 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":552
* 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_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_nout)); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_t_4, (&__pyx_v_nout), (&__pyx_v_idxout))); if (unlikely(!__pyx_t_6)) __PYX_ERR(38, 552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_result = ((PyArrayObject *)__pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/IS.pyx":553
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(38, 553, __pyx_L1_error)
/* "petsc4py/PETSc/IS.pyx":555
* 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":543
* return result
*
* def applyBlockInverse(self, indices, mode=None): # <<<<<<<<<<<<<<
* cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK
* if mode is not None: cmode = mode
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__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":559
*
* property size:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_4size___get__(((struct PyPetscLGMapObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4size___get__(struct PyPetscLGMapObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/IS.pyx":560
* property size:
* def __get__(self):
* return self.getSize() # <<<<<<<<<<<<<<
*
* property block_size:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 560, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 560, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":559
*
* property size:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getSize()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":563
*
* property block_size:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_10block_size___get__(((struct PyPetscLGMapObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10block_size___get__(struct PyPetscLGMapObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/IS.pyx":564
* property block_size:
* def __get__(self):
* return self.getBlockSize() # <<<<<<<<<<<<<<
*
* property indices:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 564, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 564, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":563
*
* property block_size:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getBlockSize()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.block_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":567
*
* property indices:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_7indices___get__(((struct PyPetscLGMapObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_7indices___get__(struct PyPetscLGMapObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/IS.pyx":568
* property indices:
* def __get__(self):
* return self.getIndices() # <<<<<<<<<<<<<<
*
* property block_indices:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getIndices); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 568, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 568, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":567
*
* property indices:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getIndices()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.indices.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":571
*
* property block_indices:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_13block_indices___get__(((struct PyPetscLGMapObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_13block_indices___get__(struct PyPetscLGMapObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/IS.pyx":572
* property block_indices:
* def __get__(self):
* return self.getBlockIndices() # <<<<<<<<<<<<<<
*
* property info:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockIndices); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 572, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 572, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":571
*
* property block_indices:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getBlockIndices()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.block_indices.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":575
*
* property info:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_4info___get__(((struct PyPetscLGMapObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4info___get__(struct PyPetscLGMapObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/IS.pyx":576
* property info:
* def __get__(self):
* return self.getInfo() # <<<<<<<<<<<<<<
*
* property block_info:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 576, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 576, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":575
*
* property info:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getInfo()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/IS.pyx":579
*
* property block_info:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_10block_info___get__(((struct PyPetscLGMapObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10block_info___get__(struct PyPetscLGMapObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/IS.pyx":580
* property block_info:
* def __get__(self):
* return self.getBlockInfo() # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 580, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 580, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/IS.pyx":579
*
* property block_info:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getBlockInfo()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.LGMap.block_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SF.pyx":19
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF___cinit__(((struct PyPetscSFObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_2SF___cinit__(struct PyPetscSFObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/SF.pyx":20
*
* 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":21
* def __cinit__(self):
* self.obj = <PetscObject*> &self.sf
* self.sf = NULL # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
__pyx_v_self->sf = NULL;
/* "petsc4py/PETSc/SF.pyx":19
* Type = SFType
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.sf
* self.sf = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SF.pyx":23
* self.sf = NULL
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSFDestroy(&self.sf) )
* self.sf = NULL
*/
/* Python wrapper */
static void __pyx_pw_8petsc4py_5PETSc_2SF_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8petsc4py_5PETSc_2SF_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__pyx_pf_8petsc4py_5PETSc_2SF_2__dealloc__(((struct PyPetscSFObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_pf_8petsc4py_5PETSc_2SF_2__dealloc__(struct PyPetscSFObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__dealloc__", 0);
/* "petsc4py/PETSc/SF.pyx":24
*
* def __dealloc__(self):
* CHKERR( PetscSFDestroy(&self.sf) ) # <<<<<<<<<<<<<<
* self.sf = NULL
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFDestroy((&__pyx_v_self->sf))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 24, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":25
* def __dealloc__(self):
* CHKERR( PetscSFDestroy(&self.sf) )
* self.sf = NULL # <<<<<<<<<<<<<<
*
* def view(self, Viewer viewer=None):
*/
__pyx_v_self->sf = NULL;
/* "petsc4py/PETSc/SF.pyx":23
* self.sf = NULL
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSFDestroy(&self.sf) )
* self.sf = NULL
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_WriteUnraisable("petsc4py.PETSc.SF.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "petsc4py/PETSc/SF.pyx":27
* self.sf = NULL
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_4view[] = "SF.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(39, 27, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 27, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(39, 27, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_4view(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_4view(struct PyPetscSFObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) {
PetscViewer __pyx_v_vwr;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/SF.pyx":28
*
* def view(self, Viewer viewer=None):
* 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":29
* def view(self, Viewer viewer=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
}
/* "petsc4py/PETSc/SF.pyx":30
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
* CHKERR( PetscSFView(self.sf, vwr) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFView(__pyx_v_self->sf, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 30, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":27
* self.sf = NULL
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.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":32
* CHKERR( PetscSFView(self.sf, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSFDestroy(&self.sf) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_6destroy[] = "SF.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_6destroy(((struct PyPetscSFObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_6destroy(struct PyPetscSFObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/SF.pyx":33
*
* def destroy(self):
* 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(39, 33, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":34
* def destroy(self):
* CHKERR( PetscSFDestroy(&self.sf) )
* return self # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/SF.pyx":32
* CHKERR( PetscSFView(self.sf, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSFDestroy(&self.sf) )
* return self
*/
/* 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":36
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSF newsf = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_8create[] = "SF.create(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(39, 36, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 36, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_8create(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_8create(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_comm) {
MPI_Comm __pyx_v_ccomm;
PetscSF __pyx_v_newsf;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("create", 0);
/* "petsc4py/PETSc/SF.pyx":37
*
* def create(self, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(39, 37, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/SF.pyx":38
* def create(self, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSF newsf = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscSFCreate(ccomm, &newsf) )
* PetscCLEAR(self.obj); self.sf = newsf
*/
__pyx_v_newsf = NULL;
/* "petsc4py/PETSc/SF.pyx":39
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSF newsf = NULL
* CHKERR( PetscSFCreate(ccomm, &newsf) ) # <<<<<<<<<<<<<<
* 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(39, 39, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":40
* cdef PetscSF newsf = NULL
* CHKERR( PetscSFCreate(ccomm, &newsf) )
* PetscCLEAR(self.obj); self.sf = newsf # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->sf = __pyx_v_newsf;
/* "petsc4py/PETSc/SF.pyx":41
* CHKERR( PetscSFCreate(ccomm, &newsf) )
* PetscCLEAR(self.obj); self.sf = newsf
* return self # <<<<<<<<<<<<<<
*
* def setType(self, sf_type):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/SF.pyx":36
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSF newsf = NULL
*/
/* 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":43
* return self
*
* def setType(self, sf_type): # <<<<<<<<<<<<<<
* cdef PetscSFType cval = NULL
* sf_type = str2bytes(sf_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_10setType[] = "SF.setType(self, sf_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_sf_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sf_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(39, 43, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_sf_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 43, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.setType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_10setType(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_sf_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_10setType(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_sf_type) {
PetscSFType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setType", 0);
__Pyx_INCREF(__pyx_v_sf_type);
/* "petsc4py/PETSc/SF.pyx":44
*
* def setType(self, sf_type):
* cdef PetscSFType cval = NULL # <<<<<<<<<<<<<<
* sf_type = str2bytes(sf_type, &cval)
* CHKERR( PetscSFSetType(self.sf, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/SF.pyx":45
* def setType(self, sf_type):
* 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(39, 45, __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":46
* cdef PetscSFType cval = NULL
* sf_type = str2bytes(sf_type, &cval)
* CHKERR( PetscSFSetType(self.sf, cval) ) # <<<<<<<<<<<<<<
*
* def getType(self):
*/
__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(39, 46, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":43
* return self
*
* def setType(self, sf_type): # <<<<<<<<<<<<<<
* cdef PetscSFType cval = NULL
* sf_type = str2bytes(sf_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":48
* CHKERR( PetscSFSetType(self.sf, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscSFType cval = NULL
* CHKERR( PetscSFGetType(self.sf, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_12getType[] = "SF.getType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_12getType(((struct PyPetscSFObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_12getType(struct PyPetscSFObject *__pyx_v_self) {
PetscSFType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getType", 0);
/* "petsc4py/PETSc/SF.pyx":49
*
* def getType(self):
* cdef PetscSFType cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscSFGetType(self.sf, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/SF.pyx":50
* def getType(self):
* 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(39, 50, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":51
* cdef PetscSFType cval = NULL
* CHKERR( PetscSFGetType(self.sf, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def setFromOptions(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 51, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SF.pyx":48
* CHKERR( PetscSFSetType(self.sf, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscSFType cval = NULL
* CHKERR( PetscSFGetType(self.sf, &cval) )
*/
/* 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":53
* return bytes2str(cval)
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSFSetFromOptions(self.sf) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_15setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_14setFromOptions[] = "SF.setFromOptions(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_15setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_14setFromOptions(((struct PyPetscSFObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_14setFromOptions(struct PyPetscSFObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFromOptions", 0);
/* "petsc4py/PETSc/SF.pyx":54
*
* def setFromOptions(self):
* CHKERR( PetscSFSetFromOptions(self.sf) ) # <<<<<<<<<<<<<<
*
* def setUp(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFSetFromOptions(__pyx_v_self->sf)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 54, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":53
* return bytes2str(cval)
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSFSetFromOptions(self.sf) )
*
*/
/* 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":56
* CHKERR( PetscSFSetFromOptions(self.sf) )
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSFSetUp(self.sf) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_17setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_16setUp[] = "SF.setUp(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_17setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setUp (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_16setUp(((struct PyPetscSFObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_16setUp(struct PyPetscSFObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setUp", 0);
/* "petsc4py/PETSc/SF.pyx":57
*
* def setUp(self):
* CHKERR( PetscSFSetUp(self.sf) ) # <<<<<<<<<<<<<<
*
* def reset(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFSetUp(__pyx_v_self->sf)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 57, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":56
* CHKERR( PetscSFSetFromOptions(self.sf) )
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSFSetUp(self.sf) )
*
*/
/* 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":59
* CHKERR( PetscSFSetUp(self.sf) )
*
* def reset(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSFReset(self.sf) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_19reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_18reset[] = "SF.reset(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_19reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_18reset(((struct PyPetscSFObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_18reset(struct PyPetscSFObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reset", 0);
/* "petsc4py/PETSc/SF.pyx":60
*
* def reset(self):
* 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(39, 60, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":59
* CHKERR( PetscSFSetUp(self.sf) )
*
* def reset(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSFReset(self.sf) )
*
*/
/* 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":64
* #
*
* def getGraph(self): # <<<<<<<<<<<<<<
* """nleaves can be determined from the size of local"""
* cdef PetscInt nroots = 0, nleaves = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_21getGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_20getGraph[] = "SF.getGraph(self)\nnleaves can be determined from the size of local";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_21getGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getGraph (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getGraph", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGraph", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_20getGraph(((struct PyPetscSFObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_20getGraph(struct PyPetscSFObject *__pyx_v_self) {
PetscInt __pyx_v_nroots;
PetscInt __pyx_v_nleaves;
PetscInt const *__pyx_v_ilocal;
PetscSFNode const *__pyx_v_iremote;
PyArrayObject *__pyx_v_local = NULL;
PyObject *__pyx_v_remote = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getGraph", 0);
/* "petsc4py/PETSc/SF.pyx":66
* def getGraph(self):
* """nleaves can be determined from the size of local"""
* 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":67
* """nleaves can be determined from the size of local"""
* 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":68
* 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":69
* 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(39, 69, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":70
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/SF.pyx":71
* CHKERR( PetscSFGetGraph(self.sf, &nroots, &nleaves, &ilocal, &iremote) )
* if ilocal == NULL:
* local = arange(0, nleaves, 1) # <<<<<<<<<<<<<<
* else:
* local = array_i(nleaves, ilocal)
*/
__pyx_t_3 = __Pyx_PyInt_From_PetscInt(__pyx_v_nleaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 71, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_int_0, __pyx_t_3, __pyx_int_1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 71, __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":70
* 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":73
* 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(39, 73, __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":74
* 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(39, 74, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_remote = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/SF.pyx":75
* 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_PyObject_GetAttrStr(__pyx_v_remote, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 75, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyInt_From_PetscInt(__pyx_v_nleaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 75, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
__pyx_t_7 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
__pyx_t_7 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_int_2};
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 75, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_int_2};
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 75, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
#endif
{
__pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(39, 75, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (__pyx_t_6) {
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
}
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5);
__Pyx_INCREF(__pyx_int_2);
__Pyx_GIVEREF(__pyx_int_2);
PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_int_2);
__pyx_t_5 = 0;
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 75, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF_SET(__pyx_v_remote, __pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/SF.pyx":76
* remote = array_i(nleaves*2, <const PetscInt*>iremote)
* remote = remote.reshape(nleaves, 2)
* return toInt(nroots), local, remote # <<<<<<<<<<<<<<
*
* def setGraph(self, nroots, local, remote):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nroots); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 76, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 76, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_local));
__Pyx_GIVEREF(((PyObject *)__pyx_v_local));
PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_local));
__Pyx_INCREF(__pyx_v_remote);
__Pyx_GIVEREF(__pyx_v_remote);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_remote);
__pyx_t_4 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SF.pyx":64
* #
*
* def getGraph(self): # <<<<<<<<<<<<<<
* """nleaves can be determined from the size of local"""
* cdef PetscInt nroots = 0, nleaves = 0
*/
/* 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_8);
__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":78
* return toInt(nroots), local, remote
*
* def setGraph(self, nroots, local, remote): # <<<<<<<<<<<<<<
* """
* The nleaves argument is determined from the size of local and/or remote.
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_23setGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_22setGraph[] = "SF.setGraph(self, nroots, local, remote)\n\n The nleaves argument is determined from the size of local and/or remote.\n local may be None, meaning contiguous storage.\n remote should be 2*nleaves long as (rank, index) pairs.\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_23setGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_nroots = 0;
PyObject *__pyx_v_local = 0;
PyObject *__pyx_v_remote = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nroots,&__pyx_n_s_local,&__pyx_n_s_remote,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nroots)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_local)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setGraph", 1, 3, 3, 1); __PYX_ERR(39, 78, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remote)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setGraph", 1, 3, 3, 2); __PYX_ERR(39, 78, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGraph") < 0)) __PYX_ERR(39, 78, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_nroots = values[0];
__pyx_v_local = values[1];
__pyx_v_remote = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setGraph", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 78, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.setGraph", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_22setGraph(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_nroots, __pyx_v_local, __pyx_v_remote);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_22setGraph(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_nroots, PyObject *__pyx_v_local, PyObject *__pyx_v_remote) {
PetscInt __pyx_v_cnroots;
PetscInt __pyx_v_nleaves;
PetscInt __pyx_v_nremote;
PetscInt *__pyx_v_ilocal;
PetscSFNode *__pyx_v_iremote;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
PetscErrorCode __pyx_t_5;
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":84
* remote should be 2*nleaves long as (rank, index) pairs.
* """
* 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(39, 84, __pyx_L1_error)
__pyx_v_cnroots = __pyx_t_1;
/* "petsc4py/PETSc/SF.pyx":85
* """
* 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":86
* 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":87
* 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":88
* 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":89
* 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(39, 89, __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":90
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* "petsc4py/PETSc/SF.pyx":91
* 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(39, 91, __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":92
* 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())) {
if (unlikely(!(((2 * __pyx_v_nleaves) == __pyx_v_nremote) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(39, 92, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/SF.pyx":90
* 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":94
* 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())) {
if (unlikely(!(((__pyx_v_nremote % 2) == 0) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(39, 94, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/SF.pyx":95
* 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":96
* 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):
*/
__pyx_t_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 96, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":78
* return toInt(nroots), local, remote
*
* def setGraph(self, nroots, local, remote): # <<<<<<<<<<<<<<
* """
* The nleaves argument is determined from the size of local and/or remote.
*/
/* 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":98
* CHKERR( PetscSFSetGraph(self.sf, cnroots, nleaves, ilocal, PETSC_COPY_VALUES, iremote, PETSC_COPY_VALUES) )
*
* def setRankOrder(self, flag): # <<<<<<<<<<<<<<
* cdef PetscBool bval = asBool(flag)
* CHKERR( PetscSFSetRankOrder(self.sf, bval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_25setRankOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_24setRankOrder[] = "SF.setRankOrder(self, flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_25setRankOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flag = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setRankOrder") < 0)) __PYX_ERR(39, 98, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setRankOrder", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 98, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.setRankOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_24setRankOrder(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_flag);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_24setRankOrder(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_flag) {
PetscBool __pyx_v_bval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscBool __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setRankOrder", 0);
/* "petsc4py/PETSc/SF.pyx":99
*
* def setRankOrder(self, flag):
* 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(39, 99, __pyx_L1_error)
__pyx_v_bval = __pyx_t_1;
/* "petsc4py/PETSc/SF.pyx":100
* def setRankOrder(self, flag):
* cdef PetscBool bval = asBool(flag)
* CHKERR( PetscSFSetRankOrder(self.sf, bval) ) # <<<<<<<<<<<<<<
*
* #
*/
__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(39, 100, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":98
* CHKERR( PetscSFSetGraph(self.sf, cnroots, nleaves, ilocal, PETSC_COPY_VALUES, iremote, PETSC_COPY_VALUES) )
*
* def setRankOrder(self, flag): # <<<<<<<<<<<<<<
* cdef PetscBool bval = asBool(flag)
* CHKERR( PetscSFSetRankOrder(self.sf, bval) )
*/
/* 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":104
* #
*
* def getMulti(self): # <<<<<<<<<<<<<<
* cdef SF sf = SF()
* CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_27getMulti(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_26getMulti[] = "SF.getMulti(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_27getMulti(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getMulti (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getMulti", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMulti", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_26getMulti(((struct PyPetscSFObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_26getMulti(struct PyPetscSFObject *__pyx_v_self) {
struct PyPetscSFObject *__pyx_v_sf = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getMulti", 0);
/* "petsc4py/PETSc/SF.pyx":105
*
* def getMulti(self):
* cdef SF sf = SF() # <<<<<<<<<<<<<<
* CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) )
* PetscINCREF(sf.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 105, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SF.pyx":106
* def getMulti(self):
* cdef SF sf = SF()
* CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) ) # <<<<<<<<<<<<<<
* PetscINCREF(sf.obj)
* return sf
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFGetMultiSF(__pyx_v_self->sf, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 106, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":107
* cdef SF sf = SF()
* CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) )
* PetscINCREF(sf.obj) # <<<<<<<<<<<<<<
* return sf
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sf->__pyx_base.obj));
/* "petsc4py/PETSc/SF.pyx":108
* CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) )
* PetscINCREF(sf.obj)
* return sf # <<<<<<<<<<<<<<
*
* def createInverse(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_sf));
__pyx_r = ((PyObject *)__pyx_v_sf);
goto __pyx_L0;
/* "petsc4py/PETSc/SF.pyx":104
* #
*
* def getMulti(self): # <<<<<<<<<<<<<<
* cdef SF sf = SF()
* CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.SF.getMulti", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_sf);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SF.pyx":110
* return sf
*
* def createInverse(self): # <<<<<<<<<<<<<<
* cdef SF sf = SF()
* CHKERR( PetscSFCreateInverseSF(self.sf, &sf.sf) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_29createInverse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_28createInverse[] = "SF.createInverse(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_29createInverse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createInverse (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("createInverse", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createInverse", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_28createInverse(((struct PyPetscSFObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_28createInverse(struct PyPetscSFObject *__pyx_v_self) {
struct PyPetscSFObject *__pyx_v_sf = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createInverse", 0);
/* "petsc4py/PETSc/SF.pyx":111
*
* def createInverse(self):
* cdef SF sf = SF() # <<<<<<<<<<<<<<
* CHKERR( PetscSFCreateInverseSF(self.sf, &sf.sf) )
* return sf
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 111, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SF.pyx":112
* def createInverse(self):
* cdef SF sf = SF()
* CHKERR( PetscSFCreateInverseSF(self.sf, &sf.sf) ) # <<<<<<<<<<<<<<
* return sf
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCreateInverseSF(__pyx_v_self->sf, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 112, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":113
* cdef SF sf = SF()
* CHKERR( PetscSFCreateInverseSF(self.sf, &sf.sf) )
* return sf # <<<<<<<<<<<<<<
*
* def computeDegree(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_sf));
__pyx_r = ((PyObject *)__pyx_v_sf);
goto __pyx_L0;
/* "petsc4py/PETSc/SF.pyx":110
* return sf
*
* def createInverse(self): # <<<<<<<<<<<<<<
* cdef SF sf = SF()
* CHKERR( PetscSFCreateInverseSF(self.sf, &sf.sf) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.SF.createInverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_sf);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SF.pyx":115
* return sf
*
* def computeDegree(self): # <<<<<<<<<<<<<<
* cdef const PetscInt *cdegree = NULL
* cdef PetscInt nroots
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_31computeDegree(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_30computeDegree[] = "SF.computeDegree(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_31computeDegree(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("computeDegree (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("computeDegree", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "computeDegree", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_30computeDegree(((struct PyPetscSFObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_30computeDegree(struct PyPetscSFObject *__pyx_v_self) {
PetscInt const *__pyx_v_cdegree;
PetscInt __pyx_v_nroots;
PyArrayObject *__pyx_v_degree = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("computeDegree", 0);
/* "petsc4py/PETSc/SF.pyx":116
*
* def computeDegree(self):
* cdef const PetscInt *cdegree = NULL # <<<<<<<<<<<<<<
* cdef PetscInt nroots
* CHKERR( PetscSFComputeDegreeBegin(self.sf, &cdegree) )
*/
__pyx_v_cdegree = NULL;
/* "petsc4py/PETSc/SF.pyx":118
* cdef const PetscInt *cdegree = NULL
* cdef PetscInt nroots
* CHKERR( PetscSFComputeDegreeBegin(self.sf, &cdegree) ) # <<<<<<<<<<<<<<
* CHKERR( PetscSFComputeDegreeEnd(self.sf, &cdegree) )
* CHKERR( PetscSFGetGraph(self.sf, &nroots, NULL, NULL, NULL) )
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFComputeDegreeBegin(__pyx_v_self->sf, (&__pyx_v_cdegree))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 118, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":119
* cdef PetscInt nroots
* CHKERR( PetscSFComputeDegreeBegin(self.sf, &cdegree) )
* CHKERR( PetscSFComputeDegreeEnd(self.sf, &cdegree) ) # <<<<<<<<<<<<<<
* CHKERR( PetscSFGetGraph(self.sf, &nroots, NULL, NULL, NULL) )
* degree = array_i(nroots, cdegree)
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFComputeDegreeEnd(__pyx_v_self->sf, (&__pyx_v_cdegree))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 119, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":120
* 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(39, 120, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":121
* 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(39, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_degree = ((PyArrayObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SF.pyx":122
* CHKERR( PetscSFGetGraph(self.sf, &nroots, NULL, NULL, NULL) )
* degree = array_i(nroots, cdegree)
* return degree # <<<<<<<<<<<<<<
*
* def createEmbeddedRootSF(self, selected):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_degree));
__pyx_r = ((PyObject *)__pyx_v_degree);
goto __pyx_L0;
/* "petsc4py/PETSc/SF.pyx":115
* return sf
*
* def computeDegree(self): # <<<<<<<<<<<<<<
* cdef const PetscInt *cdegree = NULL
* cdef PetscInt nroots
*/
/* 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":124
* return degree
*
* def createEmbeddedRootSF(self, selected): # <<<<<<<<<<<<<<
* cdef PetscInt nroots = asInt(len(selected))
* cdef PetscInt *cselected = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_33createEmbeddedRootSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_32createEmbeddedRootSF[] = "SF.createEmbeddedRootSF(self, selected)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_33createEmbeddedRootSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_selected = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selected,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selected)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createEmbeddedRootSF") < 0)) __PYX_ERR(39, 124, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_selected = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createEmbeddedRootSF", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 124, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.createEmbeddedRootSF", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_32createEmbeddedRootSF(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_selected);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_32createEmbeddedRootSF(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_selected) {
PetscInt __pyx_v_nroots;
PetscInt *__pyx_v_cselected;
struct PyPetscSFObject *__pyx_v_sf = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscInt __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createEmbeddedRootSF", 0);
__Pyx_INCREF(__pyx_v_selected);
/* "petsc4py/PETSc/SF.pyx":125
*
* def createEmbeddedRootSF(self, selected):
* 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(39, 125, __pyx_L1_error)
__pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 125, __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(39, 125, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_nroots = __pyx_t_3;
/* "petsc4py/PETSc/SF.pyx":126
* def createEmbeddedRootSF(self, selected):
* 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":127
* 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(39, 127, __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":128
* cdef PetscInt *cselected = NULL
* selected = iarray_i(selected, &nroots, &cselected)
* cdef SF sf = SF() # <<<<<<<<<<<<<<
* CHKERR( PetscSFCreateEmbeddedRootSF(self.sf, nroots, cselected, &sf.sf) )
* return sf
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 128, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SF.pyx":129
* selected = iarray_i(selected, &nroots, &cselected)
* cdef SF sf = SF()
* CHKERR( PetscSFCreateEmbeddedRootSF(self.sf, nroots, cselected, &sf.sf) ) # <<<<<<<<<<<<<<
* return sf
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCreateEmbeddedRootSF(__pyx_v_self->sf, __pyx_v_nroots, __pyx_v_cselected, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 129, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":130
* cdef SF sf = SF()
* CHKERR( PetscSFCreateEmbeddedRootSF(self.sf, nroots, cselected, &sf.sf) )
* return sf # <<<<<<<<<<<<<<
*
* def createEmbeddedLeafSF(self, selected):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_sf));
__pyx_r = ((PyObject *)__pyx_v_sf);
goto __pyx_L0;
/* "petsc4py/PETSc/SF.pyx":124
* return degree
*
* def createEmbeddedRootSF(self, selected): # <<<<<<<<<<<<<<
* cdef PetscInt nroots = asInt(len(selected))
* cdef PetscInt *cselected = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.SF.createEmbeddedRootSF", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_sf);
__Pyx_XDECREF(__pyx_v_selected);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SF.pyx":132
* return sf
*
* def createEmbeddedLeafSF(self, selected): # <<<<<<<<<<<<<<
* cdef PetscInt nleaves = asInt(len(selected))
* cdef PetscInt *cselected = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_35createEmbeddedLeafSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_34createEmbeddedLeafSF[] = "SF.createEmbeddedLeafSF(self, selected)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_35createEmbeddedLeafSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_selected = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selected,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selected)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createEmbeddedLeafSF") < 0)) __PYX_ERR(39, 132, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_selected = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createEmbeddedLeafSF", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 132, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.createEmbeddedLeafSF", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_34createEmbeddedLeafSF(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_selected);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_34createEmbeddedLeafSF(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_selected) {
PetscInt __pyx_v_nleaves;
PetscInt *__pyx_v_cselected;
struct PyPetscSFObject *__pyx_v_sf = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscInt __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createEmbeddedLeafSF", 0);
__Pyx_INCREF(__pyx_v_selected);
/* "petsc4py/PETSc/SF.pyx":133
*
* def createEmbeddedLeafSF(self, selected):
* 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(39, 133, __pyx_L1_error)
__pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 133, __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(39, 133, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_nleaves = __pyx_t_3;
/* "petsc4py/PETSc/SF.pyx":134
* def createEmbeddedLeafSF(self, selected):
* 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":135
* 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(39, 135, __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":136
* cdef PetscInt *cselected = NULL
* selected = iarray_i(selected, &nleaves, &cselected)
* cdef SF sf = SF() # <<<<<<<<<<<<<<
* CHKERR( PetscSFCreateEmbeddedLeafSF(self.sf, nleaves, cselected, &sf.sf) )
* return sf
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 136, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SF.pyx":137
* selected = iarray_i(selected, &nleaves, &cselected)
* cdef SF sf = SF()
* CHKERR( PetscSFCreateEmbeddedLeafSF(self.sf, nleaves, cselected, &sf.sf) ) # <<<<<<<<<<<<<<
* return sf
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCreateEmbeddedLeafSF(__pyx_v_self->sf, __pyx_v_nleaves, __pyx_v_cselected, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 137, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":138
* cdef SF sf = SF()
* CHKERR( PetscSFCreateEmbeddedLeafSF(self.sf, nleaves, cselected, &sf.sf) )
* return sf # <<<<<<<<<<<<<<
*
* def createSectionSF(self, Section rootSection, remoteOffsets, Section leafSection):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_sf));
__pyx_r = ((PyObject *)__pyx_v_sf);
goto __pyx_L0;
/* "petsc4py/PETSc/SF.pyx":132
* return sf
*
* def createEmbeddedLeafSF(self, selected): # <<<<<<<<<<<<<<
* cdef PetscInt nleaves = asInt(len(selected))
* cdef PetscInt *cselected = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.SF.createEmbeddedLeafSF", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_sf);
__Pyx_XDECREF(__pyx_v_selected);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SF.pyx":140
* return sf
*
* def createSectionSF(self, Section rootSection, remoteOffsets, Section leafSection): # <<<<<<<<<<<<<<
* cdef SF sectionSF = SF()
* cdef PetscInt noffsets = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_37createSectionSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_36createSectionSF[] = "SF.createSectionSF(self, Section rootSection, remoteOffsets, Section leafSection)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_37createSectionSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscSectionObject *__pyx_v_rootSection = 0;
PyObject *__pyx_v_remoteOffsets = 0;
struct PyPetscSectionObject *__pyx_v_leafSection = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rootSection,&__pyx_n_s_remoteOffsets,&__pyx_n_s_leafSection,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rootSection)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remoteOffsets)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createSectionSF", 1, 3, 3, 1); __PYX_ERR(39, 140, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafSection)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createSectionSF", 1, 3, 3, 2); __PYX_ERR(39, 140, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSectionSF") < 0)) __PYX_ERR(39, 140, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_rootSection = ((struct PyPetscSectionObject *)values[0]);
__pyx_v_remoteOffsets = values[1];
__pyx_v_leafSection = ((struct PyPetscSectionObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createSectionSF", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 140, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.createSectionSF", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootSection), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "rootSection", 0))) __PYX_ERR(39, 140, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafSection), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "leafSection", 0))) __PYX_ERR(39, 140, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_36createSectionSF(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_rootSection, __pyx_v_remoteOffsets, __pyx_v_leafSection);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_36createSectionSF(struct PyPetscSFObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_rootSection, PyObject *__pyx_v_remoteOffsets, struct PyPetscSectionObject *__pyx_v_leafSection) {
struct PyPetscSFObject *__pyx_v_sectionSF = 0;
PetscInt __pyx_v_noffsets;
PetscInt *__pyx_v_cremoteOffsets;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
PetscErrorCode __pyx_t_4;
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":141
*
* def createSectionSF(self, Section rootSection, remoteOffsets, Section leafSection):
* cdef SF sectionSF = SF() # <<<<<<<<<<<<<<
* cdef PetscInt noffsets = 0
* cdef PetscInt *cremoteOffsets = NULL
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_sectionSF = ((struct PyPetscSFObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SF.pyx":142
* def createSectionSF(self, Section rootSection, remoteOffsets, Section leafSection):
* 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":143
* 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":144
* cdef PetscInt noffsets = 0
* cdef PetscInt *cremoteOffsets = NULL
* if remoteOffsets is not None: # <<<<<<<<<<<<<<
* remoteOffsets = iarray_i(remoteOffsets, &noffsets, &cremoteOffsets)
* CHKERR( PetscSFCreateSectionSF(self.sf, rootSection.sec, cremoteOffsets,
*/
__pyx_t_2 = (__pyx_v_remoteOffsets != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/SF.pyx":145
* cdef PetscInt *cremoteOffsets = NULL
* if remoteOffsets is not None:
* remoteOffsets = iarray_i(remoteOffsets, &noffsets, &cremoteOffsets) # <<<<<<<<<<<<<<
* CHKERR( PetscSFCreateSectionSF(self.sf, rootSection.sec, cremoteOffsets,
* leafSection.sec, §ionSF.sf) )
*/
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_remoteOffsets, (&__pyx_v_noffsets), (&__pyx_v_cremoteOffsets))); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 145, __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":144
* 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":146
* if remoteOffsets is not None:
* remoteOffsets = iarray_i(remoteOffsets, &noffsets, &cremoteOffsets)
* CHKERR( PetscSFCreateSectionSF(self.sf, rootSection.sec, cremoteOffsets, # <<<<<<<<<<<<<<
* leafSection.sec, §ionSF.sf) )
* return sectionSF
*/
__pyx_t_4 = __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_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 146, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":148
* CHKERR( PetscSFCreateSectionSF(self.sf, rootSection.sec, cremoteOffsets,
* leafSection.sec, §ionSF.sf) )
* return sectionSF # <<<<<<<<<<<<<<
*
* def distributeSection(self, Section rootSection, Section leafSection=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_sectionSF));
__pyx_r = ((PyObject *)__pyx_v_sectionSF);
goto __pyx_L0;
/* "petsc4py/PETSc/SF.pyx":140
* return sf
*
* def createSectionSF(self, Section rootSection, remoteOffsets, Section leafSection): # <<<<<<<<<<<<<<
* cdef SF sectionSF = SF()
* cdef PetscInt noffsets = 0
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.SF.createSectionSF", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_sectionSF);
__Pyx_XDECREF(__pyx_v_remoteOffsets);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SF.pyx":150
* return sectionSF
*
* def distributeSection(self, Section rootSection, Section leafSection=None): # <<<<<<<<<<<<<<
* cdef PetscInt lpStart
* cdef PetscInt lpEnd
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_39distributeSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_38distributeSection[] = "SF.distributeSection(self, Section rootSection, Section leafSection=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_39distributeSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscSectionObject *__pyx_v_rootSection = 0;
struct PyPetscSectionObject *__pyx_v_leafSection = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rootSection,&__pyx_n_s_leafSection,0};
PyObject* values[2] = {0,0};
values[1] = (PyObject *)((struct PyPetscSectionObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rootSection)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafSection);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "distributeSection") < 0)) __PYX_ERR(39, 150, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_rootSection = ((struct PyPetscSectionObject *)values[0]);
__pyx_v_leafSection = ((struct PyPetscSectionObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("distributeSection", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 150, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.distributeSection", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootSection), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "rootSection", 0))) __PYX_ERR(39, 150, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafSection), __pyx_ptype_8petsc4py_5PETSc_Section, 1, "leafSection", 0))) __PYX_ERR(39, 150, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_38distributeSection(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_rootSection, __pyx_v_leafSection);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_38distributeSection(struct PyPetscSFObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_rootSection, struct PyPetscSectionObject *__pyx_v_leafSection) {
PetscInt __pyx_v_lpStart;
PetscInt __pyx_v_lpEnd;
PetscInt *__pyx_v_cremoteOffsets;
PyArrayObject *__pyx_v_remoteOffsets = 0;
MPI_Comm __pyx_v_ccomm;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
MPI_Comm __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
PetscErrorCode __pyx_t_5;
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":153
* cdef PetscInt lpStart
* cdef PetscInt lpEnd
* cdef PetscInt *cremoteOffsets = NULL # <<<<<<<<<<<<<<
* cdef ndarray remoteOffsets
* cdef MPI_Comm ccomm = def_Comm(self.comm, PETSC_COMM_DEFAULT)
*/
__pyx_v_cremoteOffsets = NULL;
/* "petsc4py/PETSc/SF.pyx":155
* cdef PetscInt *cremoteOffsets = NULL
* cdef ndarray remoteOffsets
* cdef MPI_Comm ccomm = def_Comm(self.comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<<
* if leafSection is None:
* leafSection = Section()
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_comm); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 155, __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(PyErr_Occurred())) __PYX_ERR(39, 155, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ccomm = __pyx_t_2;
/* "petsc4py/PETSc/SF.pyx":156
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* "petsc4py/PETSc/SF.pyx":157
* cdef MPI_Comm ccomm = def_Comm(self.comm, PETSC_COMM_DEFAULT)
* if leafSection is None:
* leafSection = Section() # <<<<<<<<<<<<<<
* if leafSection.sec == NULL:
* CHKERR( PetscSectionCreate(ccomm, &leafSection.sec) )
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_leafSection, ((struct PyPetscSectionObject *)__pyx_t_1));
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SF.pyx":156
* 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":158
* if leafSection is None:
* leafSection = Section()
* if leafSection.sec == NULL: # <<<<<<<<<<<<<<
* CHKERR( PetscSectionCreate(ccomm, &leafSection.sec) )
* CHKERR( PetscSFDistributeSection(self.sf, rootSection.sec,
*/
__pyx_t_4 = ((__pyx_v_leafSection->sec == NULL) != 0);
if (__pyx_t_4) {
/* "petsc4py/PETSc/SF.pyx":159
* leafSection = Section()
* if leafSection.sec == NULL:
* CHKERR( PetscSectionCreate(ccomm, &leafSection.sec) ) # <<<<<<<<<<<<<<
* CHKERR( PetscSFDistributeSection(self.sf, rootSection.sec,
* &cremoteOffsets, leafSection.sec) )
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionCreate(__pyx_v_ccomm, (&__pyx_v_leafSection->sec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 159, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":158
* 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":160
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 160, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":162
* 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetChart(__pyx_v_leafSection->sec, (&__pyx_v_lpStart), (&__pyx_v_lpEnd))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 162, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":163
* &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(39, 163, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_remoteOffsets = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SF.pyx":164
* CHKERR( PetscSectionGetChart(leafSection.sec, &lpStart, &lpEnd) )
* remoteOffsets = array_i(lpEnd-lpStart, cremoteOffsets)
* CHKERR( PetscFree(cremoteOffsets) ) # <<<<<<<<<<<<<<
* return (remoteOffsets, leafSection)
*
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cremoteOffsets)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 164, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":165
* remoteOffsets = array_i(lpEnd-lpStart, cremoteOffsets)
* CHKERR( PetscFree(cremoteOffsets) )
* return (remoteOffsets, leafSection) # <<<<<<<<<<<<<<
*
* def compose(self, SF sf):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_remoteOffsets));
__Pyx_GIVEREF(((PyObject *)__pyx_v_remoteOffsets));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_remoteOffsets));
__Pyx_INCREF(((PyObject *)__pyx_v_leafSection));
__Pyx_GIVEREF(((PyObject *)__pyx_v_leafSection));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_leafSection));
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SF.pyx":150
* return sectionSF
*
* def distributeSection(self, Section rootSection, Section leafSection=None): # <<<<<<<<<<<<<<
* cdef PetscInt lpStart
* cdef PetscInt lpEnd
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.SF.distributeSection", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_remoteOffsets);
__Pyx_XDECREF((PyObject *)__pyx_v_leafSection);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SF.pyx":167
* return (remoteOffsets, leafSection)
*
* def compose(self, SF sf): # <<<<<<<<<<<<<<
* cdef SF csf = SF()
* CHKERR( PetscSFCompose(self.sf, sf.sf, &csf.sf))
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_41compose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_40compose[] = "SF.compose(self, SF sf)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_41compose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscSFObject *__pyx_v_sf = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sf)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compose") < 0)) __PYX_ERR(39, 167, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_sf = ((struct PyPetscSFObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("compose", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 167, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.compose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(39, 167, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_40compose(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_sf);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_40compose(struct PyPetscSFObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf) {
struct PyPetscSFObject *__pyx_v_csf = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("compose", 0);
/* "petsc4py/PETSc/SF.pyx":168
*
* def compose(self, SF sf):
* cdef SF csf = SF() # <<<<<<<<<<<<<<
* CHKERR( PetscSFCompose(self.sf, sf.sf, &csf.sf))
* return csf
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_csf = ((struct PyPetscSFObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SF.pyx":169
* def compose(self, SF sf):
* cdef SF csf = SF()
* CHKERR( PetscSFCompose(self.sf, sf.sf, &csf.sf)) # <<<<<<<<<<<<<<
* return csf
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCompose(__pyx_v_self->sf, __pyx_v_sf->sf, (&__pyx_v_csf->sf))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 169, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":170
* cdef SF csf = SF()
* CHKERR( PetscSFCompose(self.sf, sf.sf, &csf.sf))
* return csf # <<<<<<<<<<<<<<
*
* def bcastBegin(self, unit, ndarray rootdata, ndarray leafdata, op):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_csf));
__pyx_r = ((PyObject *)__pyx_v_csf);
goto __pyx_L0;
/* "petsc4py/PETSc/SF.pyx":167
* return (remoteOffsets, leafSection)
*
* def compose(self, SF sf): # <<<<<<<<<<<<<<
* cdef SF csf = SF()
* CHKERR( PetscSFCompose(self.sf, sf.sf, &csf.sf))
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.SF.compose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_csf);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SF.pyx":172
* return csf
*
* def bcastBegin(self, unit, ndarray rootdata, ndarray leafdata, op): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* cdef MPI_Op cop = mpi4py_Op_Get(op)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_43bcastBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_42bcastBegin[] = "SF.bcastBegin(self, unit, ndarray rootdata, ndarray leafdata, op)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_43bcastBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_unit = 0;
PyArrayObject *__pyx_v_rootdata = 0;
PyArrayObject *__pyx_v_leafdata = 0;
PyObject *__pyx_v_op = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_rootdata,&__pyx_n_s_leafdata,&__pyx_n_s_op,0};
PyObject* values[4] = {0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rootdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("bcastBegin", 1, 4, 4, 1); __PYX_ERR(39, 172, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("bcastBegin", 1, 4, 4, 2); __PYX_ERR(39, 172, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("bcastBegin", 1, 4, 4, 3); __PYX_ERR(39, 172, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bcastBegin") < 0)) __PYX_ERR(39, 172, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
}
__pyx_v_unit = values[0];
__pyx_v_rootdata = ((PyArrayObject *)values[1]);
__pyx_v_leafdata = ((PyArrayObject *)values[2]);
__pyx_v_op = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("bcastBegin", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 172, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.bcastBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(39, 172, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(39, 172, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_42bcastBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_rootdata, __pyx_v_leafdata, __pyx_v_op);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_42bcastBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_rootdata, PyArrayObject *__pyx_v_leafdata, PyObject *__pyx_v_op) {
MPI_Datatype __pyx_v_dtype;
MPI_Op __pyx_v_cop;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Datatype __pyx_t_1;
MPI_Op __pyx_t_2;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("bcastBegin", 0);
/* "petsc4py/PETSc/SF.pyx":173
*
* def bcastBegin(self, unit, ndarray rootdata, ndarray leafdata, op):
* 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(PyErr_Occurred())) __PYX_ERR(39, 173, __pyx_L1_error)
__pyx_v_dtype = __pyx_t_1;
/* "petsc4py/PETSc/SF.pyx":174
* def bcastBegin(self, unit, ndarray rootdata, ndarray leafdata, op):
* 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(PyErr_Occurred())) __PYX_ERR(39, 174, __pyx_L1_error)
__pyx_v_cop = __pyx_t_2;
/* "petsc4py/PETSc/SF.pyx":175
* 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(39, 175, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":172
* return csf
*
* def bcastBegin(self, unit, ndarray rootdata, ndarray leafdata, op): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* cdef MPI_Op cop = mpi4py_Op_Get(op)
*/
/* 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":178
* <void*>PyArray_DATA(leafdata), cop) )
*
* def bcastEnd(self, unit, ndarray rootdata, ndarray leafdata, op): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* cdef MPI_Op cop = mpi4py_Op_Get(op)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_45bcastEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_44bcastEnd[] = "SF.bcastEnd(self, unit, ndarray rootdata, ndarray leafdata, op)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_45bcastEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_unit = 0;
PyArrayObject *__pyx_v_rootdata = 0;
PyArrayObject *__pyx_v_leafdata = 0;
PyObject *__pyx_v_op = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_rootdata,&__pyx_n_s_leafdata,&__pyx_n_s_op,0};
PyObject* values[4] = {0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rootdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("bcastEnd", 1, 4, 4, 1); __PYX_ERR(39, 178, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("bcastEnd", 1, 4, 4, 2); __PYX_ERR(39, 178, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("bcastEnd", 1, 4, 4, 3); __PYX_ERR(39, 178, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bcastEnd") < 0)) __PYX_ERR(39, 178, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
}
__pyx_v_unit = values[0];
__pyx_v_rootdata = ((PyArrayObject *)values[1]);
__pyx_v_leafdata = ((PyArrayObject *)values[2]);
__pyx_v_op = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("bcastEnd", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 178, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.bcastEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(39, 178, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(39, 178, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_44bcastEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_rootdata, __pyx_v_leafdata, __pyx_v_op);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_44bcastEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_rootdata, PyArrayObject *__pyx_v_leafdata, PyObject *__pyx_v_op) {
MPI_Datatype __pyx_v_dtype;
MPI_Op __pyx_v_cop;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Datatype __pyx_t_1;
MPI_Op __pyx_t_2;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("bcastEnd", 0);
/* "petsc4py/PETSc/SF.pyx":179
*
* def bcastEnd(self, unit, ndarray rootdata, ndarray leafdata, op):
* 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(PyErr_Occurred())) __PYX_ERR(39, 179, __pyx_L1_error)
__pyx_v_dtype = __pyx_t_1;
/* "petsc4py/PETSc/SF.pyx":180
* def bcastEnd(self, unit, ndarray rootdata, ndarray leafdata, op):
* 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(PyErr_Occurred())) __PYX_ERR(39, 180, __pyx_L1_error)
__pyx_v_cop = __pyx_t_2;
/* "petsc4py/PETSc/SF.pyx":181
* 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(39, 181, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":178
* <void*>PyArray_DATA(leafdata), cop) )
*
* def bcastEnd(self, unit, ndarray rootdata, ndarray leafdata, op): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* cdef MPI_Op cop = mpi4py_Op_Get(op)
*/
/* 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":184
* <void*>PyArray_DATA(leafdata), cop) )
*
* def reduceBegin(self, unit, ndarray leafdata, ndarray rootdata, op): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* cdef MPI_Op cop = mpi4py_Op_Get(op)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_47reduceBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_46reduceBegin[] = "SF.reduceBegin(self, unit, ndarray leafdata, ndarray rootdata, op)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_47reduceBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_unit = 0;
PyArrayObject *__pyx_v_leafdata = 0;
PyArrayObject *__pyx_v_rootdata = 0;
PyObject *__pyx_v_op = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_leafdata,&__pyx_n_s_rootdata,&__pyx_n_s_op,0};
PyObject* values[4] = {0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("reduceBegin", 1, 4, 4, 1); __PYX_ERR(39, 184, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rootdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("reduceBegin", 1, 4, 4, 2); __PYX_ERR(39, 184, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("reduceBegin", 1, 4, 4, 3); __PYX_ERR(39, 184, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reduceBegin") < 0)) __PYX_ERR(39, 184, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
}
__pyx_v_unit = values[0];
__pyx_v_leafdata = ((PyArrayObject *)values[1]);
__pyx_v_rootdata = ((PyArrayObject *)values[2]);
__pyx_v_op = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("reduceBegin", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 184, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.reduceBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(39, 184, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(39, 184, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_46reduceBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_leafdata, __pyx_v_rootdata, __pyx_v_op);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_46reduceBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_rootdata, PyObject *__pyx_v_op) {
MPI_Datatype __pyx_v_dtype;
MPI_Op __pyx_v_cop;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Datatype __pyx_t_1;
MPI_Op __pyx_t_2;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reduceBegin", 0);
/* "petsc4py/PETSc/SF.pyx":185
*
* def reduceBegin(self, unit, ndarray leafdata, ndarray rootdata, op):
* 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(PyErr_Occurred())) __PYX_ERR(39, 185, __pyx_L1_error)
__pyx_v_dtype = __pyx_t_1;
/* "petsc4py/PETSc/SF.pyx":186
* def reduceBegin(self, unit, ndarray leafdata, ndarray rootdata, op):
* 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(PyErr_Occurred())) __PYX_ERR(39, 186, __pyx_L1_error)
__pyx_v_cop = __pyx_t_2;
/* "petsc4py/PETSc/SF.pyx":187
* 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(39, 187, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":184
* <void*>PyArray_DATA(leafdata), cop) )
*
* def reduceBegin(self, unit, ndarray leafdata, ndarray rootdata, op): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* cdef MPI_Op cop = mpi4py_Op_Get(op)
*/
/* 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":190
* <void*>PyArray_DATA(rootdata), cop) )
*
* def reduceEnd(self, unit, ndarray leafdata, ndarray rootdata, op): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* cdef MPI_Op cop = mpi4py_Op_Get(op)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_49reduceEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_48reduceEnd[] = "SF.reduceEnd(self, unit, ndarray leafdata, ndarray rootdata, op)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_49reduceEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_unit = 0;
PyArrayObject *__pyx_v_leafdata = 0;
PyArrayObject *__pyx_v_rootdata = 0;
PyObject *__pyx_v_op = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_leafdata,&__pyx_n_s_rootdata,&__pyx_n_s_op,0};
PyObject* values[4] = {0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("reduceEnd", 1, 4, 4, 1); __PYX_ERR(39, 190, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rootdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("reduceEnd", 1, 4, 4, 2); __PYX_ERR(39, 190, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("reduceEnd", 1, 4, 4, 3); __PYX_ERR(39, 190, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reduceEnd") < 0)) __PYX_ERR(39, 190, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
}
__pyx_v_unit = values[0];
__pyx_v_leafdata = ((PyArrayObject *)values[1]);
__pyx_v_rootdata = ((PyArrayObject *)values[2]);
__pyx_v_op = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("reduceEnd", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 190, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.reduceEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(39, 190, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(39, 190, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_48reduceEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_leafdata, __pyx_v_rootdata, __pyx_v_op);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_48reduceEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_rootdata, PyObject *__pyx_v_op) {
MPI_Datatype __pyx_v_dtype;
MPI_Op __pyx_v_cop;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Datatype __pyx_t_1;
MPI_Op __pyx_t_2;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reduceEnd", 0);
/* "petsc4py/PETSc/SF.pyx":191
*
* def reduceEnd(self, unit, ndarray leafdata, ndarray rootdata, op):
* 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(PyErr_Occurred())) __PYX_ERR(39, 191, __pyx_L1_error)
__pyx_v_dtype = __pyx_t_1;
/* "petsc4py/PETSc/SF.pyx":192
* def reduceEnd(self, unit, ndarray leafdata, ndarray rootdata, op):
* 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(PyErr_Occurred())) __PYX_ERR(39, 192, __pyx_L1_error)
__pyx_v_cop = __pyx_t_2;
/* "petsc4py/PETSc/SF.pyx":193
* 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(39, 193, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":190
* <void*>PyArray_DATA(rootdata), cop) )
*
* def reduceEnd(self, unit, ndarray leafdata, ndarray rootdata, op): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* cdef MPI_Op cop = mpi4py_Op_Get(op)
*/
/* 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":196
* <void*>PyArray_DATA(rootdata), cop) )
*
* def scatterBegin(self, unit, ndarray multirootdata, ndarray leafdata): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* CHKERR( PetscSFScatterBegin(self.sf, dtype, <const void*>PyArray_DATA(multirootdata),
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_51scatterBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_50scatterBegin[] = "SF.scatterBegin(self, unit, ndarray multirootdata, ndarray leafdata)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_51scatterBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_unit = 0;
PyArrayObject *__pyx_v_multirootdata = 0;
PyArrayObject *__pyx_v_leafdata = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_multirootdata,&__pyx_n_s_leafdata,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_multirootdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("scatterBegin", 1, 3, 3, 1); __PYX_ERR(39, 196, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("scatterBegin", 1, 3, 3, 2); __PYX_ERR(39, 196, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scatterBegin") < 0)) __PYX_ERR(39, 196, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_unit = values[0];
__pyx_v_multirootdata = ((PyArrayObject *)values[1]);
__pyx_v_leafdata = ((PyArrayObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("scatterBegin", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 196, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.scatterBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_multirootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(39, 196, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(39, 196, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_50scatterBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_multirootdata, __pyx_v_leafdata);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_50scatterBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_multirootdata, PyArrayObject *__pyx_v_leafdata) {
MPI_Datatype __pyx_v_dtype;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Datatype __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("scatterBegin", 0);
/* "petsc4py/PETSc/SF.pyx":197
*
* def scatterBegin(self, unit, ndarray multirootdata, ndarray leafdata):
* 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(PyErr_Occurred())) __PYX_ERR(39, 197, __pyx_L1_error)
__pyx_v_dtype = __pyx_t_1;
/* "petsc4py/PETSc/SF.pyx":198
* def scatterBegin(self, unit, ndarray multirootdata, ndarray leafdata):
* 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(39, 198, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":196
* <void*>PyArray_DATA(rootdata), cop) )
*
* def scatterBegin(self, unit, ndarray multirootdata, ndarray leafdata): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* CHKERR( PetscSFScatterBegin(self.sf, dtype, <const void*>PyArray_DATA(multirootdata),
*/
/* 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":201
* <void*>PyArray_DATA(leafdata)) )
*
* def scatterEnd(self, unit, ndarray multirootdata, ndarray leafdata): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* CHKERR( PetscSFScatterEnd(self.sf, dtype, <const void*>PyArray_DATA(multirootdata),
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_53scatterEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_52scatterEnd[] = "SF.scatterEnd(self, unit, ndarray multirootdata, ndarray leafdata)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_53scatterEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_unit = 0;
PyArrayObject *__pyx_v_multirootdata = 0;
PyArrayObject *__pyx_v_leafdata = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_multirootdata,&__pyx_n_s_leafdata,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_multirootdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("scatterEnd", 1, 3, 3, 1); __PYX_ERR(39, 201, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("scatterEnd", 1, 3, 3, 2); __PYX_ERR(39, 201, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scatterEnd") < 0)) __PYX_ERR(39, 201, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_unit = values[0];
__pyx_v_multirootdata = ((PyArrayObject *)values[1]);
__pyx_v_leafdata = ((PyArrayObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("scatterEnd", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 201, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.scatterEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_multirootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(39, 201, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(39, 201, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_52scatterEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_multirootdata, __pyx_v_leafdata);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_52scatterEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_multirootdata, PyArrayObject *__pyx_v_leafdata) {
MPI_Datatype __pyx_v_dtype;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Datatype __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("scatterEnd", 0);
/* "petsc4py/PETSc/SF.pyx":202
*
* def scatterEnd(self, unit, ndarray multirootdata, ndarray leafdata):
* 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(PyErr_Occurred())) __PYX_ERR(39, 202, __pyx_L1_error)
__pyx_v_dtype = __pyx_t_1;
/* "petsc4py/PETSc/SF.pyx":203
* def scatterEnd(self, unit, ndarray multirootdata, ndarray leafdata):
* 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(39, 203, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":201
* <void*>PyArray_DATA(leafdata)) )
*
* def scatterEnd(self, unit, ndarray multirootdata, ndarray leafdata): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* CHKERR( PetscSFScatterEnd(self.sf, dtype, <const void*>PyArray_DATA(multirootdata),
*/
/* 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":206
* <void*>PyArray_DATA(leafdata)) )
*
* def gatherBegin(self, unit, ndarray leafdata, ndarray multirootdata): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* CHKERR( PetscSFGatherBegin(self.sf, dtype, <const void*>PyArray_DATA(leafdata),
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_55gatherBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_54gatherBegin[] = "SF.gatherBegin(self, unit, ndarray leafdata, ndarray multirootdata)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_55gatherBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_unit = 0;
PyArrayObject *__pyx_v_leafdata = 0;
PyArrayObject *__pyx_v_multirootdata = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_leafdata,&__pyx_n_s_multirootdata,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("gatherBegin", 1, 3, 3, 1); __PYX_ERR(39, 206, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_multirootdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("gatherBegin", 1, 3, 3, 2); __PYX_ERR(39, 206, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gatherBegin") < 0)) __PYX_ERR(39, 206, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_unit = values[0];
__pyx_v_leafdata = ((PyArrayObject *)values[1]);
__pyx_v_multirootdata = ((PyArrayObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("gatherBegin", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 206, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.gatherBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(39, 206, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_multirootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(39, 206, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_54gatherBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_leafdata, __pyx_v_multirootdata);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_54gatherBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_multirootdata) {
MPI_Datatype __pyx_v_dtype;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Datatype __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("gatherBegin", 0);
/* "petsc4py/PETSc/SF.pyx":207
*
* def gatherBegin(self, unit, ndarray leafdata, ndarray multirootdata):
* 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(PyErr_Occurred())) __PYX_ERR(39, 207, __pyx_L1_error)
__pyx_v_dtype = __pyx_t_1;
/* "petsc4py/PETSc/SF.pyx":208
* def gatherBegin(self, unit, ndarray leafdata, ndarray multirootdata):
* 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(39, 208, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":206
* <void*>PyArray_DATA(leafdata)) )
*
* def gatherBegin(self, unit, ndarray leafdata, ndarray multirootdata): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* CHKERR( PetscSFGatherBegin(self.sf, dtype, <const void*>PyArray_DATA(leafdata),
*/
/* 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":211
* <void*>PyArray_DATA(multirootdata)) )
*
* def gatherEnd(self, unit, ndarray leafdata, ndarray multirootdata): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* CHKERR( PetscSFGatherEnd(self.sf, dtype, <const void*>PyArray_DATA(leafdata),
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_57gatherEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_56gatherEnd[] = "SF.gatherEnd(self, unit, ndarray leafdata, ndarray multirootdata)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_57gatherEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_unit = 0;
PyArrayObject *__pyx_v_leafdata = 0;
PyArrayObject *__pyx_v_multirootdata = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_leafdata,&__pyx_n_s_multirootdata,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("gatherEnd", 1, 3, 3, 1); __PYX_ERR(39, 211, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_multirootdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("gatherEnd", 1, 3, 3, 2); __PYX_ERR(39, 211, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gatherEnd") < 0)) __PYX_ERR(39, 211, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_unit = values[0];
__pyx_v_leafdata = ((PyArrayObject *)values[1]);
__pyx_v_multirootdata = ((PyArrayObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("gatherEnd", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 211, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.gatherEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(39, 211, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_multirootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(39, 211, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_56gatherEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_leafdata, __pyx_v_multirootdata);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_56gatherEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_multirootdata) {
MPI_Datatype __pyx_v_dtype;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Datatype __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("gatherEnd", 0);
/* "petsc4py/PETSc/SF.pyx":212
*
* def gatherEnd(self, unit, ndarray leafdata, ndarray multirootdata):
* 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(PyErr_Occurred())) __PYX_ERR(39, 212, __pyx_L1_error)
__pyx_v_dtype = __pyx_t_1;
/* "petsc4py/PETSc/SF.pyx":213
* def gatherEnd(self, unit, ndarray leafdata, ndarray multirootdata):
* 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(39, 213, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":211
* <void*>PyArray_DATA(multirootdata)) )
*
* def gatherEnd(self, unit, ndarray leafdata, ndarray multirootdata): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* CHKERR( PetscSFGatherEnd(self.sf, dtype, <const void*>PyArray_DATA(leafdata),
*/
/* 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":216
* <void*>PyArray_DATA(multirootdata)) )
*
* def fetchAndOpBegin(self, unit, rootdata, leafdata, leafupdate, op): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* cdef MPI_Op cop = mpi4py_Op_Get(op)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_59fetchAndOpBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_58fetchAndOpBegin[] = "SF.fetchAndOpBegin(self, unit, rootdata, leafdata, leafupdate, op)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_59fetchAndOpBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("fetchAndOpBegin (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_rootdata,&__pyx_n_s_leafdata,&__pyx_n_s_leafupdate,&__pyx_n_s_op,0};
PyObject* values[5] = {0,0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rootdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, 1); __PYX_ERR(39, 216, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, 2); __PYX_ERR(39, 216, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafupdate)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, 3); __PYX_ERR(39, 216, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 4:
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, 4); __PYX_ERR(39, 216, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fetchAndOpBegin") < 0)) __PYX_ERR(39, 216, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
}
__pyx_v_unit = values[0];
__pyx_v_rootdata = values[1];
__pyx_v_leafdata = values[2];
__pyx_v_leafupdate = values[3];
__pyx_v_op = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 216, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.fetchAndOpBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_58fetchAndOpBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_rootdata, __pyx_v_leafdata, __pyx_v_leafupdate, __pyx_v_op);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_58fetchAndOpBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_rootdata, PyObject *__pyx_v_leafdata, PyObject *__pyx_v_leafupdate, PyObject *__pyx_v_op) {
MPI_Datatype __pyx_v_dtype;
MPI_Op __pyx_v_cop;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Datatype __pyx_t_1;
MPI_Op __pyx_t_2;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("fetchAndOpBegin", 0);
/* "petsc4py/PETSc/SF.pyx":217
*
* def fetchAndOpBegin(self, unit, rootdata, leafdata, leafupdate, op):
* 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(PyErr_Occurred())) __PYX_ERR(39, 217, __pyx_L1_error)
__pyx_v_dtype = __pyx_t_1;
/* "petsc4py/PETSc/SF.pyx":218
* def fetchAndOpBegin(self, unit, rootdata, leafdata, leafupdate, op):
* 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(PyErr_Occurred())) __PYX_ERR(39, 218, __pyx_L1_error)
__pyx_v_cop = __pyx_t_2;
/* "petsc4py/PETSc/SF.pyx":219
* 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_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(39, 219, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":220
* 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_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(39, 220, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":221
* CHKERR( PetscSFFetchAndOpBegin(self.sf, dtype, <void*>PyArray_DATA(rootdata),
* <const void*>PyArray_DATA(leafdata),
* <void*>PyArray_DATA(leafupdate), cop) ) # <<<<<<<<<<<<<<
*
* def fetchAndOpEnd(self, unit, rootdata, leafdata, leafupdate, op):
*/
if (!(likely(((__pyx_v_leafupdate) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leafupdate, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(39, 221, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":219
* 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(39, 219, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":216
* <void*>PyArray_DATA(multirootdata)) )
*
* def fetchAndOpBegin(self, unit, rootdata, leafdata, leafupdate, op): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* cdef MPI_Op cop = mpi4py_Op_Get(op)
*/
/* 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":223
* <void*>PyArray_DATA(leafupdate), cop) )
*
* def fetchAndOpEnd(self, unit, rootdata, leafdata, leafupdate, op): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* cdef MPI_Op cop = mpi4py_Op_Get(op)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_61fetchAndOpEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2SF_60fetchAndOpEnd[] = "SF.fetchAndOpEnd(self, unit, rootdata, leafdata, leafupdate, op)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_61fetchAndOpEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("fetchAndOpEnd (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_rootdata,&__pyx_n_s_leafdata,&__pyx_n_s_leafupdate,&__pyx_n_s_op,0};
PyObject* values[5] = {0,0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rootdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, 1); __PYX_ERR(39, 223, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, 2); __PYX_ERR(39, 223, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafupdate)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, 3); __PYX_ERR(39, 223, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 4:
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, 4); __PYX_ERR(39, 223, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fetchAndOpEnd") < 0)) __PYX_ERR(39, 223, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
}
__pyx_v_unit = values[0];
__pyx_v_rootdata = values[1];
__pyx_v_leafdata = values[2];
__pyx_v_leafupdate = values[3];
__pyx_v_op = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 223, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SF.fetchAndOpEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_60fetchAndOpEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_rootdata, __pyx_v_leafdata, __pyx_v_leafupdate, __pyx_v_op);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_60fetchAndOpEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_rootdata, PyObject *__pyx_v_leafdata, PyObject *__pyx_v_leafupdate, PyObject *__pyx_v_op) {
MPI_Datatype __pyx_v_dtype;
MPI_Op __pyx_v_cop;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Datatype __pyx_t_1;
MPI_Op __pyx_t_2;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("fetchAndOpEnd", 0);
/* "petsc4py/PETSc/SF.pyx":224
*
* def fetchAndOpEnd(self, unit, rootdata, leafdata, leafupdate, op):
* 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(PyErr_Occurred())) __PYX_ERR(39, 224, __pyx_L1_error)
__pyx_v_dtype = __pyx_t_1;
/* "petsc4py/PETSc/SF.pyx":225
* def fetchAndOpEnd(self, unit, rootdata, leafdata, leafupdate, op):
* 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(PyErr_Occurred())) __PYX_ERR(39, 225, __pyx_L1_error)
__pyx_v_cop = __pyx_t_2;
/* "petsc4py/PETSc/SF.pyx":226
* 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_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(39, 226, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":227
* 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_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(39, 227, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":228
* 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_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(39, 228, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":226
* 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(39, 226, __pyx_L1_error)
/* "petsc4py/PETSc/SF.pyx":223
* <void*>PyArray_DATA(leafupdate), cop) )
*
* def fetchAndOpEnd(self, unit, rootdata, leafdata, leafupdate, op): # <<<<<<<<<<<<<<
* cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
* cdef MPI_Op cop = mpi4py_Op_Get(op)
*/
/* 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":35
* #
*
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec___cinit__(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3Vec___cinit__(struct PyPetscVecObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/Vec.pyx":36
*
* 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":37
* def __cinit__(self):
* self.obj = <PetscObject*> &self.vec
* self.vec = NULL # <<<<<<<<<<<<<<
*
* # unary operations
*/
__pyx_v_self->vec = NULL;
/* "petsc4py/PETSc/Vec.pyx":35
* #
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.vec
* self.vec = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":41
* # 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__pos__ (wrapper)", 0);
__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":42
*
* 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(40, 42, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":41
* # 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":44
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__neg__ (wrapper)", 0);
__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":45
*
* 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(40, 45, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":44
* 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":47
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__abs__ (wrapper)", 0);
__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":48
*
* 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(40, 48, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":47
* 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":52
* # 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0);
__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":53
*
* 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(40, 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
* # 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":55
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__isub__ (wrapper)", 0);
__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":56
*
* 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(40, 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_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":58
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__imul__ (wrapper)", 0);
__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":59
*
* 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(40, 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_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":61
* return vec_imul(self, other)
*
* def __idiv__(self, other): # <<<<<<<<<<<<<<
* return vec_idiv(self, other)
*
*/
/* Python wrapper */
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_15__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_15__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__idiv__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_14__idiv__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_14__idiv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__idiv__", 0);
/* "petsc4py/PETSc/Vec.pyx":62
*
* 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(40, 62, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":61
* return vec_imul(self, other)
*
* def __idiv__(self, other): # <<<<<<<<<<<<<<
* return vec_idiv(self, other)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
/* "petsc4py/PETSc/Vec.pyx":64
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__itruediv__ (wrapper)", 0);
__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":65
*
* 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(40, 65, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":64
* 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":69
* # binary operations
*
* def __add__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Vec):
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_18__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_18__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
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("__add__", 0);
/* "petsc4py/PETSc/Vec.pyx":70
*
* def __add__(self, other):
* if isinstance(self, Vec): # <<<<<<<<<<<<<<
* return vec_add(self, other)
* else:
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":71
* def __add__(self, other):
* if isinstance(self, Vec):
* return vec_add(self, other) # <<<<<<<<<<<<<<
* else:
* return vec_radd(other, self)
*/
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(40, 71, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_add(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 71, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":70
*
* def __add__(self, other):
* if isinstance(self, Vec): # <<<<<<<<<<<<<<
* return vec_add(self, other)
* else:
*/
}
/* "petsc4py/PETSc/Vec.pyx":73
* return vec_add(self, other)
* else:
* return vec_radd(other, self) # <<<<<<<<<<<<<<
*
* def __sub__(self, other):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(40, 73, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_radd(((struct PyPetscVecObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 73, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Vec.pyx":69
* # binary operations
*
* def __add__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Vec):
* return vec_add(self, other)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":75
* return vec_radd(other, self)
*
* def __sub__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Vec):
* return vec_sub(self, other)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_21__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_21__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__sub__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_20__sub__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_20__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
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("__sub__", 0);
/* "petsc4py/PETSc/Vec.pyx":76
*
* def __sub__(self, other):
* if isinstance(self, Vec): # <<<<<<<<<<<<<<
* return vec_sub(self, other)
* else:
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":77
* def __sub__(self, other):
* if isinstance(self, Vec):
* return vec_sub(self, other) # <<<<<<<<<<<<<<
* else:
* return vec_rsub(other, self)
*/
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(40, 77, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_sub(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 77, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":76
*
* def __sub__(self, other):
* if isinstance(self, Vec): # <<<<<<<<<<<<<<
* return vec_sub(self, other)
* else:
*/
}
/* "petsc4py/PETSc/Vec.pyx":79
* return vec_sub(self, other)
* else:
* return vec_rsub(other, self) # <<<<<<<<<<<<<<
*
* def __mul__(self, other):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(40, 79, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_rsub(((struct PyPetscVecObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 79, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Vec.pyx":75
* return vec_radd(other, self)
*
* def __sub__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Vec):
* return vec_sub(self, other)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":81
* return vec_rsub(other, self)
*
* def __mul__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Vec):
* return vec_mul(self, other)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_23__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_23__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__mul__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_22__mul__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_22__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
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("__mul__", 0);
/* "petsc4py/PETSc/Vec.pyx":82
*
* def __mul__(self, other):
* if isinstance(self, Vec): # <<<<<<<<<<<<<<
* return vec_mul(self, other)
* else:
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":83
* def __mul__(self, other):
* if isinstance(self, Vec):
* return vec_mul(self, other) # <<<<<<<<<<<<<<
* else:
* return vec_rmul(other, self)
*/
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(40, 83, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_mul(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":82
*
* def __mul__(self, other):
* if isinstance(self, Vec): # <<<<<<<<<<<<<<
* return vec_mul(self, other)
* else:
*/
}
/* "petsc4py/PETSc/Vec.pyx":85
* return vec_mul(self, other)
* else:
* return vec_rmul(other, self) # <<<<<<<<<<<<<<
*
* def __div__(self, other):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(40, 85, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_rmul(((struct PyPetscVecObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Vec.pyx":81
* return vec_rsub(other, self)
*
* def __mul__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Vec):
* return vec_mul(self, other)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":87
* return vec_rmul(other, self)
*
* def __div__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Vec):
* return vec_div(self, other)
*/
/* Python wrapper */
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_25__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_25__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__div__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_24__div__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_24__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
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("__div__", 0);
/* "petsc4py/PETSc/Vec.pyx":88
*
* def __div__(self, other):
* if isinstance(self, Vec): # <<<<<<<<<<<<<<
* return vec_div(self, other)
* else:
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":89
* def __div__(self, other):
* if isinstance(self, Vec):
* return vec_div(self, other) # <<<<<<<<<<<<<<
* else:
* return vec_rdiv(other, self)
*/
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(40, 89, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_div(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":88
*
* def __div__(self, other):
* if isinstance(self, Vec): # <<<<<<<<<<<<<<
* return vec_div(self, other)
* else:
*/
}
/* "petsc4py/PETSc/Vec.pyx":91
* return vec_div(self, other)
* else:
* return vec_rdiv(other, self) # <<<<<<<<<<<<<<
*
* def __truediv__(self, other):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(40, 91, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_rdiv(((struct PyPetscVecObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Vec.pyx":87
* return vec_rmul(other, self)
*
* def __div__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Vec):
* return vec_div(self, other)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
/* "petsc4py/PETSc/Vec.pyx":93
* return vec_rdiv(other, self)
*
* def __truediv__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Vec):
* return vec_div(self, other)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_27__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_27__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__truediv__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_26__truediv__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_26__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
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("__truediv__", 0);
/* "petsc4py/PETSc/Vec.pyx":94
*
* def __truediv__(self, other):
* if isinstance(self, Vec): # <<<<<<<<<<<<<<
* return vec_div(self, other)
* else:
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":95
* def __truediv__(self, other):
* if isinstance(self, Vec):
* return vec_div(self, other) # <<<<<<<<<<<<<<
* else:
* return vec_rdiv(other, self)
*/
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(40, 95, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_div(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":94
*
* def __truediv__(self, other):
* if isinstance(self, Vec): # <<<<<<<<<<<<<<
* return vec_div(self, other)
* else:
*/
}
/* "petsc4py/PETSc/Vec.pyx":97
* return vec_div(self, other)
* else:
* return vec_rdiv(other, self) # <<<<<<<<<<<<<<
*
* #
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(40, 97, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_rdiv(((struct PyPetscVecObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 97, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Vec.pyx":93
* return vec_rdiv(other, self)
*
* def __truediv__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Vec):
* return vec_div(self, other)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":106
* # return <Py_ssize_t>size
*
* def __getitem__(self, i): # <<<<<<<<<<<<<<
* return vec_getitem(self, i)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_29__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_29__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_28__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_28__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":107
*
* 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(40, 107, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":106
* # return <Py_ssize_t>size
*
* def __getitem__(self, i): # <<<<<<<<<<<<<<
* return vec_getitem(self, i)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":109
* return vec_getitem(self, i)
*
* def __setitem__(self, i, v): # <<<<<<<<<<<<<<
* vec_setitem(self, i, v)
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_3Vec_31__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_3Vec_31__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_v) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_30__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_30__setitem__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_v) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
/* "petsc4py/PETSc/Vec.pyx":110
*
* 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(40, 110, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":109
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":114
* # 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 */
static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_3Vec_33__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_3Vec_33__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_32__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_32__getbuffer__(struct PyPetscVecObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) {
struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
if (__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":115
*
* def __getbuffer__(self, Py_buffer *view, int flags):
* cdef _Vec_buffer buf = _Vec_buffer(self) # <<<<<<<<<<<<<<
* buf.acquirebuffer(view, flags)
*
*/
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":116
* def __getbuffer__(self, Py_buffer *view, int flags):
* cdef _Vec_buffer buf = _Vec_buffer(self)
* buf.acquirebuffer(view, flags) # <<<<<<<<<<<<<<
*
* def __releasebuffer__(self, Py_buffer *view):
*/
__pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_buf->__pyx_vtab)->acquirebuffer(__pyx_v_buf, __pyx_v_view, __pyx_v_flags); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 116, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":114
* # buffer interface (PEP 3118)
*
* def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<<
* cdef _Vec_buffer buf = _Vec_buffer(self)
* buf.acquirebuffer(view, flags)
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
if (__pyx_v_view->obj != NULL) {
__Pyx_GOTREF(__pyx_v_view->obj);
__Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0;
}
goto __pyx_L2;
__pyx_L0:;
if (__pyx_v_view->obj == Py_None) {
__Pyx_GOTREF(__pyx_v_view->obj);
__Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0;
}
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_buf);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":118
* buf.acquirebuffer(view, flags)
*
* def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<<
* cdef _Vec_buffer buf = <_Vec_buffer>(view.obj)
* buf.releasebuffer(view)
*/
/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_3Vec_35__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view); /*proto*/
static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_3Vec_35__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
__pyx_pf_8petsc4py_5PETSc_3Vec_34__releasebuffer__(((struct PyPetscVecObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_view));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_pf_8petsc4py_5PETSc_3Vec_34__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":119
*
* 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":120
* 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(40, 120, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":121
* 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":118
* 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":125
* # '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_37__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_36__enter__[] = "Vec.__enter__(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_37__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_36__enter__(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_36__enter__(struct PyPetscVecObject *__pyx_v_self) {
struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__enter__", 0);
/* "petsc4py/PETSc/Vec.pyx":126
*
* def __enter__(self):
* cdef _Vec_buffer buf = _Vec_buffer(self) # <<<<<<<<<<<<<<
* self.set_attr('__buffer__', buf)
* return buf.enter()
*/
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":127
* 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(40, 127, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":128
* 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(40, 128, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":125
* # 'with' statement (PEP 343)
*
* def __enter__(self): # <<<<<<<<<<<<<<
* cdef _Vec_buffer buf = _Vec_buffer(self)
* self.set_attr('__buffer__', buf)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_buf);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":130
* 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_39__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_38__exit__[] = "Vec.__exit__(self, *exc)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_39__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED PyObject *__pyx_v_exc = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_exc = __pyx_args;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_38__exit__(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_exc);
/* function exit code */
__Pyx_XDECREF(__pyx_v_exc);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_38__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":131
*
* 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(40, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc__Vec_buffer))))) __PYX_ERR(40, 131, __pyx_L1_error)
__pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":132
* 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(40, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":133
* 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(40, 133, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":130
* 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":137
* #
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_41view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_40view[] = "Vec.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_41view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(40, 137, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 137, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(40, 137, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_40view(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_40view(struct PyPetscVecObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) {
PetscViewer __pyx_v_vwr;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/Vec.pyx":138
*
* def view(self, Viewer viewer=None):
* 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":139
* def view(self, Viewer viewer=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
}
/* "petsc4py/PETSc/Vec.pyx":140
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
* CHKERR( VecView(self.vec, vwr) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecView(__pyx_v_self->vec, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 140, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":137
* #
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.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":142
* CHKERR( VecView(self.vec, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( VecDestroy(&self.vec) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_43destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_42destroy[] = "Vec.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_43destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_42destroy(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_42destroy(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":143
*
* def destroy(self):
* 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(40, 143, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":144
* def destroy(self):
* CHKERR( VecDestroy(&self.vec) )
* return self # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":142
* CHKERR( VecView(self.vec, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( VecDestroy(&self.vec) )
* return self
*/
/* 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":146
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscVec newvec = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_45create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_44create[] = "Vec.create(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_45create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(40, 146, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 146, __pyx_L3_error)
__pyx_L3_error:;
__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_44create(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_44create(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":147
*
* def create(self, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(40, 147, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":148
* def create(self, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscVec newvec = NULL # <<<<<<<<<<<<<<
* CHKERR( VecCreate(ccomm, &newvec) )
* PetscCLEAR(self.obj); self.vec = newvec
*/
__pyx_v_newvec = NULL;
/* "petsc4py/PETSc/Vec.pyx":149
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscVec newvec = NULL
* CHKERR( VecCreate(ccomm, &newvec) ) # <<<<<<<<<<<<<<
* 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(40, 149, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":150
* cdef PetscVec newvec = NULL
* CHKERR( VecCreate(ccomm, &newvec) )
* PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vec = __pyx_v_newvec;
/* "petsc4py/PETSc/Vec.pyx":151
* CHKERR( VecCreate(ccomm, &newvec) )
* PetscCLEAR(self.obj); self.vec = newvec
* return self # <<<<<<<<<<<<<<
*
* def setType(self, vec_type):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":146
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscVec newvec = NULL
*/
/* 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":153
* return self
*
* def setType(self, vec_type): # <<<<<<<<<<<<<<
* cdef PetscVecType cval = NULL
* vec_type = str2bytes(vec_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_47setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_46setType[] = "Vec.setType(self, vec_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_47setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vec_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(40, 153, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 153, __pyx_L3_error)
__pyx_L3_error:;
__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_46setType(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_46setType(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":154
*
* def setType(self, vec_type):
* cdef PetscVecType cval = NULL # <<<<<<<<<<<<<<
* vec_type = str2bytes(vec_type, &cval)
* CHKERR( VecSetType(self.vec, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Vec.pyx":155
* def setType(self, vec_type):
* 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(40, 155, __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":156
* cdef PetscVecType cval = NULL
* vec_type = str2bytes(vec_type, &cval)
* CHKERR( VecSetType(self.vec, cval) ) # <<<<<<<<<<<<<<
*
* def setSizes(self, size, bsize=None):
*/
__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(40, 156, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":153
* return self
*
* def setType(self, vec_type): # <<<<<<<<<<<<<<
* cdef PetscVecType cval = NULL
* vec_type = str2bytes(vec_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":158
* CHKERR( VecSetType(self.vec, cval) )
*
* def setSizes(self, size, bsize=None): # <<<<<<<<<<<<<<
* cdef PetscInt bs=0, n=0, N=0
* Vec_Sizes(size, bsize, &bs, &n, &N)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_49setSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_48setSizes[] = "Vec.setSizes(self, size, bsize=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_49setSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_size = 0;
PyObject *__pyx_v_bsize = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSizes") < 0)) __PYX_ERR(40, 158, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_bsize = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setSizes", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 158, __pyx_L3_error)
__pyx_L3_error:;
__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_48setSizes(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_48setSizes(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":159
*
* def setSizes(self, size, bsize=None):
* 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":160
* def setSizes(self, size, bsize=None):
* 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(40, 160, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":161
* 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(40, 161, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":162
* 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) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Vec.pyx":163
* 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(40, 163, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":162
* 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":158
* CHKERR( VecSetType(self.vec, cval) )
*
* def setSizes(self, size, bsize=None): # <<<<<<<<<<<<<<
* cdef PetscInt bs=0, n=0, N=0
* Vec_Sizes(size, bsize, &bs, &n, &N)
*/
/* 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":167
* #
*
* def createSeq(self, size, bsize=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF)
* cdef PetscInt bs=0, n=0, N=0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_51createSeq(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_50createSeq[] = "Vec.createSeq(self, size, bsize=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_51createSeq(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_size = 0;
PyObject *__pyx_v_bsize = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSeq") < 0)) __PYX_ERR(40, 167, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_bsize = values[1];
__pyx_v_comm = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createSeq", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 167, __pyx_L3_error)
__pyx_L3_error:;
__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_50createSeq(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_50createSeq(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":168
*
* def createSeq(self, size, bsize=None, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(40, 168, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":169
* def createSeq(self, size, bsize=None, comm=None):
* 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":170
* 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(40, 170, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":171
* 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(40, 171, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":172
* 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) != 0);
if (__pyx_t_4) {
__pyx_v_bs = 1;
}
/* "petsc4py/PETSc/Vec.pyx":173
* 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":174
* 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(40, 174, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":175
* 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(40, 175, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":176
* CHKERR( VecCreate(ccomm,&newvec) )
* CHKERR( VecSetSizes(newvec, n, N) )
* CHKERR( VecSetBlockSize(newvec, bs) ) # <<<<<<<<<<<<<<
* CHKERR( VecSetType(newvec, VECSEQ) )
* 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(40, 176, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":177
* CHKERR( VecSetSizes(newvec, n, N) )
* CHKERR( VecSetBlockSize(newvec, bs) )
* CHKERR( VecSetType(newvec, VECSEQ) ) # <<<<<<<<<<<<<<
* 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(40, 177, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":178
* CHKERR( VecSetBlockSize(newvec, bs) )
* CHKERR( VecSetType(newvec, VECSEQ) )
* PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vec = __pyx_v_newvec;
/* "petsc4py/PETSc/Vec.pyx":179
* CHKERR( VecSetType(newvec, VECSEQ) )
* PetscCLEAR(self.obj); self.vec = newvec
* return self # <<<<<<<<<<<<<<
*
* def createMPI(self, size, bsize=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":167
* #
*
* def createSeq(self, size, bsize=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF)
* cdef PetscInt bs=0, n=0, N=0
*/
/* 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":181
* return self
*
* def createMPI(self, size, bsize=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt bs=0, n=0, N=0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_53createMPI(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_52createMPI[] = "Vec.createMPI(self, size, bsize=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_53createMPI(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_size = 0;
PyObject *__pyx_v_bsize = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createMPI") < 0)) __PYX_ERR(40, 181, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_bsize = values[1];
__pyx_v_comm = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createMPI", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 181, __pyx_L3_error)
__pyx_L3_error:;
__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_52createMPI(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_52createMPI(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":182
*
* def createMPI(self, size, bsize=None, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(40, 182, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":183
* def createMPI(self, size, bsize=None, comm=None):
* 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":184
* 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(40, 184, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":185
* 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(40, 185, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":186
* 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) != 0);
if (__pyx_t_4) {
__pyx_v_bs = 1;
}
/* "petsc4py/PETSc/Vec.pyx":187
* 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":188
* 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(40, 188, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":189
* 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(40, 189, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":190
* CHKERR( VecCreate(ccomm, &newvec) )
* CHKERR( VecSetSizes(newvec, n, N) )
* CHKERR( VecSetBlockSize(newvec, bs) ) # <<<<<<<<<<<<<<
* CHKERR( VecSetType(newvec, VECMPI) )
* 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(40, 190, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":191
* CHKERR( VecSetSizes(newvec, n, N) )
* CHKERR( VecSetBlockSize(newvec, bs) )
* CHKERR( VecSetType(newvec, VECMPI) ) # <<<<<<<<<<<<<<
* 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(40, 191, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":192
* CHKERR( VecSetBlockSize(newvec, bs) )
* CHKERR( VecSetType(newvec, VECMPI) )
* PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vec = __pyx_v_newvec;
/* "petsc4py/PETSc/Vec.pyx":193
* CHKERR( VecSetType(newvec, VECMPI) )
* PetscCLEAR(self.obj); self.vec = newvec
* return self # <<<<<<<<<<<<<<
*
* def createWithArray(self, array, size=None, bsize=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":181
* return self
*
* def createMPI(self, size, bsize=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt bs=0, n=0, N=0
*/
/* 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":195
* return self
*
* def createWithArray(self, array, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<<
* cdef PetscInt na=0
* cdef PetscScalar *sa=NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_55createWithArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_54createWithArray[] = "Vec.createWithArray(self, array, size=None, bsize=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_55createWithArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_array = 0;
PyObject *__pyx_v_size = 0;
PyObject *__pyx_v_bsize = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0};
PyObject* values[4] = {0,0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createWithArray") < 0)) __PYX_ERR(40, 195, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_array = values[0];
__pyx_v_size = values[1];
__pyx_v_bsize = values[2];
__pyx_v_comm = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createWithArray", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 195, __pyx_L3_error)
__pyx_L3_error:;
__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_54createWithArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_array, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_54createWithArray(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;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
MPI_Comm __pyx_t_6;
int __pyx_t_7;
PetscErrorCode __pyx_t_8;
PyObject *__pyx_t_9 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createWithArray", 0);
__Pyx_INCREF(__pyx_v_array);
__Pyx_INCREF(__pyx_v_size);
/* "petsc4py/PETSc/Vec.pyx":196
*
* def createWithArray(self, array, size=None, bsize=None, comm=None):
* cdef PetscInt na=0 # <<<<<<<<<<<<<<
* cdef PetscScalar *sa=NULL
* array = iarray_s(array, &na, &sa)
*/
__pyx_v_na = 0;
/* "petsc4py/PETSc/Vec.pyx":197
* def createWithArray(self, array, size=None, bsize=None, comm=None):
* 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":198
* 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(40, 198, __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":199
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
__pyx_t_1 = 0;
__pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_size, __pyx_t_5);
__pyx_t_5 = 0;
}
/* "petsc4py/PETSc/Vec.pyx":200
* 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_6 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 200, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_6;
/* "petsc4py/PETSc/Vec.pyx":201
* 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":202
* 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(40, 202, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":203
* 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(40, 203, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":204
* 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_3 = ((__pyx_v_bs == PETSC_DECIDE) != 0);
if (__pyx_t_3) {
__pyx_v_bs = 1;
}
/* "petsc4py/PETSc/Vec.pyx":205
* 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_3 = ((__pyx_v_na < __pyx_v_n) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/Vec.pyx":207
* if na < n: raise ValueError(
* "array size %d and vector local size %d block size %d" %
* (toInt(na), toInt(n), toInt(bs))) # <<<<<<<<<<<<<<
* cdef PetscVec newvec = NULL
* if comm_size(ccomm) == 1:
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(40, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_1);
__pyx_t_5 = 0;
__pyx_t_4 = 0;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":206
* if bs == PETSC_DECIDE: bs = 1
* if na < n: raise ValueError(
* "array size %d and vector local size %d block size %d" % # <<<<<<<<<<<<<<
* (toInt(na), toInt(n), toInt(bs)))
* cdef PetscVec newvec = NULL
*/
__pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
/* "petsc4py/PETSc/Vec.pyx":205
* Sys_Layout(ccomm, bs, &n, &N)
* if bs == PETSC_DECIDE: bs = 1
* if na < n: raise ValueError( # <<<<<<<<<<<<<<
* "array size %d and vector local size %d block size %d" %
* (toInt(na), toInt(n), toInt(bs)))
*/
__pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(40, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__PYX_ERR(40, 205, __pyx_L1_error)
}
/* "petsc4py/PETSc/Vec.pyx":208
* "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":209
* (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_7 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_7 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(40, 209, __pyx_L1_error)
__pyx_t_3 = ((__pyx_t_7 == 1) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Vec.pyx":210
* 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_8 = __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_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 210, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":209
* (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":212
* CHKERR( VecCreateSeqWithArray(ccomm,bs,N,sa,&newvec) )
* else:
* CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,sa,&newvec) ) # <<<<<<<<<<<<<<
* PetscCLEAR(self.obj); self.vec = newvec
* self.set_attr('__array__', array)
*/
/*else*/ {
__pyx_t_8 = __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_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 212, __pyx_L1_error)
}
__pyx_L6:;
/* "petsc4py/PETSc/Vec.pyx":213
* else:
* CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,sa,&newvec) )
* PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<<
* self.set_attr('__array__', array)
* return self
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vec = __pyx_v_newvec;
/* "petsc4py/PETSc/Vec.pyx":214
* CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,sa,&newvec) )
* PetscCLEAR(self.obj); self.vec = newvec
* self.set_attr('__array__', array) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_9 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_array); if (unlikely(!__pyx_t_9)) __PYX_ERR(40, 214, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
/* "petsc4py/PETSc/Vec.pyx":215
* PetscCLEAR(self.obj); self.vec = newvec
* self.set_attr('__array__', array)
* return self # <<<<<<<<<<<<<<
*
* def createCUDAWithArrays(self, cpuarray=None, cudahandle=None, size=None, bsize=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":195
* return self
*
* def createWithArray(self, array, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<<
* cdef PetscInt na=0
* cdef PetscScalar *sa=NULL
*/
/* 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_9);
__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":217
* return self
*
* def createCUDAWithArrays(self, cpuarray=None, cudahandle=None, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<<
* """
* Returns an instance of :class:`Vec`, a VECCUDA with user provided
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_57createCUDAWithArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_56createCUDAWithArrays[] = "Vec.createCUDAWithArrays(self, cpuarray=None, cudahandle=None, size=None, bsize=None, comm=None)\n\n Returns an instance of :class:`Vec`, a VECCUDA with user provided\n memory spaces for CPU and GPU arrays.\n\n :arg cpuarray: A :class:`numpy.ndarray`. Will be lazily allocated if\n *None*.\n :arg cudahandle: Address of the array on the GPU. Will be lazily\n allocated if *None*.\n :arg size: A :class:`int` denoting the size of the Vec.\n :arg bsize: A :class:`int` denoting the block size.\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_57createCUDAWithArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createCUDAWithArrays (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cpuarray,&__pyx_n_s_cudahandle,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0};
PyObject* values[5] = {0,0,0,0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cpuarray);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cudahandle);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createCUDAWithArrays") < 0)) __PYX_ERR(40, 217, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_cpuarray = values[0];
__pyx_v_cudahandle = values[1];
__pyx_v_size = values[2];
__pyx_v_bsize = values[3];
__pyx_v_comm = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createCUDAWithArrays", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 217, __pyx_L3_error)
__pyx_L3_error:;
__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_56createCUDAWithArrays(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_cpuarray, __pyx_v_cudahandle, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_56createCUDAWithArrays(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;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
MPI_Comm __pyx_t_7;
int __pyx_t_8;
PetscErrorCode __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createCUDAWithArrays", 0);
__Pyx_INCREF(__pyx_v_cpuarray);
__Pyx_INCREF(__pyx_v_size);
/* "petsc4py/PETSc/Vec.pyx":229
* :arg bsize: A :class:`int` denoting the block size.
* """
* cdef PetscInt na=0 # <<<<<<<<<<<<<<
* cdef PetscScalar *sa=NULL
* cdef PetscScalar *gpuarray = NULL
*/
__pyx_v_na = 0;
/* "petsc4py/PETSc/Vec.pyx":230
* """
* cdef PetscInt na=0
* cdef PetscScalar *sa=NULL # <<<<<<<<<<<<<<
* cdef PetscScalar *gpuarray = NULL
* if cudahandle:
*/
__pyx_v_sa = NULL;
/* "petsc4py/PETSc/Vec.pyx":231
* 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":232
* 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(40, 232, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":233
* 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_PyInt_As_size_t(__pyx_v_cudahandle); if (unlikely((__pyx_t_2 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(40, 233, __pyx_L1_error)
__pyx_v_gpuarray = ((PetscScalar *)((Py_uintptr_t)__pyx_t_2));
/* "petsc4py/PETSc/Vec.pyx":232
* 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":234
* 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);
__pyx_t_3 = (__pyx_t_1 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Vec.pyx":235
* 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_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_cpuarray, (&__pyx_v_na), (&__pyx_v_sa))); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_cpuarray, __pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Vec.pyx":234
* if cudahandle:
* gpuarray = <PetscScalar*>(<Py_uintptr_t>cudahandle)
* if cpuarray is not None: # <<<<<<<<<<<<<<
* cpuarray = iarray_s(cpuarray, &na, &sa)
*
*/
}
/* "petsc4py/PETSc/Vec.pyx":237
* 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_3 = (__pyx_v_size == Py_None);
__pyx_t_1 = (__pyx_t_3 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(40, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
__pyx_t_4 = 0;
__pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_size, __pyx_t_6);
__pyx_t_6 = 0;
}
/* "petsc4py/PETSc/Vec.pyx":238
*
* 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_7 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 238, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_7;
/* "petsc4py/PETSc/Vec.pyx":239
* 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":240
* 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_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(40, 240, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":241
* 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_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(40, 241, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":242
* 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) != 0);
if (__pyx_t_1) {
__pyx_v_bs = 1;
}
/* "petsc4py/PETSc/Vec.pyx":243
* 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) != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/Vec.pyx":245
* 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_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_6)) __PYX_ERR(40, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(40, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4);
__pyx_t_6 = 0;
__pyx_t_5 = 0;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Vec.pyx":244
* 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_4 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
/* "petsc4py/PETSc/Vec.pyx":243
* 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_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(40, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_10, 0, 0, 0);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__PYX_ERR(40, 243, __pyx_L1_error)
}
/* "petsc4py/PETSc/Vec.pyx":246
* "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":247
* (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_8 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_8 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(40, 247, __pyx_L1_error)
__pyx_t_1 = ((__pyx_t_8 == 1) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":248
* 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_9 = __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_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 248, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":247
* (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":250
* CHKERR( VecCreateSeqCUDAWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) )
* else:
* CHKERR( VecCreateMPICUDAWithArrays(ccomm,bs,n,N,sa,gpuarray,&newvec) ) # <<<<<<<<<<<<<<
* PetscCLEAR(self.obj); self.vec = newvec
*
*/
/*else*/ {
__pyx_t_9 = __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_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 250, __pyx_L1_error)
}
__pyx_L8:;
/* "petsc4py/PETSc/Vec.pyx":251
* else:
* CHKERR( VecCreateMPICUDAWithArrays(ccomm,bs,n,N,sa,gpuarray,&newvec) )
* PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<<
*
* if cpuarray is not None:
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vec = __pyx_v_newvec;
/* "petsc4py/PETSc/Vec.pyx":253
* 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);
__pyx_t_3 = (__pyx_t_1 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Vec.pyx":254
*
* if cpuarray is not None:
* self.set_attr('__array__', cpuarray) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_10 = ((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_10)) __PYX_ERR(40, 254, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
/* "petsc4py/PETSc/Vec.pyx":253
* PetscCLEAR(self.obj); self.vec = newvec
*
* if cpuarray is not None: # <<<<<<<<<<<<<<
* self.set_attr('__array__', cpuarray)
* return self
*/
}
/* "petsc4py/PETSc/Vec.pyx":255
* if cpuarray is not None:
* self.set_attr('__array__', cpuarray)
* return self # <<<<<<<<<<<<<<
*
* def createHIPWithArrays(self, cpuarray=None, hiphandle=None, size=None, bsize=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":217
* return self
*
* def createCUDAWithArrays(self, cpuarray=None, cudahandle=None, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<<
* """
* Returns an instance of :class:`Vec`, a VECCUDA with user provided
*/
/* 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_10);
__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":257
* return self
*
* def createHIPWithArrays(self, cpuarray=None, hiphandle=None, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<<
* """
* Returns an instance of :class:`Vec`, a VECHIP with user provided
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_59createHIPWithArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_58createHIPWithArrays[] = "Vec.createHIPWithArrays(self, cpuarray=None, hiphandle=None, size=None, bsize=None, comm=None)\n\n Returns an instance of :class:`Vec`, a VECHIP with user provided\n memory spaces for CPU and GPU arrays.\n\n :arg cpuarray: A :class:`numpy.ndarray`. Will be lazily allocated if\n *None*.\n :arg hiphandle: Address of the array on the GPU. Will be lazily\n allocated if *None*.\n :arg size: A :class:`int` denoting the size of the Vec.\n :arg bsize: A :class:`int` denoting the block size.\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_59createHIPWithArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createHIPWithArrays (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cpuarray,&__pyx_n_s_hiphandle,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0};
PyObject* values[5] = {0,0,0,0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cpuarray);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hiphandle);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createHIPWithArrays") < 0)) __PYX_ERR(40, 257, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_cpuarray = values[0];
__pyx_v_hiphandle = values[1];
__pyx_v_size = values[2];
__pyx_v_bsize = values[3];
__pyx_v_comm = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createHIPWithArrays", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 257, __pyx_L3_error)
__pyx_L3_error:;
__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_58createHIPWithArrays(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_cpuarray, __pyx_v_hiphandle, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_58createHIPWithArrays(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;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
MPI_Comm __pyx_t_7;
int __pyx_t_8;
PetscErrorCode __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createHIPWithArrays", 0);
__Pyx_INCREF(__pyx_v_cpuarray);
__Pyx_INCREF(__pyx_v_size);
/* "petsc4py/PETSc/Vec.pyx":269
* :arg bsize: A :class:`int` denoting the block size.
* """
* cdef PetscInt na=0 # <<<<<<<<<<<<<<
* cdef PetscScalar *sa=NULL
* cdef PetscScalar *gpuarray = NULL
*/
__pyx_v_na = 0;
/* "petsc4py/PETSc/Vec.pyx":270
* """
* cdef PetscInt na=0
* cdef PetscScalar *sa=NULL # <<<<<<<<<<<<<<
* cdef PetscScalar *gpuarray = NULL
* if hiphandle:
*/
__pyx_v_sa = NULL;
/* "petsc4py/PETSc/Vec.pyx":271
* 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":272
* 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(40, 272, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":273
* 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_PyInt_As_size_t(__pyx_v_hiphandle); if (unlikely((__pyx_t_2 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(40, 273, __pyx_L1_error)
__pyx_v_gpuarray = ((PetscScalar *)((Py_uintptr_t)__pyx_t_2));
/* "petsc4py/PETSc/Vec.pyx":272
* 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":274
* 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);
__pyx_t_3 = (__pyx_t_1 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Vec.pyx":275
* 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_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_cpuarray, (&__pyx_v_na), (&__pyx_v_sa))); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 275, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_cpuarray, __pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Vec.pyx":274
* if hiphandle:
* gpuarray = <PetscScalar*>(<Py_uintptr_t>hiphandle)
* if cpuarray is not None: # <<<<<<<<<<<<<<
* cpuarray = iarray_s(cpuarray, &na, &sa)
*
*/
}
/* "petsc4py/PETSc/Vec.pyx":277
* 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_3 = (__pyx_v_size == Py_None);
__pyx_t_1 = (__pyx_t_3 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(40, 277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
__pyx_t_4 = 0;
__pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_size, __pyx_t_6);
__pyx_t_6 = 0;
}
/* "petsc4py/PETSc/Vec.pyx":278
*
* 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_7 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 278, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_7;
/* "petsc4py/PETSc/Vec.pyx":279
* 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":280
* 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_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(40, 280, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":281
* 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_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(40, 281, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":282
* 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) != 0);
if (__pyx_t_1) {
__pyx_v_bs = 1;
}
/* "petsc4py/PETSc/Vec.pyx":283
* 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) != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/Vec.pyx":285
* 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_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_6)) __PYX_ERR(40, 285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(40, 285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4);
__pyx_t_6 = 0;
__pyx_t_5 = 0;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Vec.pyx":284
* 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_4 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
/* "petsc4py/PETSc/Vec.pyx":283
* 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_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(40, 283, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_10, 0, 0, 0);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__PYX_ERR(40, 283, __pyx_L1_error)
}
/* "petsc4py/PETSc/Vec.pyx":286
* "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":287
* (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_8 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_8 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(40, 287, __pyx_L1_error)
__pyx_t_1 = ((__pyx_t_8 == 1) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":288
* 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_9 = __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_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 288, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":287
* (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":290
* CHKERR( VecCreateSeqHIPWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) )
* else:
* CHKERR( VecCreateMPIHIPWithArrays(ccomm,bs,n,N,sa,gpuarray,&newvec) ) # <<<<<<<<<<<<<<
* PetscCLEAR(self.obj); self.vec = newvec
*
*/
/*else*/ {
__pyx_t_9 = __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_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 290, __pyx_L1_error)
}
__pyx_L8:;
/* "petsc4py/PETSc/Vec.pyx":291
* else:
* CHKERR( VecCreateMPIHIPWithArrays(ccomm,bs,n,N,sa,gpuarray,&newvec) )
* PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<<
*
* if cpuarray is not None:
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vec = __pyx_v_newvec;
/* "petsc4py/PETSc/Vec.pyx":293
* 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);
__pyx_t_3 = (__pyx_t_1 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Vec.pyx":294
*
* if cpuarray is not None:
* self.set_attr('__array__', cpuarray) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_10 = ((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_10)) __PYX_ERR(40, 294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
/* "petsc4py/PETSc/Vec.pyx":293
* PetscCLEAR(self.obj); self.vec = newvec
*
* if cpuarray is not None: # <<<<<<<<<<<<<<
* self.set_attr('__array__', cpuarray)
* return self
*/
}
/* "petsc4py/PETSc/Vec.pyx":295
* if cpuarray is not None:
* self.set_attr('__array__', cpuarray)
* return self # <<<<<<<<<<<<<<
*
* def createViennaCLWithArrays(self, cpuarray=None, viennaclvechandle=None, size=None, bsize=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":257
* return self
*
* def createHIPWithArrays(self, cpuarray=None, hiphandle=None, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<<
* """
* Returns an instance of :class:`Vec`, a VECHIP with user provided
*/
/* 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_10);
__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":297
* return self
*
* def createViennaCLWithArrays(self, cpuarray=None, viennaclvechandle=None, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<<
* """
* Returns an instance :class:`Vec`, a VECVIENNACL with user provided memory
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_61createViennaCLWithArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_60createViennaCLWithArrays[] = "Vec.createViennaCLWithArrays(self, cpuarray=None, viennaclvechandle=None, size=None, bsize=None, comm=None)\n\n Returns an instance :class:`Vec`, a VECVIENNACL with user provided memory\n spaces for CPU and GPU arrays.\n\n :arg cpuarray: A :class:`numpy.ndarray`. Will be lazily allocated if\n *None*.\n :arg viennaclvechandle: Address of the array on the GPU. Will be lazily\n allocated if *None*.\n :arg size: A :class:`int` denoting the size of the Vec.\n :arg size: A :class:`int` denoting the block size.\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_61createViennaCLWithArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createViennaCLWithArrays (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cpuarray,&__pyx_n_s_viennaclvechandle,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0};
PyObject* values[5] = {0,0,0,0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cpuarray);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viennaclvechandle);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createViennaCLWithArrays") < 0)) __PYX_ERR(40, 297, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_cpuarray = values[0];
__pyx_v_viennaclvechandle = values[1];
__pyx_v_size = values[2];
__pyx_v_bsize = values[3];
__pyx_v_comm = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createViennaCLWithArrays", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 297, __pyx_L3_error)
__pyx_L3_error:;
__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_60createViennaCLWithArrays(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_cpuarray, __pyx_v_viennaclvechandle, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_60createViennaCLWithArrays(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;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
MPI_Comm __pyx_t_7;
int __pyx_t_8;
PetscErrorCode __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createViennaCLWithArrays", 0);
__Pyx_INCREF(__pyx_v_cpuarray);
__Pyx_INCREF(__pyx_v_size);
/* "petsc4py/PETSc/Vec.pyx":309
* :arg size: A :class:`int` denoting the block size.
* """
* cdef PetscInt na=0 # <<<<<<<<<<<<<<
* cdef PetscScalar *sa=NULL
* cdef PetscScalar *vclvec = NULL
*/
__pyx_v_na = 0;
/* "petsc4py/PETSc/Vec.pyx":310
* """
* cdef PetscInt na=0
* cdef PetscScalar *sa=NULL # <<<<<<<<<<<<<<
* cdef PetscScalar *vclvec = NULL
* if viennaclvechandle:
*/
__pyx_v_sa = NULL;
/* "petsc4py/PETSc/Vec.pyx":311
* 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":312
* 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(40, 312, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":313
* 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_PyInt_As_size_t(__pyx_v_viennaclvechandle); if (unlikely((__pyx_t_2 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(40, 313, __pyx_L1_error)
__pyx_v_vclvec = ((PetscScalar *)((Py_uintptr_t)__pyx_t_2));
/* "petsc4py/PETSc/Vec.pyx":312
* 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":314
* 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);
__pyx_t_3 = (__pyx_t_1 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Vec.pyx":315
* 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_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_cpuarray, (&__pyx_v_na), (&__pyx_v_sa))); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 315, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_cpuarray, __pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Vec.pyx":314
* if viennaclvechandle:
* vclvec = <PetscScalar*>(<Py_uintptr_t>viennaclvechandle)
* if cpuarray is not None: # <<<<<<<<<<<<<<
* cpuarray = iarray_s(cpuarray, &na, &sa)
*
*/
}
/* "petsc4py/PETSc/Vec.pyx":317
* 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_3 = (__pyx_v_size == Py_None);
__pyx_t_1 = (__pyx_t_3 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(40, 317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
__pyx_t_4 = 0;
__pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_size, __pyx_t_6);
__pyx_t_6 = 0;
}
/* "petsc4py/PETSc/Vec.pyx":318
*
* 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_7 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 318, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_7;
/* "petsc4py/PETSc/Vec.pyx":319
* 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":320
* 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_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(40, 320, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":321
* 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( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs)))
*/
__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(40, 321, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":322
* 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)))
* cdef PetscVec newvec = NULL
*/
__pyx_t_1 = ((__pyx_v_bs == PETSC_DECIDE) != 0);
if (__pyx_t_1) {
__pyx_v_bs = 1;
}
/* "petsc4py/PETSc/Vec.pyx":323
* 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
* if comm_size(ccomm) == 1:
*/
__pyx_t_1 = ((__pyx_v_na < __pyx_v_n) != 0);
if (unlikely(__pyx_t_1)) {
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_6)) __PYX_ERR(40, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(40, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4);
__pyx_t_6 = 0;
__pyx_t_5 = 0;
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(40, 323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_10, 0, 0, 0);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__PYX_ERR(40, 323, __pyx_L1_error)
}
/* "petsc4py/PETSc/Vec.pyx":324
* 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:
* CHKERR( VecCreateSeqViennaCLWithArrays(ccomm,bs,N,sa,vclvec,&newvec) )
*/
__pyx_v_newvec = NULL;
/* "petsc4py/PETSc/Vec.pyx":325
* 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) )
* else:
*/
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_8 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(40, 325, __pyx_L1_error)
__pyx_t_1 = ((__pyx_t_8 == 1) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":326
* 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_9 = __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_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 326, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":325
* 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) )
* else:
*/
goto __pyx_L8;
}
/* "petsc4py/PETSc/Vec.pyx":328
* CHKERR( VecCreateSeqViennaCLWithArrays(ccomm,bs,N,sa,vclvec,&newvec) )
* else:
* CHKERR( VecCreateMPIViennaCLWithArrays(ccomm,bs,n,N,sa,vclvec,&newvec) ) # <<<<<<<<<<<<<<
* PetscCLEAR(self.obj); self.vec = newvec
*
*/
/*else*/ {
__pyx_t_9 = __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_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 328, __pyx_L1_error)
}
__pyx_L8:;
/* "petsc4py/PETSc/Vec.pyx":329
* else:
* CHKERR( VecCreateMPIViennaCLWithArrays(ccomm,bs,n,N,sa,vclvec,&newvec) )
* PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<<
*
* if cpuarray is not None:
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vec = __pyx_v_newvec;
/* "petsc4py/PETSc/Vec.pyx":331
* 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);
__pyx_t_3 = (__pyx_t_1 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Vec.pyx":332
*
* if cpuarray is not None:
* self.set_attr('__array__', cpuarray) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_10 = ((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_10)) __PYX_ERR(40, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
/* "petsc4py/PETSc/Vec.pyx":331
* PetscCLEAR(self.obj); self.vec = newvec
*
* if cpuarray is not None: # <<<<<<<<<<<<<<
* self.set_attr('__array__', cpuarray)
* return self
*/
}
/* "petsc4py/PETSc/Vec.pyx":333
* if cpuarray is not None:
* self.set_attr('__array__', cpuarray)
* return self # <<<<<<<<<<<<<<
*
* def createWithDLPack(self, object dltensor, size=None, bsize=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":297
* return self
*
* def createViennaCLWithArrays(self, cpuarray=None, viennaclvechandle=None, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<<
* """
* Returns an instance :class:`Vec`, a VECVIENNACL with user provided memory
*/
/* 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_10);
__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":335
* return self
*
* def createWithDLPack(self, object dltensor, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<<
* """
* Returns an instance :class:`Vec`, a PETSc vector from a DLPack object
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_63createWithDLPack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_62createWithDLPack[] = "Vec.createWithDLPack(self, dltensor, size=None, bsize=None, comm=None)\n\n Returns an instance :class:`Vec`, a PETSc vector from a DLPack object\n sharing the same memory.\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 :arg dltensor: An object with a __dlpack__ method or a DLPack tensor object (for backward compatibility)\n :arg size: A :class:`int` denoting the size of the Vec.\n :arg bsize: A :class:`int` denoting the block size.\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_63createWithDLPack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_dltensor = 0;
PyObject *__pyx_v_size = 0;
PyObject *__pyx_v_bsize = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dltensor,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0};
PyObject* values[4] = {0,0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dltensor)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createWithDLPack") < 0)) __PYX_ERR(40, 335, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_dltensor = values[0];
__pyx_v_size = values[1];
__pyx_v_bsize = values[2];
__pyx_v_comm = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createWithDLPack", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 335, __pyx_L3_error)
__pyx_L3_error:;
__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_62createWithDLPack(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_dltensor, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_62createWithDLPack(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_dltensor, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) {
struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *__pyx_v_ptr;
int __pyx_v_bits;
PetscInt __pyx_v_nz;
int64_t __pyx_v_ndim;
int64_t *__pyx_v_shape;
int64_t *__pyx_v_strides;
MPI_Comm __pyx_v_ccomm;
PetscInt __pyx_v_bs;
PetscInt __pyx_v_n;
PetscInt __pyx_v_N;
CYTHON_UNUSED __pyx_t_8petsc4py_5PETSc_DLContext *__pyx_v_ctx;
PyObject *__pyx_v_s = NULL;
Vec __pyx_v_newvec;
enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType __pyx_v_dltype;
int64_t *__pyx_v_shape_arr;
int64_t *__pyx_v_strides_arr;
PyObject *__pyx_v_s1 = 0;
PyObject *__pyx_v_s2 = 0;
int64_t __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
void *__pyx_t_6;
uint8_t __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
int __pyx_t_9;
int64_t *__pyx_t_10;
int64_t *__pyx_t_11;
int64_t *__pyx_t_12;
PetscInt __pyx_t_13;
int __pyx_t_14;
PetscErrorCode __pyx_t_15;
enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType __pyx_t_16;
int64_t __pyx_t_17;
int64_t __pyx_t_18;
int64_t __pyx_t_19;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createWithDLPack", 0);
__Pyx_INCREF(__pyx_v_dltensor);
__Pyx_INCREF(__pyx_v_size);
/* "petsc4py/PETSc/Vec.pyx":348
* :arg bsize: A :class:`int` denoting the block size.
* """
* cdef DLManagedTensor* ptr = NULL # <<<<<<<<<<<<<<
* cdef int bits = 0
* cdef PetscInt nz = 1
*/
__pyx_v_ptr = NULL;
/* "petsc4py/PETSc/Vec.pyx":349
* """
* 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":350
* 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":351
* 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":352
* 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":353
* 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":354
* cdef int64_t* shape = NULL
* cdef int64_t* strides = NULL
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<<
* cdef PetscInt bs = 0,n = 0,N = 0
* cdef DLContext* ctx = NULL
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 354, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":355
* cdef int64_t* strides = NULL
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt bs = 0,n = 0,N = 0 # <<<<<<<<<<<<<<
* cdef DLContext* ctx = NULL
*
*/
__pyx_v_bs = 0;
__pyx_v_n = 0;
__pyx_v_N = 0;
/* "petsc4py/PETSc/Vec.pyx":356
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt bs = 0,n = 0,N = 0
* cdef DLContext* ctx = NULL # <<<<<<<<<<<<<<
*
* if not PyCapsule_CheckExact(dltensor):
*/
__pyx_v_ctx = NULL;
/* "petsc4py/PETSc/Vec.pyx":358
* cdef DLContext* ctx = NULL
*
* if not PyCapsule_CheckExact(dltensor): # <<<<<<<<<<<<<<
* dltensor = dltensor.__dlpack__()
*
*/
__pyx_t_2 = ((!(PyCapsule_CheckExact(__pyx_v_dltensor) != 0)) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":359
*
* if not PyCapsule_CheckExact(dltensor):
* dltensor = dltensor.__dlpack__() # <<<<<<<<<<<<<<
*
* if PyCapsule_IsValid(dltensor, 'dltensor'):
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dltensor, __pyx_n_s_dlpack); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 359, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 359, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_dltensor, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Vec.pyx":358
* cdef DLContext* ctx = NULL
*
* if not PyCapsule_CheckExact(dltensor): # <<<<<<<<<<<<<<
* dltensor = dltensor.__dlpack__()
*
*/
}
/* "petsc4py/PETSc/Vec.pyx":361
* 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, ((char const *)"dltensor")) != 0);
if (likely(__pyx_t_2)) {
/* "petsc4py/PETSc/Vec.pyx":362
*
* 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, ((char const *)"dltensor")); if (unlikely(__pyx_t_6 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(40, 362, __pyx_L1_error)
__pyx_v_ptr = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_6);
/* "petsc4py/PETSc/Vec.pyx":363
* 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":364
* 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)))) != 0);
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/Vec.pyx":365
* bits = ptr.dl_tensor.dtype.bits
* if bits != 8*sizeof(PetscScalar):
* raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) # <<<<<<<<<<<<<<
* ndim = ptr.dl_tensor.ndim
* shape = ptr.dl_tensor.shape
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Tensor_dtype_does_not_match_PETS, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __pyx_convert__to_py_struct____pyx_t_8petsc4py_5PETSc_DLDataType(__pyx_v_ptr->dl_tensor.dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_8 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__PYX_ERR(40, 365, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":364
* 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":366
* 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_9 = __pyx_v_ptr->dl_tensor.ndim;
__pyx_v_ndim = __pyx_t_9;
/* "petsc4py/PETSc/Vec.pyx":367
* raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype))
* ndim = ptr.dl_tensor.ndim
* shape = ptr.dl_tensor.shape # <<<<<<<<<<<<<<
* for s in shape[:ndim]:
* nz = nz*s
*/
__pyx_t_10 = __pyx_v_ptr->dl_tensor.shape;
__pyx_v_shape = __pyx_t_10;
/* "petsc4py/PETSc/Vec.pyx":368
* ndim = ptr.dl_tensor.ndim
* shape = ptr.dl_tensor.shape
* for s in shape[:ndim]: # <<<<<<<<<<<<<<
* nz = nz*s
* strides = ptr.dl_tensor.strides
*/
__pyx_t_11 = (__pyx_v_shape + __pyx_v_ndim);
for (__pyx_t_12 = __pyx_v_shape; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) {
__pyx_t_10 = __pyx_t_12;
__pyx_t_4 = __Pyx_PyInt_From_int64_t((__pyx_t_10[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 368, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Vec.pyx":369
* shape = ptr.dl_tensor.shape
* for s in shape[:ndim]:
* nz = nz*s # <<<<<<<<<<<<<<
* strides = ptr.dl_tensor.strides
* PyCapsule_SetName(dltensor, 'used_dltensor')
*/
__pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_v_nz); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_v_s); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_13 = __Pyx_PyInt_As_PetscInt(__pyx_t_3); if (unlikely((__pyx_t_13 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(40, 369, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_nz = __pyx_t_13;
}
/* "petsc4py/PETSc/Vec.pyx":370
* for s in shape[:ndim]:
* nz = nz*s
* strides = ptr.dl_tensor.strides # <<<<<<<<<<<<<<
* PyCapsule_SetName(dltensor, 'used_dltensor')
* else:
*/
__pyx_t_10 = __pyx_v_ptr->dl_tensor.strides;
__pyx_v_strides = __pyx_t_10;
/* "petsc4py/PETSc/Vec.pyx":371
* 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_9 = PyCapsule_SetName(__pyx_v_dltensor, ((char const *)"used_dltensor")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(40, 371, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":361
* 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":373
* PyCapsule_SetName(dltensor, 'used_dltensor')
* else:
* raise ValueError("Expect a dltensor field, pycapsule.PyCapsule can only be consumed once") # <<<<<<<<<<<<<<
* if size is None: size = (toInt(nz), toInt(PETSC_DECIDE))
* Vec_Sizes(size, bsize, &bs, &n, &N)
*/
/*else*/ {
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 373, __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(40, 373, __pyx_L1_error)
}
__pyx_L4:;
/* "petsc4py/PETSc/Vec.pyx":374
* 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);
__pyx_t_14 = (__pyx_t_2 != 0);
if (__pyx_t_14) {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nz); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 374, __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(40, 374, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 374, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
__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":375
* 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_9 = __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_9 == ((int)-1))) __PYX_ERR(40, 375, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":376
* 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_15 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_15 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 376, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":377
* 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_14 = ((__pyx_v_bs == PETSC_DECIDE) != 0);
if (__pyx_t_14) {
__pyx_v_bs = 1;
}
/* "petsc4py/PETSc/Vec.pyx":378
* 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_14 = ((__pyx_v_nz < __pyx_v_n) != 0);
if (unlikely(__pyx_t_14)) {
/* "petsc4py/PETSc/Vec.pyx":380
* if nz < n: raise ValueError(
* "array size %d and vector local size %d block size %d" %
* (toInt(nz), toInt(n), toInt(bs))) # <<<<<<<<<<<<<<
* cdef PetscVec newvec = NULL
* cdef PetscDLDeviceType dltype = ptr.dl_tensor.ctx.device_type
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nz); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_3);
__pyx_t_5 = 0;
__pyx_t_4 = 0;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Vec.pyx":379
* if bs == PETSC_DECIDE: bs = 1
* if nz < n: raise ValueError(
* "array size %d and vector local size %d block size %d" % # <<<<<<<<<<<<<<
* (toInt(nz), toInt(n), toInt(bs)))
* cdef PetscVec newvec = NULL
*/
__pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 379, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "petsc4py/PETSc/Vec.pyx":378
* 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_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_8, 0, 0, 0);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_ERR(40, 378, __pyx_L1_error)
}
/* "petsc4py/PETSc/Vec.pyx":381
* "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":382
* (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_16 = __pyx_v_ptr->dl_tensor.ctx.device_type;
__pyx_v_dltype = __pyx_t_16;
/* "petsc4py/PETSc/Vec.pyx":383
* 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_16 = __pyx_v_dltype;
__pyx_t_2 = ((__pyx_t_16 == __pyx_e_8petsc4py_5PETSc_kDLCUDA) != 0);
if (!__pyx_t_2) {
} else {
__pyx_t_14 = __pyx_t_2;
goto __pyx_L12_bool_binop_done;
}
__pyx_t_2 = ((__pyx_t_16 == __pyx_e_8petsc4py_5PETSc_kDLCUDAManaged) != 0);
__pyx_t_14 = __pyx_t_2;
__pyx_L12_bool_binop_done:;
__pyx_t_2 = (__pyx_t_14 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":384
* 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_9 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_9 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(40, 384, __pyx_L1_error)
__pyx_t_2 = ((__pyx_t_9 == 1) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":385
* 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_15 = __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_15 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 385, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":384
* 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":387
* 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_15 = __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_15 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 387, __pyx_L1_error)
}
__pyx_L14:;
/* "petsc4py/PETSc/Vec.pyx":383
* 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":388
* 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_16 = __pyx_v_dltype;
__pyx_t_14 = ((__pyx_t_16 == __pyx_e_8petsc4py_5PETSc_kDLCPU) != 0);
if (!__pyx_t_14) {
} else {
__pyx_t_2 = __pyx_t_14;
goto __pyx_L15_bool_binop_done;
}
__pyx_t_14 = ((__pyx_t_16 == __pyx_e_8petsc4py_5PETSc_kDLCUDAHost) != 0);
if (!__pyx_t_14) {
} else {
__pyx_t_2 = __pyx_t_14;
goto __pyx_L15_bool_binop_done;
}
__pyx_t_14 = ((__pyx_t_16 == __pyx_e_8petsc4py_5PETSc_kDLROCMHost) != 0);
__pyx_t_2 = __pyx_t_14;
__pyx_L15_bool_binop_done:;
__pyx_t_14 = (__pyx_t_2 != 0);
if (__pyx_t_14) {
/* "petsc4py/PETSc/Vec.pyx":389
* 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_9 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_9 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(40, 389, __pyx_L1_error)
__pyx_t_14 = ((__pyx_t_9 == 1) != 0);
if (__pyx_t_14) {
/* "petsc4py/PETSc/Vec.pyx":390
* 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_15 = __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_15 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 390, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":389
* 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":392
* 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_15 = __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_15 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 392, __pyx_L1_error)
}
__pyx_L18:;
/* "petsc4py/PETSc/Vec.pyx":388
* 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":393
* 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_14 = ((__pyx_v_dltype == __pyx_e_8petsc4py_5PETSc_kDLROCM) != 0);
if (likely(__pyx_t_14)) {
/* "petsc4py/PETSc/Vec.pyx":394
* 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_9 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_9 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(40, 394, __pyx_L1_error)
__pyx_t_14 = ((__pyx_t_9 == 1) != 0);
if (__pyx_t_14) {
/* "petsc4py/PETSc/Vec.pyx":395
* 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_15 = __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_15 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 395, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":394
* 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":397
* 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_15 = __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_15 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 397, __pyx_L1_error)
}
__pyx_L19:;
/* "petsc4py/PETSc/Vec.pyx":393
* 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":399
* CHKERR( VecCreateMPIHIPWithArray(ccomm,bs,n,N,<PetscScalar*>(ptr.dl_tensor.data),&newvec) )
* else:
* raise TypeError("Device type {} not supported".format(dltype)) # <<<<<<<<<<<<<<
*
* PetscCLEAR(self.obj); self.vec = newvec
*/
/*else*/ {
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Device_type_not_supported, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_v_dltype); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
__pyx_t_8 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__PYX_ERR(40, 399, __pyx_L1_error)
}
__pyx_L11:;
/* "petsc4py/PETSc/Vec.pyx":401
* raise TypeError("Device type {} not supported".format(dltype))
*
* PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<<
* self.set_attr('__array__', dltensor)
* cdef int64_t* shape_arr = NULL
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vec = __pyx_v_newvec;
/* "petsc4py/PETSc/Vec.pyx":402
*
* PetscCLEAR(self.obj); self.vec = newvec
* self.set_attr('__array__', dltensor) # <<<<<<<<<<<<<<
* cdef int64_t* shape_arr = NULL
* cdef int64_t* strides_arr = NULL
*/
__pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_dltensor); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 402, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/Vec.pyx":403
* PetscCLEAR(self.obj); self.vec = newvec
* self.set_attr('__array__', dltensor)
* cdef int64_t* shape_arr = NULL # <<<<<<<<<<<<<<
* cdef int64_t* strides_arr = NULL
* cdef object s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
*/
__pyx_v_shape_arr = NULL;
/* "petsc4py/PETSc/Vec.pyx":404
* self.set_attr('__array__', dltensor)
* cdef int64_t* shape_arr = NULL
* cdef int64_t* strides_arr = NULL # <<<<<<<<<<<<<<
* cdef object s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
* cdef object s2 = oarray_p(empty_p(ndim), NULL, <void**>&strides_arr)
*/
__pyx_v_strides_arr = NULL;
/* "petsc4py/PETSc/Vec.pyx":405
* cdef int64_t* shape_arr = NULL
* cdef int64_t* strides_arr = NULL
* cdef object s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr) # <<<<<<<<<<<<<<
* cdef object 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(40, 405, __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(40, 405, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_s1 = __pyx_t_8;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/Vec.pyx":406
* cdef int64_t* strides_arr = NULL
* cdef object s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
* cdef object 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(40, 406, __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(40, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_v_s2 = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Vec.pyx":407
* cdef object s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
* cdef object 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_17 = __pyx_v_ndim;
__pyx_t_18 = __pyx_t_17;
for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {
__pyx_v_i = __pyx_t_19;
/* "petsc4py/PETSc/Vec.pyx":408
* cdef object 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":409
* 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":410
* shape_arr[i] = shape[i]
* strides_arr[i] = strides[i]
* self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) # <<<<<<<<<<<<<<
* if ptr.manager_deleter != NULL:
* ptr.manager_deleter(ptr) # free the manager
*/
__pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_v_ptr->dl_tensor.ctx.device_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_ptr->dl_tensor.ctx.device_id); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
__Pyx_INCREF(__pyx_v_s1);
__Pyx_GIVEREF(__pyx_v_s1);
PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_s1);
__Pyx_INCREF(__pyx_v_s2);
__Pyx_GIVEREF(__pyx_v_s2);
PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_s2);
__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_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/Vec.pyx":411
* 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_14 = ((__pyx_v_ptr->manager_deleter != NULL) != 0);
if (__pyx_t_14) {
/* "petsc4py/PETSc/Vec.pyx":412
* 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":411
* 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":413
* if ptr.manager_deleter != NULL:
* ptr.manager_deleter(ptr) # free the manager
* return self # <<<<<<<<<<<<<<
*
* def attachDLPackInfo(self, Vec vec=None, object dltensor=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":335
* return self
*
* def createWithDLPack(self, object dltensor, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<<
* """
* Returns an instance :class:`Vec`, a PETSc vector from a DLPack object
*/
/* 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_8);
__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":415
* return self
*
* def attachDLPackInfo(self, Vec vec=None, object dltensor=None): # <<<<<<<<<<<<<<
* """
* Attach the tensor information from an input vector (vec) or a
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_65attachDLPackInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_64attachDLPackInfo[] = "Vec.attachDLPackInfo(self, Vec vec=None, dltensor=None)\n\n Attach the tensor information from an input vector (vec) or a\n DLPack tensor if it is not available in current vector. The input\n vector is typically created with createWithDlpack(). This operation\n does not copy the data from the input parameters, it simply uses\n their meta information.\n\n Note that the auxiliary tensor information is required when converting\n a PETSc vector to a DLPack object.\n\n See also :meth:`Vec.clearDLPackInfo`.\n\n :arg vec: A :class:'Vec' containing auxiliary tensor information\n :arg dltensor: A DLPack tensor object\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_65attachDLPackInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec = 0;
PyObject *__pyx_v_dltensor = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_dltensor,0};
PyObject* values[2] = {0,0};
values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None);
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dltensor);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "attachDLPackInfo") < 0)) __PYX_ERR(40, 415, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
__pyx_v_dltensor = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("attachDLPackInfo", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 415, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.attachDLPackInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "vec", 0))) __PYX_ERR(40, 415, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_64attachDLPackInfo(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec, __pyx_v_dltensor);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_64attachDLPackInfo(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_dltensor) {
CYTHON_UNUSED PyObject *__pyx_v_ctx0 = 0;
PyObject *__pyx_v_ctx = 0;
struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *__pyx_v_ptr;
int64_t *__pyx_v_shape_arr;
int64_t *__pyx_v_strides_arr;
PyObject *__pyx_v_s1 = 0;
PyObject *__pyx_v_s2 = 0;
uint8_t __pyx_v_bits;
int __pyx_v_ndim;
int64_t *__pyx_v_shape;
int64_t *__pyx_v_strides;
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
void *__pyx_t_5;
uint8_t __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
int __pyx_t_10;
int64_t *__pyx_t_11;
int __pyx_t_12;
int __pyx_t_13;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("attachDLPackInfo", 0);
/* "petsc4py/PETSc/Vec.pyx":431
* :arg dltensor: A DLPack tensor object
* """
* cdef object ctx0 = self.get_attr('__dltensor_ctx__'), ctx = None # <<<<<<<<<<<<<<
* cdef DLManagedTensor* ptr = NULL
* cdef int64_t* shape_arr = NULL
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 431, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ctx0 = __pyx_t_1;
__pyx_t_1 = 0;
__Pyx_INCREF(Py_None);
__pyx_v_ctx = Py_None;
/* "petsc4py/PETSc/Vec.pyx":432
* """
* cdef object ctx0 = self.get_attr('__dltensor_ctx__'), ctx = None
* cdef DLManagedTensor* ptr = NULL # <<<<<<<<<<<<<<
* cdef int64_t* shape_arr = NULL
* cdef int64_t* strides_arr = NULL
*/
__pyx_v_ptr = NULL;
/* "petsc4py/PETSc/Vec.pyx":433
* cdef object ctx0 = self.get_attr('__dltensor_ctx__'), ctx = None
* cdef DLManagedTensor* ptr = NULL
* cdef int64_t* shape_arr = NULL # <<<<<<<<<<<<<<
* cdef int64_t* strides_arr = NULL
* cdef object s1 = None, s2 = None
*/
__pyx_v_shape_arr = NULL;
/* "petsc4py/PETSc/Vec.pyx":434
* 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":435
* 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":437
* cdef object s1 = None, s2 = None
*
* if vec is None and dltensor is None: # <<<<<<<<<<<<<<
* raise ValueError('Missing input parameters')
* if vec is not None:
*/
__pyx_t_3 = (((PyObject *)__pyx_v_vec) == Py_None);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = (__pyx_v_dltensor == Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L4_bool_binop_done:;
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/Vec.pyx":438
*
* 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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 438, __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(40, 438, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":437
* 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":439
* 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_2 = (((PyObject *)__pyx_v_vec) != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Vec.pyx":440
* 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_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)((struct PyPetscObjectObject *)__pyx_v_vec)->__pyx_vtab)->get_attr(((struct PyPetscObjectObject *)__pyx_v_vec), ((char *)"__dltensor_ctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 440, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_ctx, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":441
* 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_3 = (__pyx_v_ctx == Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/Vec.pyx":442
* 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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 442, __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(40, 442, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":441
* 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":443
* if ctx is None:
* raise ValueError('Input vector has no tensor information')
* self.set_attr('__dltensor_ctx__', ctx) # <<<<<<<<<<<<<<
* else:
* if PyCapsule_IsValid(dltensor, 'dltensor'):
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__"), __pyx_v_ctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 443, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":439
* 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":445
* 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_2 = (PyCapsule_IsValid(__pyx_v_dltensor, ((char const *)"dltensor")) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":446
* 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_5 = PyCapsule_GetPointer(__pyx_v_dltensor, ((char const *)"dltensor")); if (unlikely(__pyx_t_5 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(40, 446, __pyx_L1_error)
__pyx_v_ptr = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_5);
/* "petsc4py/PETSc/Vec.pyx":445
* 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":447
* 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_2 = (PyCapsule_IsValid(__pyx_v_dltensor, ((char const *)"used_dltensor")) != 0);
if (likely(__pyx_t_2)) {
/* "petsc4py/PETSc/Vec.pyx":448
* 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_5 = PyCapsule_GetPointer(__pyx_v_dltensor, ((char const *)"used_dltensor")); if (unlikely(__pyx_t_5 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(40, 448, __pyx_L1_error)
__pyx_v_ptr = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_5);
/* "petsc4py/PETSc/Vec.pyx":447
* 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":450
* 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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 450, __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(40, 450, __pyx_L1_error)
}
__pyx_L8:;
/* "petsc4py/PETSc/Vec.pyx":451
* 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_6 = __pyx_v_ptr->dl_tensor.dtype.bits;
__pyx_v_bits = __pyx_t_6;
/* "petsc4py/PETSc/Vec.pyx":452
* raise ValueError("Expect a dltensor or used_dltensor field")
* bits = ptr.dl_tensor.dtype.bits
* if bits != 8*sizeof(PetscScalar): # <<<<<<<<<<<<<<
* raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype))
* ndim = ptr.dl_tensor.ndim
*/
__pyx_t_2 = ((__pyx_v_bits != (8 * (sizeof(PetscScalar)))) != 0);
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/Vec.pyx":453
* 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_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Tensor_dtype_does_not_match_PETS, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __pyx_convert__to_py_struct____pyx_t_8petsc4py_5PETSc_DLDataType(__pyx_v_ptr->dl_tensor.dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_7, function);
}
}
__pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8);
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_7, 0, 0, 0);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__PYX_ERR(40, 453, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":452
* 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":454
* 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_10 = __pyx_v_ptr->dl_tensor.ndim;
__pyx_v_ndim = __pyx_t_10;
/* "petsc4py/PETSc/Vec.pyx":455
* 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_11 = __pyx_v_ptr->dl_tensor.shape;
__pyx_v_shape = __pyx_t_11;
/* "petsc4py/PETSc/Vec.pyx":456
* 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_11 = __pyx_v_ptr->dl_tensor.strides;
__pyx_v_strides = __pyx_t_11;
/* "petsc4py/PETSc/Vec.pyx":457
* 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_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 457, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_7, NULL, ((void **)(&__pyx_v_shape_arr)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 457, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF_SET(__pyx_v_s1, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":458
* 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_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_strides_arr)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_s2, __pyx_t_7);
__pyx_t_7 = 0;
/* "petsc4py/PETSc/Vec.pyx":459
* 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_10 = __pyx_v_ndim;
__pyx_t_12 = __pyx_t_10;
for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
__pyx_v_i = __pyx_t_13;
/* "petsc4py/PETSc/Vec.pyx":460
* 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":461
* 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":462
* 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_7 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_v_ptr->dl_tensor.ctx.device_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ptr->dl_tensor.ctx.device_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = PyTuple_New(5); if (unlikely(!__pyx_t_9)) __PYX_ERR(40, 462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8);
__Pyx_INCREF(__pyx_v_s1);
__Pyx_GIVEREF(__pyx_v_s1);
PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_v_s1);
__Pyx_INCREF(__pyx_v_s2);
__Pyx_GIVEREF(__pyx_v_s2);
PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_v_s2);
__pyx_t_7 = 0;
__pyx_t_1 = 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(40, 462, __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;
}
__pyx_L6:;
/* "petsc4py/PETSc/Vec.pyx":463
* 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):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":415
* return self
*
* def attachDLPackInfo(self, Vec vec=None, object dltensor=None): # <<<<<<<<<<<<<<
* """
* Attach the tensor information from an input vector (vec) or a
*/
/* 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.Vec.attachDLPackInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_ctx0);
__Pyx_XDECREF(__pyx_v_ctx);
__Pyx_XDECREF(__pyx_v_s1);
__Pyx_XDECREF(__pyx_v_s2);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":465
* return self
*
* def clearDLPackInfo(self): # <<<<<<<<<<<<<<
* """
* Clear the tensor information
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_67clearDLPackInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_66clearDLPackInfo[] = "Vec.clearDLPackInfo(self)\n\n Clear the tensor information\n See also :meth:`Vec.attachDLPackInfo`.\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_67clearDLPackInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("clearDLPackInfo (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("clearDLPackInfo", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clearDLPackInfo", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_66clearDLPackInfo(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_66clearDLPackInfo(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":470
* See also :meth:`Vec.attachDLPackInfo`.
* """
* 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(40, 470, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":471
* """
* 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":465
* return self
*
* def clearDLPackInfo(self): # <<<<<<<<<<<<<<
* """
* Clear the 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":474
*
* # TODO Stream
* def __dlpack__(self, stream=-1): # <<<<<<<<<<<<<<
* return self.toDLPack('rw')
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_69__dlpack__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_68__dlpack__[] = "Vec.__dlpack__(self, stream=-1)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_69__dlpack__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED PyObject *__pyx_v_stream = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)__pyx_int_neg_1);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__dlpack__") < 0)) __PYX_ERR(40, 474, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_stream = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__dlpack__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 474, __pyx_L3_error)
__pyx_L3_error:;
__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_68__dlpack__(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_stream);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_68__dlpack__(struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_stream) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__dlpack__", 0);
/* "petsc4py/PETSc/Vec.pyx":475
* # TODO Stream
* def __dlpack__(self, stream=-1):
* return self.toDLPack('rw') # <<<<<<<<<<<<<<
*
* def __dlpack_device__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_toDLPack); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 475, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_n_s_rw) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_rw);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 475, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":474
*
* # TODO Stream
* def __dlpack__(self, stream=-1): # <<<<<<<<<<<<<<
* return self.toDLPack('rw')
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.__dlpack__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":477
* 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_71__dlpack_device__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_70__dlpack_device__[] = "Vec.__dlpack_device__(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_71__dlpack_device__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dlpack_device__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__dlpack_device__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__dlpack_device__", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_70__dlpack_device__(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_70__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":478
*
* 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(40, 478, __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(40, 478, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 3);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 4);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
__pyx_t_4 = PyList_GET_ITEM(sequence, 2);
__pyx_t_5 = PyList_GET_ITEM(sequence, 3);
__pyx_t_6 = PyList_GET_ITEM(sequence, 4);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
{
Py_ssize_t i;
PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6};
for (i=0; i < 5; i++) {
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(40, 478, __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(40, 478, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
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(40, 478, __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(40, 478, __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":479
* def __dlpack_device__(self):
* (dltype, devId, _, _, _) = vec_get_dlpack_ctx(self)
* return (dltype, devId) # <<<<<<<<<<<<<<
*
* def toDLPack(self, mode='rw'):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 479, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_dltype);
__Pyx_GIVEREF(__pyx_v_dltype);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dltype);
__Pyx_INCREF(__pyx_v_devId);
__Pyx_GIVEREF(__pyx_v_devId);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_devId);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":477
* 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":481
* return (dltype, devId)
*
* def toDLPack(self, mode='rw'): # <<<<<<<<<<<<<<
* """
* Return a DLPack capsule.
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_73toDLPack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_72toDLPack[] = "Vec.toDLPack(self, mode='rw')\n\n Return a DLPack capsule.\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_73toDLPack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)__pyx_n_s_rw);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "toDLPack") < 0)) __PYX_ERR(40, 481, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mode = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("toDLPack", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 481, __pyx_L3_error)
__pyx_L3_error:;
__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_72toDLPack(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_72toDLPack(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;
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)(PyObject *);
int64_t __pyx_t_11;
PetscErrorCode __pyx_t_12;
enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType __pyx_t_13;
int __pyx_t_14;
Py_ssize_t __pyx_t_15;
PyObject *(*__pyx_t_16)(PyObject *);
Py_ssize_t __pyx_t_17;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("toDLPack", 0);
__Pyx_INCREF(__pyx_v_mode);
/* "petsc4py/PETSc/Vec.pyx":485
* Return a DLPack capsule.
* """
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_n_s_rw);
__Pyx_DECREF_SET(__pyx_v_mode, __pyx_n_s_rw);
}
/* "petsc4py/PETSc/Vec.pyx":486
* """
* 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_3 = __pyx_v_mode;
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_rw, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(40, 486, __pyx_L1_error)
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_r, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(40, 486, __pyx_L1_error)
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_w, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(40, 486, __pyx_L1_error)
__pyx_t_2 = __pyx_t_1;
__pyx_L5_bool_binop_done:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_1 = (__pyx_t_2 != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/Vec.pyx":487
* 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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 487, __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(40, 487, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":486
* """
* 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":489
* 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":490
*
* cdef int64_t ndim = 0
* (device_type, device_id, ndim, shape, strides) = vec_get_dlpack_ctx(self) # <<<<<<<<<<<<<<
* hostmem = (device_type == kDLCPU)
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_vec_get_dlpack_ctx(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 490, __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 != 5)) {
if (size > 5) __Pyx_RaiseTooManyValuesError(5);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(40, 490, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 3);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 4);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
__pyx_t_7 = PyList_GET_ITEM(sequence, 3);
__pyx_t_8 = PyList_GET_ITEM(sequence, 4);
}
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
#else
{
Py_ssize_t i;
PyObject** temps[5] = {&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
for (i=0; i < 5; i++) {
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(40, 490, __pyx_L1_error)
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
}
#endif
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
Py_ssize_t index = -1;
PyObject** temps[5] = {&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
__pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(40, 490, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
for (index=0; index < 5; index++) {
PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 5) < 0) __PYX_ERR(40, 490, __pyx_L1_error)
__pyx_t_10 = NULL;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L9_unpacking_done;
__pyx_L8_unpacking_failed:;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_10 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(40, 490, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_6); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(40, 490, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_device_type = __pyx_t_4;
__pyx_t_4 = 0;
__pyx_v_device_id = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_ndim = __pyx_t_11;
__pyx_v_shape = __pyx_t_7;
__pyx_t_7 = 0;
__pyx_v_strides = __pyx_t_8;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/Vec.pyx":491
* 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_3 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 491, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = PyObject_RichCompare(__pyx_v_device_type, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 491, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_hostmem = __pyx_t_8;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/Vec.pyx":493
* 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":494
*
* 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":495
* 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":496
* 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":497
* 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":503
* # 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_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(40, 503, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":504
* # 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_1 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(40, 504, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":505
* if mode == 'w':
* if hostmem:
* CHKERR( VecGetArrayWrite(self.vec, <PetscScalar**>&a) ) # <<<<<<<<<<<<<<
* CHKERR( VecRestoreArrayWrite(self.vec, NULL) )
* else:
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayWrite(__pyx_v_self->vec, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 505, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":506
* if hostmem:
* CHKERR( VecGetArrayWrite(self.vec, <PetscScalar**>&a) )
* CHKERR( VecRestoreArrayWrite(self.vec, NULL) ) # <<<<<<<<<<<<<<
* else:
* CHKERR( VecGetArrayWriteAndMemType(self.vec, <PetscScalar**>&a, NULL) )
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayWrite(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 506, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":504
* # 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":508
* CHKERR( VecRestoreArrayWrite(self.vec, NULL) )
* else:
* CHKERR( VecGetArrayWriteAndMemType(self.vec, <PetscScalar**>&a, NULL) ) # <<<<<<<<<<<<<<
* CHKERR( VecRestoreArrayWriteAndMemType(self.vec, NULL) )
* elif mode == 'r':
*/
/*else*/ {
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayWriteAndMemType(__pyx_v_self->vec, ((PetscScalar **)(&__pyx_v_a)), NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 508, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":509
* else:
* CHKERR( VecGetArrayWriteAndMemType(self.vec, <PetscScalar**>&a, NULL) )
* CHKERR( VecRestoreArrayWriteAndMemType(self.vec, NULL) ) # <<<<<<<<<<<<<<
* elif mode == 'r':
* if hostmem:
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayWriteAndMemType(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 509, __pyx_L1_error)
}
__pyx_L11:;
/* "petsc4py/PETSc/Vec.pyx":503
* # 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":510
* 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_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(40, 510, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":511
* CHKERR( VecRestoreArrayWriteAndMemType(self.vec, NULL) )
* elif mode == 'r':
* if hostmem: # <<<<<<<<<<<<<<
* CHKERR( VecGetArrayRead(self.vec, <const PetscScalar**>&a) )
* CHKERR( VecRestoreArrayRead(self.vec, NULL) )
*/
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(40, 511, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":512
* elif mode == 'r':
* if hostmem:
* CHKERR( VecGetArrayRead(self.vec, <const PetscScalar**>&a) ) # <<<<<<<<<<<<<<
* CHKERR( VecRestoreArrayRead(self.vec, NULL) )
* else:
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayRead(__pyx_v_self->vec, ((PetscScalar const **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 512, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":513
* 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_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayRead(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 513, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":511
* 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":515
* CHKERR( VecRestoreArrayRead(self.vec, NULL) )
* else:
* CHKERR( VecGetArrayReadAndMemType(self.vec, <const PetscScalar**>&a, NULL) ) # <<<<<<<<<<<<<<
* CHKERR( VecRestoreArrayReadAndMemType(self.vec, NULL) )
* else:
*/
/*else*/ {
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayReadAndMemType(__pyx_v_self->vec, ((PetscScalar const **)(&__pyx_v_a)), NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 515, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":516
* else:
* CHKERR( VecGetArrayReadAndMemType(self.vec, <const PetscScalar**>&a, NULL) )
* CHKERR( VecRestoreArrayReadAndMemType(self.vec, NULL) ) # <<<<<<<<<<<<<<
* else:
* if hostmem:
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayReadAndMemType(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 516, __pyx_L1_error)
}
__pyx_L12:;
/* "petsc4py/PETSc/Vec.pyx":510
* 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":518
* CHKERR( VecRestoreArrayReadAndMemType(self.vec, NULL) )
* else:
* if hostmem: # <<<<<<<<<<<<<<
* CHKERR( VecGetArray(self.vec, <PetscScalar**>&a) )
* CHKERR( VecRestoreArray(self.vec, NULL) )
*/
/*else*/ {
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(40, 518, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":519
* else:
* if hostmem:
* CHKERR( VecGetArray(self.vec, <PetscScalar**>&a) ) # <<<<<<<<<<<<<<
* CHKERR( VecRestoreArray(self.vec, NULL) )
* else:
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArray(__pyx_v_self->vec, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 519, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":520
* if hostmem:
* CHKERR( VecGetArray(self.vec, <PetscScalar**>&a) )
* CHKERR( VecRestoreArray(self.vec, NULL) ) # <<<<<<<<<<<<<<
* else:
* CHKERR( VecGetArrayAndMemType(self.vec, <PetscScalar**>&a, NULL) )
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArray(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 520, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":518
* 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":522
* 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_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayAndMemType(__pyx_v_self->vec, ((PetscScalar **)(&__pyx_v_a)), NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 522, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":523
* else:
* CHKERR( VecGetArrayAndMemType(self.vec, <PetscScalar**>&a, NULL) )
* CHKERR( VecRestoreArrayAndMemType(self.vec, NULL) ) # <<<<<<<<<<<<<<
* dl_tensor.data = <void *>a
*
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayAndMemType(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 523, __pyx_L1_error)
}
__pyx_L13:;
}
__pyx_L10:;
/* "petsc4py/PETSc/Vec.pyx":524
* 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":526
* 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":527
*
* 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_13 = ((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)__Pyx_PyInt_As_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_v_device_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 527, __pyx_L1_error)
__pyx_v_ctx->device_type = __pyx_t_13;
/* "petsc4py/PETSc/Vec.pyx":528
* 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_14 = __Pyx_PyInt_As_int(__pyx_v_device_id); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(40, 528, __pyx_L1_error)
__pyx_v_ctx->device_id = __pyx_t_14;
/* "petsc4py/PETSc/Vec.pyx":529
* 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":530
* 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_8 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 530, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 530, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
__pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0;
__pyx_t_16 = NULL;
} else {
__pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 530, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(40, 530, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
for (;;) {
if (likely(!__pyx_t_16)) {
if (likely(PyList_CheckExact(__pyx_t_8))) {
if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(40, 530, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 530, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
} else {
if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(40, 530, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 530, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
}
} else {
__pyx_t_3 = __pyx_t_16(__pyx_t_8);
if (unlikely(!__pyx_t_3)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(40, 530, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_3);
}
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Vec.pyx":531
* 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_3 = __Pyx_PyObject_GetItem(__pyx_v_shape, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 531, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(40, 531, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(40, 531, __pyx_L1_error)
(__pyx_v_shape_strides[__pyx_t_17]) = __pyx_t_11;
/* "petsc4py/PETSc/Vec.pyx":530
* 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":532
* for i in range(ndim):
* shape_strides[i] = shape[i]
* for i in range(ndim): # <<<<<<<<<<<<<<
* shape_strides[i+ndim] = strides[i]
* dl_tensor.ndim = ndim
*/
__pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
__pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0;
__pyx_t_16 = NULL;
} else {
__pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(40, 532, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
for (;;) {
if (likely(!__pyx_t_16)) {
if (likely(PyList_CheckExact(__pyx_t_8))) {
if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(40, 532, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
} else {
if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(40, 532, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
}
} else {
__pyx_t_3 = __pyx_t_16(__pyx_t_8);
if (unlikely(!__pyx_t_3)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(40, 532, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_3);
}
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Vec.pyx":533
* shape_strides[i] = shape[i]
* for i in range(ndim):
* shape_strides[i+ndim] = strides[i] # <<<<<<<<<<<<<<
* dl_tensor.ndim = ndim
* dl_tensor.shape = shape_strides
*/
__pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_strides, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 533, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(40, 533, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 533, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_7 = PyNumber_Add(__pyx_v_i, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 533, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(40, 533, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
(__pyx_v_shape_strides[__pyx_t_17]) = __pyx_t_11;
/* "petsc4py/PETSc/Vec.pyx":532
* for i in range(ndim):
* shape_strides[i] = shape[i]
* for i in range(ndim): # <<<<<<<<<<<<<<
* shape_strides[i+ndim] = strides[i]
* dl_tensor.ndim = ndim
*/
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "petsc4py/PETSc/Vec.pyx":534
* for i in range(ndim):
* shape_strides[i+ndim] = strides[i]
* dl_tensor.ndim = ndim # <<<<<<<<<<<<<<
* dl_tensor.shape = shape_strides
* dl_tensor.strides = shape_strides + ndim
*/
__pyx_v_dl_tensor->ndim = __pyx_v_ndim;
/* "petsc4py/PETSc/Vec.pyx":535
* shape_strides[i+ndim] = strides[i]
* dl_tensor.ndim = ndim
* dl_tensor.shape = shape_strides # <<<<<<<<<<<<<<
* dl_tensor.strides = shape_strides + ndim
*
*/
__pyx_v_dl_tensor->shape = __pyx_v_shape_strides;
/* "petsc4py/PETSc/Vec.pyx":536
* dl_tensor.ndim = ndim
* dl_tensor.shape = shape_strides
* dl_tensor.strides = shape_strides + ndim # <<<<<<<<<<<<<<
*
* cdef DLDataType* dtype = &dl_tensor.dtype
*/
__pyx_v_dl_tensor->strides = (__pyx_v_shape_strides + __pyx_v_ndim);
/* "petsc4py/PETSc/Vec.pyx":538
* 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":539
*
* 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":540
* 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_1 = (((sizeof(PetscScalar)) == 8) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":541
* 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":540
* 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_L18;
}
/* "petsc4py/PETSc/Vec.pyx":542
* if sizeof(PetscScalar) == 8:
* dtype.bits = <uint8_t>64
* elif sizeof(PetscScalar) == 4: # <<<<<<<<<<<<<<
* dtype.bits = <uint8_t>32
* else:
*/
__pyx_t_1 = (((sizeof(PetscScalar)) == 4) != 0);
if (likely(__pyx_t_1)) {
/* "petsc4py/PETSc/Vec.pyx":543
* 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":542
* if sizeof(PetscScalar) == 8:
* dtype.bits = <uint8_t>64
* elif sizeof(PetscScalar) == 4: # <<<<<<<<<<<<<<
* dtype.bits = <uint8_t>32
* else:
*/
goto __pyx_L18;
}
/* "petsc4py/PETSc/Vec.pyx":545
* 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_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 545, __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(40, 545, __pyx_L1_error)
}
__pyx_L18:;
/* "petsc4py/PETSc/Vec.pyx":546
* 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":547
* 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":548
* 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_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectReference(((PetscObject)__pyx_v_self->vec))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 548, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":549
* 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":550
* 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":551
* 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(self, ghosts, size, bsize=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_8 = PyCapsule_New(__pyx_v_dlm_tensor, ((char const *)"dltensor"), __pyx_f_8petsc4py_5PETSc_pycapsule_deleter); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 551, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_r = __pyx_t_8;
__pyx_t_8 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":481
* return (dltype, devId)
*
* def toDLPack(self, mode='rw'): # <<<<<<<<<<<<<<
* """
* Return a DLPack capsule.
*/
/* 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.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":553
* return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter)
*
* def createGhost(self, ghosts, size, bsize=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt ng=0, *ig=NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_75createGhost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_74createGhost[] = "Vec.createGhost(self, ghosts, size, bsize=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_75createGhost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ghosts = 0;
PyObject *__pyx_v_size = 0;
PyObject *__pyx_v_bsize = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ghosts,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0};
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ghosts)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createGhost", 0, 2, 4, 1); __PYX_ERR(40, 553, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createGhost") < 0)) __PYX_ERR(40, 553, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_ghosts = values[0];
__pyx_v_size = values[1];
__pyx_v_bsize = values[2];
__pyx_v_comm = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createGhost", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 553, __pyx_L3_error)
__pyx_L3_error:;
__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_74createGhost(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_ghosts, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_74createGhost(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":554
*
* def createGhost(self, ghosts, size, bsize=None, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(40, 554, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":555
* def createGhost(self, ghosts, size, bsize=None, comm=None):
* 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":556
* 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(40, 556, __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":557
* 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":558
* 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(40, 558, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":559
* 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(40, 559, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":560
* 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":561
* 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) != 0);
if (__pyx_t_5) {
/* "petsc4py/PETSc/Vec.pyx":562
* 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(40, 562, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":561
* 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":565
* ccomm, n, N, ng, ig, &newvec) )
* else:
* CHKERR( VecCreateGhostBlock( # <<<<<<<<<<<<<<
* ccomm, bs, n, N, ng, ig, &newvec) )
* PetscCLEAR(self.obj); self.vec = newvec
*/
/*else*/ {
/* "petsc4py/PETSc/Vec.pyx":566
* else:
* CHKERR( VecCreateGhostBlock(
* ccomm, bs, n, N, ng, ig, &newvec) ) # <<<<<<<<<<<<<<
* 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(40, 565, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/Vec.pyx":567
* CHKERR( VecCreateGhostBlock(
* ccomm, bs, n, N, ng, ig, &newvec) )
* PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vec = __pyx_v_newvec;
/* "petsc4py/PETSc/Vec.pyx":568
* ccomm, bs, n, N, ng, ig, &newvec) )
* PetscCLEAR(self.obj); self.vec = newvec
* return self # <<<<<<<<<<<<<<
*
* def createGhostWithArray(self, ghosts, array,
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":553
* return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter)
*
* def createGhost(self, ghosts, size, bsize=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt ng=0, *ig=NULL
*/
/* 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":570
* return self
*
* def createGhostWithArray(self, ghosts, array, # <<<<<<<<<<<<<<
* size=None, bsize=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_77createGhostWithArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_76createGhostWithArray[] = "Vec.createGhostWithArray(self, ghosts, array, size=None, bsize=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_77createGhostWithArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createGhostWithArray (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ghosts,&__pyx_n_s_array,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0};
PyObject* values[5] = {0,0,0,0,0};
/* "petsc4py/PETSc/Vec.pyx":571
*
* def createGhostWithArray(self, ghosts, array,
* size=None, bsize=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt ng=0, *ig=NULL
*/
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ghosts)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createGhostWithArray", 0, 2, 5, 1); __PYX_ERR(40, 570, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createGhostWithArray") < 0)) __PYX_ERR(40, 570, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_ghosts = values[0];
__pyx_v_array = values[1];
__pyx_v_size = values[2];
__pyx_v_bsize = values[3];
__pyx_v_comm = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createGhostWithArray", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 570, __pyx_L3_error)
__pyx_L3_error:;
__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_76createGhostWithArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_ghosts, __pyx_v_array, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm);
/* "petsc4py/PETSc/Vec.pyx":570
* return self
*
* def createGhostWithArray(self, ghosts, array, # <<<<<<<<<<<<<<
* size=None, bsize=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_76createGhostWithArray(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;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
int __pyx_t_9;
PetscErrorCode __pyx_t_10;
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("createGhostWithArray", 0);
__Pyx_INCREF(__pyx_v_ghosts);
__Pyx_INCREF(__pyx_v_array);
__Pyx_INCREF(__pyx_v_size);
/* "petsc4py/PETSc/Vec.pyx":572
* def createGhostWithArray(self, ghosts, array,
* size=None, bsize=None, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(40, 572, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":573
* size=None, bsize=None, comm=None):
* 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":574
* 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(40, 574, __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":575
* 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":576
* 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":577
* 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(40, 577, __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":578
* 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 != 0)) {
__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(40, 578, __pyx_L1_error)
__pyx_t_3 = __pyx_t_5;
}
__pyx_v_b = __pyx_t_3;
/* "petsc4py/PETSc/Vec.pyx":579
* 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);
__pyx_t_6 = (__pyx_t_4 != 0);
if (__pyx_t_6) {
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_na - (__pyx_v_ng * __pyx_v_b))); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 579, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 579, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 579, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
__pyx_t_2 = 0;
__pyx_t_7 = 0;
__Pyx_DECREF_SET(__pyx_v_size, __pyx_t_8);
__pyx_t_8 = 0;
}
/* "petsc4py/PETSc/Vec.pyx":580
* 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":581
* 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_9 = __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_9 == ((int)-1))) __PYX_ERR(40, 581, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":582
* 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_10 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 582, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":583
* 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_6 = ((__pyx_v_na < (__pyx_v_n + (__pyx_v_ng * __pyx_v_b))) != 0);
if (unlikely(__pyx_t_6)) {
/* "petsc4py/PETSc/Vec.pyx":586
* "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_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ng); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 586, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 586, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 586, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_11 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_b); if (unlikely(!__pyx_t_11)) __PYX_ERR(40, 586, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) __PYX_ERR(40, 586, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_11);
PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_11);
__pyx_t_8 = 0;
__pyx_t_7 = 0;
__pyx_t_2 = 0;
__pyx_t_11 = 0;
/* "petsc4py/PETSc/Vec.pyx":585
* if na < (n+ng*b): raise ValueError(
* "ghosts size %d, array size %d, and "
* "vector local size %d block size %d" % # <<<<<<<<<<<<<<
* (toInt(ng), toInt(na), toInt(n), toInt(b)))
* cdef PetscVec newvec = NULL
*/
__pyx_t_11 = __Pyx_PyString_Format(__pyx_kp_s_ghosts_size_d_array_size_d_and_v, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(40, 585, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
/* "petsc4py/PETSc/Vec.pyx":583
* 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_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(40, 583, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_Raise(__pyx_t_12, 0, 0, 0);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__PYX_ERR(40, 583, __pyx_L1_error)
}
/* "petsc4py/PETSc/Vec.pyx":587
* "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":588
* (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_6 = ((__pyx_v_bs == PETSC_DECIDE) != 0);
if (__pyx_t_6) {
/* "petsc4py/PETSc/Vec.pyx":589
* cdef PetscVec newvec = NULL
* if bs == PETSC_DECIDE:
* CHKERR( VecCreateGhostWithArray( # <<<<<<<<<<<<<<
* ccomm, n, N, ng, ig, sa, &newvec) )
* else:
*/
__pyx_t_10 = __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_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 589, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":588
* (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":592
* ccomm, n, N, ng, ig, sa, &newvec) )
* else:
* CHKERR( VecCreateGhostBlockWithArray( # <<<<<<<<<<<<<<
* ccomm, bs, n, N, ng, ig, sa, &newvec) )
* PetscCLEAR(self.obj); self.vec = newvec
*/
/*else*/ {
/* "petsc4py/PETSc/Vec.pyx":593
* else:
* CHKERR( VecCreateGhostBlockWithArray(
* ccomm, bs, n, N, ng, ig, sa, &newvec) ) # <<<<<<<<<<<<<<
* PetscCLEAR(self.obj); self.vec = newvec
* self.set_attr('__array__', array)
*/
__pyx_t_10 = __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_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 592, __pyx_L1_error)
}
__pyx_L5:;
/* "petsc4py/PETSc/Vec.pyx":594
* CHKERR( VecCreateGhostBlockWithArray(
* ccomm, bs, n, N, ng, ig, sa, &newvec) )
* PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<<
* self.set_attr('__array__', array)
* return self
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vec = __pyx_v_newvec;
/* "petsc4py/PETSc/Vec.pyx":595
* ccomm, bs, n, N, ng, ig, sa, &newvec) )
* PetscCLEAR(self.obj); self.vec = newvec
* self.set_attr('__array__', array) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_12 = ((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_12)) __PYX_ERR(40, 595, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
/* "petsc4py/PETSc/Vec.pyx":596
* PetscCLEAR(self.obj); self.vec = newvec
* self.set_attr('__array__', array)
* return self # <<<<<<<<<<<<<<
*
* def createShared(self, size, bsize=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":570
* return self
*
* def createGhostWithArray(self, ghosts, array, # <<<<<<<<<<<<<<
* size=None, bsize=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__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":598
* return self
*
* def createShared(self, size, bsize=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt bs=0, n=0, N=0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_79createShared(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_78createShared[] = "Vec.createShared(self, size, bsize=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_79createShared(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_size = 0;
PyObject *__pyx_v_bsize = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createShared") < 0)) __PYX_ERR(40, 598, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_bsize = values[1];
__pyx_v_comm = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createShared", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 598, __pyx_L3_error)
__pyx_L3_error:;
__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_78createShared(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_78createShared(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":599
*
* def createShared(self, size, bsize=None, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(40, 599, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":600
* def createShared(self, size, bsize=None, comm=None):
* 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":601
* 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(40, 601, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":602
* 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(40, 602, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":603
* Vec_Sizes(size, bsize, &bs, &n, &N)
* Sys_Layout(ccomm, bs, &n, &N)
* cdef PetscVec newvec = NULL # <<<<<<<<<<<<<<
* CHKERR( VecCreateShared(ccomm, n, N, &newvec) )
* PetscCLEAR(self.obj); self.vec = newvec
*/
__pyx_v_newvec = NULL;
/* "petsc4py/PETSc/Vec.pyx":604
* Sys_Layout(ccomm, bs, &n, &N)
* cdef PetscVec newvec = NULL
* CHKERR( VecCreateShared(ccomm, n, N, &newvec) ) # <<<<<<<<<<<<<<
* 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(40, 604, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":605
* cdef PetscVec newvec = NULL
* CHKERR( VecCreateShared(ccomm, n, N, &newvec) )
* PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<<
* if bs != PETSC_DECIDE:
* CHKERR( VecSetBlockSize(self.vec, bs) )
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vec = __pyx_v_newvec;
/* "petsc4py/PETSc/Vec.pyx":606
* CHKERR( VecCreateShared(ccomm, n, N, &newvec) )
* 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) != 0);
if (__pyx_t_4) {
/* "petsc4py/PETSc/Vec.pyx":607
* 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(40, 607, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":606
* CHKERR( VecCreateShared(ccomm, n, N, &newvec) )
* PetscCLEAR(self.obj); self.vec = newvec
* if bs != PETSC_DECIDE: # <<<<<<<<<<<<<<
* CHKERR( VecSetBlockSize(self.vec, bs) )
* return self
*/
}
/* "petsc4py/PETSc/Vec.pyx":608
* if bs != PETSC_DECIDE:
* CHKERR( VecSetBlockSize(self.vec, bs) )
* return self # <<<<<<<<<<<<<<
*
* def createNest(self, vecs, isets=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":598
* return self
*
* def createShared(self, size, bsize=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt bs=0, n=0, N=0
*/
/* 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":610
* return self
*
* def createNest(self, vecs, isets=None, comm=None): # <<<<<<<<<<<<<<
* vecs = list(vecs)
* if isets:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_81createNest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_80createNest[] = "Vec.createNest(self, vecs, isets=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_81createNest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vecs = 0;
PyObject *__pyx_v_isets = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_isets,&__pyx_n_s_comm,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isets);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createNest") < 0)) __PYX_ERR(40, 610, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_vecs = values[0];
__pyx_v_isets = values[1];
__pyx_v_comm = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createNest", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 610, __pyx_L3_error)
__pyx_L3_error:;
__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_80createNest(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_isets, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_80createNest(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_isets, PyObject *__pyx_v_comm) {
MPI_Comm __pyx_v_ccomm;
Py_ssize_t __pyx_v_i;
Py_ssize_t __pyx_v_m;
PetscInt __pyx_v_n;
Vec *__pyx_v_cvecs;
IS *__pyx_v_cisets;
CYTHON_UNUSED PyObject *__pyx_v_tmp1 = 0;
CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0;
Vec __pyx_v_newvec;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
Py_ssize_t __pyx_t_3;
Py_ssize_t __pyx_t_4;
MPI_Comm __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
Vec __pyx_t_7;
int __pyx_t_8;
IS __pyx_t_9;
PetscErrorCode __pyx_t_10;
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":611
*
* def createNest(self, vecs, isets=None, comm=None):
* vecs = list(vecs) # <<<<<<<<<<<<<<
* if isets:
* isets = list(isets)
*/
__pyx_t_1 = PySequence_List(__pyx_v_vecs); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 611, __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":612
* def createNest(self, vecs, isets=None, comm=None):
* 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(40, 612, __pyx_L1_error)
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":613
* 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(40, 613, __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":614
* 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(40, 614, __pyx_L1_error)
__pyx_t_4 = PyObject_Length(__pyx_v_vecs); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(40, 614, __pyx_L1_error)
if (unlikely(!((__pyx_t_3 == __pyx_t_4) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(40, 614, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/Vec.pyx":612
* def createNest(self, vecs, isets=None, comm=None):
* vecs = list(vecs)
* if isets: # <<<<<<<<<<<<<<
* isets = list(isets)
* assert len(isets) == len(vecs)
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Vec.pyx":616
* 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":617
* 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(PyErr_Occurred())) __PYX_ERR(40, 617, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_5;
/* "petsc4py/PETSc/Vec.pyx":618
* 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(40, 618, __pyx_L1_error)
__pyx_v_m = __pyx_t_4;
/* "petsc4py/PETSc/Vec.pyx":619
* 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":620
* cdef Py_ssize_t i, m = len(vecs)
* cdef PetscInt n = <PetscInt>m
* cdef PetscVec *cvecs = NULL # <<<<<<<<<<<<<<
* cdef PetscIS *cisets = NULL
* cdef object tmp1, tmp2
*/
__pyx_v_cvecs = NULL;
/* "petsc4py/PETSc/Vec.pyx":621
* cdef PetscInt n = <PetscInt>m
* cdef PetscVec *cvecs = NULL
* cdef PetscIS *cisets = NULL # <<<<<<<<<<<<<<
* cdef object tmp1, tmp2
* tmp1 = oarray_p(empty_p(n), NULL, <void**>&cvecs)
*/
__pyx_v_cisets = NULL;
/* "petsc4py/PETSc/Vec.pyx":623
* cdef PetscIS *cisets = NULL
* cdef object tmp1, tmp2
* tmp1 = 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(40, 623, __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(40, 623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_tmp1 = __pyx_t_6;
__pyx_t_6 = 0;
/* "petsc4py/PETSc/Vec.pyx":624
* cdef object tmp1, tmp2
* tmp1 = 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:
* tmp2 = 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, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(40, 624, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (!(likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(40, 624, __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":625
* tmp1 = 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: # <<<<<<<<<<<<<<
* tmp2 = 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);
__pyx_t_8 = (__pyx_t_2 != 0);
if (__pyx_t_8) {
/* "petsc4py/PETSc/Vec.pyx":626
* for i from 0 <= i < m: cvecs[i] = (<Vec?>vecs[i]).vec
* if isets is not None:
* tmp2 = 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(40, 626, __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(40, 626, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_tmp2 = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":627
* if isets is not None:
* tmp2 = 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, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 627, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(40, 627, __pyx_L1_error)
__pyx_t_9 = ((struct PyPetscISObject *)__pyx_t_1)->iset;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
(__pyx_v_cisets[__pyx_v_i]) = __pyx_t_9;
}
/* "petsc4py/PETSc/Vec.pyx":625
* tmp1 = 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: # <<<<<<<<<<<<<<
* tmp2 = oarray_p(empty_p(n), NULL, <void**>&cisets)
* for i from 0 <= i < m: cisets[i] = (<IS?>isets[i]).iset
*/
}
/* "petsc4py/PETSc/Vec.pyx":628
* tmp2 = 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) )
* PetscCLEAR(self.obj); self.vec = newvec
*/
__pyx_v_newvec = NULL;
/* "petsc4py/PETSc/Vec.pyx":629
* for i from 0 <= i < m: cisets[i] = (<IS?>isets[i]).iset
* cdef PetscVec newvec = NULL
* CHKERR( VecCreateNest(ccomm, n, cisets, cvecs,&newvec) ) # <<<<<<<<<<<<<<
* PetscCLEAR(self.obj); self.vec = newvec
* return self
*/
__pyx_t_10 = __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_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 629, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":630
* cdef PetscVec newvec = NULL
* CHKERR( VecCreateNest(ccomm, n, cisets, cvecs,&newvec) )
* PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->vec = __pyx_v_newvec;
/* "petsc4py/PETSc/Vec.pyx":631
* CHKERR( VecCreateNest(ccomm, n, cisets, cvecs,&newvec) )
* 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":610
* return self
*
* def createNest(self, vecs, isets=None, comm=None): # <<<<<<<<<<<<<<
* vecs = list(vecs)
* if isets:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.createNest", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmp1);
__Pyx_XDECREF(__pyx_v_tmp2);
__Pyx_XDECREF(__pyx_v_vecs);
__Pyx_XDECREF(__pyx_v_isets);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":635
* #
*
* def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_83setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_82setOptionsPrefix[] = "Vec.setOptionsPrefix(self, prefix)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_83setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(40, 635, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_prefix = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 635, __pyx_L3_error)
__pyx_L3_error:;
__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_82setOptionsPrefix(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_prefix);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_82setOptionsPrefix(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":636
*
* def setOptionsPrefix(self, prefix):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* prefix = str2bytes(prefix, &cval)
* CHKERR( VecSetOptionsPrefix(self.vec, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Vec.pyx":637
* def setOptionsPrefix(self, prefix):
* 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(40, 637, __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":638
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
* CHKERR( VecSetOptionsPrefix(self.vec, cval) ) # <<<<<<<<<<<<<<
*
* def getOptionsPrefix(self):
*/
__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(40, 638, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":635
* #
*
* def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":640
* CHKERR( VecSetOptionsPrefix(self.vec, cval) )
*
* def getOptionsPrefix(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( VecGetOptionsPrefix(self.vec, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_85getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_84getOptionsPrefix[] = "Vec.getOptionsPrefix(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_85getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_84getOptionsPrefix(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_84getOptionsPrefix(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":641
*
* def getOptionsPrefix(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( VecGetOptionsPrefix(self.vec, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Vec.pyx":642
* def getOptionsPrefix(self):
* 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(40, 642, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":643
* cdef const char *cval = NULL
* CHKERR( VecGetOptionsPrefix(self.vec, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def appendOptionsPrefix(self, prefix):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 643, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":640
* CHKERR( VecSetOptionsPrefix(self.vec, cval) )
*
* def getOptionsPrefix(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( VecGetOptionsPrefix(self.vec, &cval) )
*/
/* 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":645
* return bytes2str(cval)
*
* def appendOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_87appendOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_86appendOptionsPrefix[] = "Vec.appendOptionsPrefix(self, prefix)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_87appendOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "appendOptionsPrefix") < 0)) __PYX_ERR(40, 645, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_prefix = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 645, __pyx_L3_error)
__pyx_L3_error:;
__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_86appendOptionsPrefix(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_prefix);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_86appendOptionsPrefix(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":646
*
* def appendOptionsPrefix(self, prefix):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* prefix = str2bytes(prefix, &cval)
* CHKERR( VecAppendOptionsPrefix(self.vec, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Vec.pyx":647
* def appendOptionsPrefix(self, prefix):
* 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(40, 647, __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":648
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
* CHKERR( VecAppendOptionsPrefix(self.vec, cval) ) # <<<<<<<<<<<<<<
*
* def setFromOptions(self):
*/
__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(40, 648, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":645
* return bytes2str(cval)
*
* def appendOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":650
* CHKERR( VecAppendOptionsPrefix(self.vec, cval) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( VecSetFromOptions(self.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_89setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_88setFromOptions[] = "Vec.setFromOptions(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_89setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_88setFromOptions(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_88setFromOptions(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":651
*
* def setFromOptions(self):
* CHKERR( VecSetFromOptions(self.vec) ) # <<<<<<<<<<<<<<
*
* def setUp(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(40, 651, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":650
* CHKERR( VecAppendOptionsPrefix(self.vec, cval) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( VecSetFromOptions(self.vec) )
*
*/
/* 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":653
* CHKERR( VecSetFromOptions(self.vec) )
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( VecSetUp(self.vec) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_91setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_90setUp[] = "Vec.setUp(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_91setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setUp (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_90setUp(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_90setUp(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":654
*
* def setUp(self):
* 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(40, 654, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":655
* def setUp(self):
* CHKERR( VecSetUp(self.vec) )
* return self # <<<<<<<<<<<<<<
*
* def setOption(self, option, flag):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":653
* CHKERR( VecSetFromOptions(self.vec) )
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( VecSetUp(self.vec) )
* return self
*/
/* 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":657
* return self
*
* def setOption(self, option, flag): # <<<<<<<<<<<<<<
* CHKERR( VecSetOption(self.vec, option, flag) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_93setOption(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_92setOption[] = "Vec.setOption(self, option, flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_93setOption(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_option = 0;
PyObject *__pyx_v_flag = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_option,&__pyx_n_s_flag,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_option)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setOption", 1, 2, 2, 1); __PYX_ERR(40, 657, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOption") < 0)) __PYX_ERR(40, 657, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_option = values[0];
__pyx_v_flag = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setOption", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 657, __pyx_L3_error)
__pyx_L3_error:;
__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_92setOption(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_option, __pyx_v_flag);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_92setOption(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":658
*
* def setOption(self, option, flag):
* CHKERR( VecSetOption(self.vec, option, flag) ) # <<<<<<<<<<<<<<
*
* def getType(self):
*/
__pyx_t_1 = ((VecOption)__Pyx_PyInt_As_VecOption(__pyx_v_option)); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 658, __pyx_L1_error)
__pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 658, __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(40, 658, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":657
* return self
*
* def setOption(self, option, flag): # <<<<<<<<<<<<<<
* CHKERR( VecSetOption(self.vec, option, flag) )
*
*/
/* 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":660
* CHKERR( VecSetOption(self.vec, option, flag) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscVecType cval = NULL
* CHKERR( VecGetType(self.vec, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_95getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_94getType[] = "Vec.getType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_95getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_94getType(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_94getType(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":661
*
* def getType(self):
* cdef PetscVecType cval = NULL # <<<<<<<<<<<<<<
* CHKERR( VecGetType(self.vec, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Vec.pyx":662
* def getType(self):
* 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(40, 662, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":663
* cdef PetscVecType cval = NULL
* CHKERR( VecGetType(self.vec, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def getSize(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 663, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":660
* CHKERR( VecSetOption(self.vec, option, flag) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscVecType cval = NULL
* CHKERR( VecGetType(self.vec, &cval) )
*/
/* 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":665
* return bytes2str(cval)
*
* def getSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt N = 0
* CHKERR( VecGetSize(self.vec, &N) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_97getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_96getSize[] = "Vec.getSize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_97getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getSize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_96getSize(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_96getSize(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":666
*
* def getSize(self):
* cdef PetscInt N = 0 # <<<<<<<<<<<<<<
* CHKERR( VecGetSize(self.vec, &N) )
* return toInt(N)
*/
__pyx_v_N = 0;
/* "petsc4py/PETSc/Vec.pyx":667
* def getSize(self):
* 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(40, 667, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":668
* cdef PetscInt N = 0
* CHKERR( VecGetSize(self.vec, &N) )
* return toInt(N) # <<<<<<<<<<<<<<
*
* def getLocalSize(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 668, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":665
* return bytes2str(cval)
*
* def getSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt N = 0
* CHKERR( VecGetSize(self.vec, &N) )
*/
/* 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":670
* return toInt(N)
*
* def getLocalSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt n = 0
* CHKERR( VecGetLocalSize(self.vec, &n) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_99getLocalSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_98getLocalSize[] = "Vec.getLocalSize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_99getLocalSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getLocalSize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getLocalSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalSize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_98getLocalSize(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_98getLocalSize(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":671
*
* def getLocalSize(self):
* cdef PetscInt n = 0 # <<<<<<<<<<<<<<
* CHKERR( VecGetLocalSize(self.vec, &n) )
* return toInt(n)
*/
__pyx_v_n = 0;
/* "petsc4py/PETSc/Vec.pyx":672
* def getLocalSize(self):
* 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(40, 672, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":673
* cdef PetscInt n = 0
* CHKERR( VecGetLocalSize(self.vec, &n) )
* return toInt(n) # <<<<<<<<<<<<<<
*
* def getSizes(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 673, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":670
* return toInt(N)
*
* def getLocalSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt n = 0
* CHKERR( VecGetLocalSize(self.vec, &n) )
*/
/* 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":675
* return toInt(n)
*
* def getSizes(self): # <<<<<<<<<<<<<<
* cdef PetscInt n = 0, N = 0
* CHKERR( VecGetLocalSize(self.vec, &n) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_101getSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_100getSizes[] = "Vec.getSizes(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_101getSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getSizes (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSizes", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_100getSizes(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_100getSizes(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":676
*
* def getSizes(self):
* 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":677
* def getSizes(self):
* 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(40, 677, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":678
* 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(40, 678, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":679
* CHKERR( VecGetLocalSize(self.vec, &n) )
* CHKERR( VecGetSize(self.vec, &N) )
* return (toInt(n), toInt(N)) # <<<<<<<<<<<<<<
*
* def setBlockSize(self, bsize):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 679, __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(40, 679, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 679, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":675
* return toInt(n)
*
* def getSizes(self): # <<<<<<<<<<<<<<
* cdef PetscInt n = 0, N = 0
* CHKERR( VecGetLocalSize(self.vec, &n) )
*/
/* 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":681
* return (toInt(n), toInt(N))
*
* def setBlockSize(self, bsize): # <<<<<<<<<<<<<<
* cdef PetscInt bs = asInt(bsize)
* CHKERR( VecSetBlockSize(self.vec, bs) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_103setBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_102setBlockSize[] = "Vec.setBlockSize(self, bsize)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_103setBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_bsize = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bsize,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBlockSize") < 0)) __PYX_ERR(40, 681, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_bsize = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBlockSize", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 681, __pyx_L3_error)
__pyx_L3_error:;
__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_102setBlockSize(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_bsize);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_102setBlockSize(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":682
*
* def setBlockSize(self, bsize):
* 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(40, 682, __pyx_L1_error)
__pyx_v_bs = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":683
* def setBlockSize(self, bsize):
* cdef PetscInt bs = asInt(bsize)
* CHKERR( VecSetBlockSize(self.vec, bs) ) # <<<<<<<<<<<<<<
*
* def getBlockSize(self):
*/
__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(40, 683, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":681
* return (toInt(n), toInt(N))
*
* def setBlockSize(self, bsize): # <<<<<<<<<<<<<<
* cdef PetscInt bs = asInt(bsize)
* CHKERR( VecSetBlockSize(self.vec, bs) )
*/
/* 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":685
* CHKERR( VecSetBlockSize(self.vec, bs) )
*
* def getBlockSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt bs=0
* CHKERR( VecGetBlockSize(self.vec, &bs) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_105getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_104getBlockSize[] = "Vec.getBlockSize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_105getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getBlockSize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_104getBlockSize(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_104getBlockSize(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":686
*
* def getBlockSize(self):
* cdef PetscInt bs=0 # <<<<<<<<<<<<<<
* CHKERR( VecGetBlockSize(self.vec, &bs) )
* return toInt(bs)
*/
__pyx_v_bs = 0;
/* "petsc4py/PETSc/Vec.pyx":687
* def getBlockSize(self):
* 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(40, 687, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":688
* cdef PetscInt bs=0
* CHKERR( VecGetBlockSize(self.vec, &bs) )
* return toInt(bs) # <<<<<<<<<<<<<<
*
* def getOwnershipRange(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 688, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":685
* CHKERR( VecSetBlockSize(self.vec, bs) )
*
* def getBlockSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt bs=0
* CHKERR( VecGetBlockSize(self.vec, &bs) )
*/
/* 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":690
* return toInt(bs)
*
* def getOwnershipRange(self): # <<<<<<<<<<<<<<
* cdef PetscInt low=0, high=0
* CHKERR( VecGetOwnershipRange(self.vec, &low, &high) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_107getOwnershipRange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_106getOwnershipRange[] = "Vec.getOwnershipRange(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_107getOwnershipRange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOwnershipRange (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOwnershipRange", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRange", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_106getOwnershipRange(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_106getOwnershipRange(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":691
*
* def getOwnershipRange(self):
* 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":692
* def getOwnershipRange(self):
* 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(40, 692, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":693
* cdef PetscInt low=0, high=0
* CHKERR( VecGetOwnershipRange(self.vec, &low, &high) )
* return (toInt(low), toInt(high)) # <<<<<<<<<<<<<<
*
* def getOwnershipRanges(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 693, __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(40, 693, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 693, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":690
* return toInt(bs)
*
* def getOwnershipRange(self): # <<<<<<<<<<<<<<
* cdef PetscInt low=0, high=0
* CHKERR( VecGetOwnershipRange(self.vec, &low, &high) )
*/
/* 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":695
* return (toInt(low), toInt(high))
*
* def getOwnershipRanges(self): # <<<<<<<<<<<<<<
* cdef const PetscInt *rng = NULL
* CHKERR( VecGetOwnershipRanges(self.vec, &rng) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_109getOwnershipRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_108getOwnershipRanges[] = "Vec.getOwnershipRanges(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_109getOwnershipRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOwnershipRanges (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOwnershipRanges", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRanges", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_108getOwnershipRanges(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_108getOwnershipRanges(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":696
*
* def getOwnershipRanges(self):
* 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":697
* def getOwnershipRanges(self):
* 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(40, 697, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":698
* 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":699
* 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(40, 699, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":700
* 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":701
* 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(40, 701, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":702
* cdef int size = -1
* CHKERR( <PetscErrorCode>MPI_Comm_size(comm, &size) )
* return array_i(size+1, rng) # <<<<<<<<<<<<<<
*
* def createLocalVector(self):
*/
__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(40, 702, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":695
* return (toInt(low), toInt(high))
*
* def getOwnershipRanges(self): # <<<<<<<<<<<<<<
* cdef const PetscInt *rng = NULL
* CHKERR( VecGetOwnershipRanges(self.vec, &rng) )
*/
/* 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":704
* return array_i(size+1, rng)
*
* def createLocalVector(self): # <<<<<<<<<<<<<<
* lvec = Vec()
* CHKERR( VecCreateLocalVector(self.vec, &lvec.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_111createLocalVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_110createLocalVector[] = "Vec.createLocalVector(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_111createLocalVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createLocalVector (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("createLocalVector", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createLocalVector", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_110createLocalVector(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_110createLocalVector(struct PyPetscVecObject *__pyx_v_self) {
struct PyPetscVecObject *__pyx_v_lvec = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createLocalVector", 0);
/* "petsc4py/PETSc/Vec.pyx":705
*
* def createLocalVector(self):
* lvec = Vec() # <<<<<<<<<<<<<<
* CHKERR( VecCreateLocalVector(self.vec, &lvec.vec) )
* return lvec
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 705, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":706
* def createLocalVector(self):
* lvec = Vec()
* CHKERR( VecCreateLocalVector(self.vec, &lvec.vec) ) # <<<<<<<<<<<<<<
* return lvec
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateLocalVector(__pyx_v_self->vec, (&__pyx_v_lvec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 706, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":707
* lvec = Vec()
* CHKERR( VecCreateLocalVector(self.vec, &lvec.vec) )
* return lvec # <<<<<<<<<<<<<<
*
* def getLocalVector(self, Vec lvec, readonly=False):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_lvec));
__pyx_r = ((PyObject *)__pyx_v_lvec);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":704
* return array_i(size+1, rng)
*
* def createLocalVector(self): # <<<<<<<<<<<<<<
* lvec = Vec()
* CHKERR( VecCreateLocalVector(self.vec, &lvec.vec) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.createLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_lvec);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":709
* return lvec
*
* def getLocalVector(self, Vec lvec, readonly=False): # <<<<<<<<<<<<<<
* if readonly:
* CHKERR( VecGetLocalVectorRead(self.vec, lvec.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_113getLocalVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_112getLocalVector[] = "Vec.getLocalVector(self, Vec lvec, readonly=False)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_113getLocalVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_lvec = 0;
PyObject *__pyx_v_readonly = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lvec,&__pyx_n_s_readonly,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_False);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lvec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_readonly);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getLocalVector") < 0)) __PYX_ERR(40, 709, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_lvec = ((struct PyPetscVecObject *)values[0]);
__pyx_v_readonly = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getLocalVector", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 709, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.getLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "lvec", 0))) __PYX_ERR(40, 709, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_112getLocalVector(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_lvec, __pyx_v_readonly);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_112getLocalVector(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":710
*
* def getLocalVector(self, Vec lvec, readonly=False):
* 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(40, 710, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":711
* def getLocalVector(self, Vec lvec, readonly=False):
* 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(40, 711, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":710
*
* def getLocalVector(self, Vec lvec, readonly=False):
* if readonly: # <<<<<<<<<<<<<<
* CHKERR( VecGetLocalVectorRead(self.vec, lvec.vec) )
* else:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Vec.pyx":713
* CHKERR( VecGetLocalVectorRead(self.vec, lvec.vec) )
* else:
* CHKERR( VecGetLocalVector(self.vec, lvec.vec) ) # <<<<<<<<<<<<<<
*
* def restoreLocalVector(self, Vec lvec, readonly=False):
*/
/*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(40, 713, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/Vec.pyx":709
* return lvec
*
* def getLocalVector(self, Vec lvec, readonly=False): # <<<<<<<<<<<<<<
* if readonly:
* CHKERR( VecGetLocalVectorRead(self.vec, lvec.vec) )
*/
/* 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":715
* CHKERR( VecGetLocalVector(self.vec, lvec.vec) )
*
* def restoreLocalVector(self, Vec lvec, readonly=False): # <<<<<<<<<<<<<<
* if readonly:
* CHKERR( VecRestoreLocalVectorRead(self.vec, lvec.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_115restoreLocalVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_114restoreLocalVector[] = "Vec.restoreLocalVector(self, Vec lvec, readonly=False)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_115restoreLocalVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_lvec = 0;
PyObject *__pyx_v_readonly = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lvec,&__pyx_n_s_readonly,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_False);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lvec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_readonly);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restoreLocalVector") < 0)) __PYX_ERR(40, 715, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_lvec = ((struct PyPetscVecObject *)values[0]);
__pyx_v_readonly = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("restoreLocalVector", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 715, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "lvec", 0))) __PYX_ERR(40, 715, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_114restoreLocalVector(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_lvec, __pyx_v_readonly);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_114restoreLocalVector(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":716
*
* def restoreLocalVector(self, Vec lvec, readonly=False):
* 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(40, 716, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":717
* def restoreLocalVector(self, Vec lvec, readonly=False):
* 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(40, 717, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":716
*
* def restoreLocalVector(self, Vec lvec, readonly=False):
* if readonly: # <<<<<<<<<<<<<<
* CHKERR( VecRestoreLocalVectorRead(self.vec, lvec.vec) )
* else:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Vec.pyx":719
* CHKERR( VecRestoreLocalVectorRead(self.vec, lvec.vec) )
* else:
* CHKERR( VecRestoreLocalVector(self.vec, lvec.vec) ) # <<<<<<<<<<<<<<
*
* def getBuffer(self, readonly=False):
*/
/*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(40, 719, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/Vec.pyx":715
* CHKERR( VecGetLocalVector(self.vec, lvec.vec) )
*
* def restoreLocalVector(self, Vec lvec, readonly=False): # <<<<<<<<<<<<<<
* if readonly:
* CHKERR( VecRestoreLocalVectorRead(self.vec, lvec.vec) )
*/
/* 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":721
* CHKERR( VecRestoreLocalVector(self.vec, lvec.vec) )
*
* def getBuffer(self, readonly=False): # <<<<<<<<<<<<<<
* if readonly:
* return vec_getbuffer_r(self)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_117getBuffer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_116getBuffer[] = "Vec.getBuffer(self, readonly=False)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_117getBuffer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_readonly = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_readonly,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_False);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_readonly);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getBuffer") < 0)) __PYX_ERR(40, 721, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_readonly = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getBuffer", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 721, __pyx_L3_error)
__pyx_L3_error:;
__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_116getBuffer(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_readonly);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_116getBuffer(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":722
*
* def getBuffer(self, readonly=False):
* 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(40, 722, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":723
* def getBuffer(self, readonly=False):
* 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(40, 723, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":722
*
* def getBuffer(self, readonly=False):
* if readonly: # <<<<<<<<<<<<<<
* return vec_getbuffer_r(self)
* else:
*/
}
/* "petsc4py/PETSc/Vec.pyx":725
* return vec_getbuffer_r(self)
* else:
* return vec_getbuffer_w(self) # <<<<<<<<<<<<<<
*
* def getArray(self, readonly=False):
*/
/*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(40, 725, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Vec.pyx":721
* CHKERR( VecRestoreLocalVector(self.vec, lvec.vec) )
*
* def getBuffer(self, readonly=False): # <<<<<<<<<<<<<<
* if readonly:
* return vec_getbuffer_r(self)
*/
/* 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":727
* return vec_getbuffer_w(self)
*
* def getArray(self, readonly=False): # <<<<<<<<<<<<<<
* if readonly:
* return vec_getarray_r(self)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_119getArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_118getArray[] = "Vec.getArray(self, readonly=False)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_119getArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_readonly = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_readonly,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_False);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_readonly);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getArray") < 0)) __PYX_ERR(40, 727, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_readonly = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getArray", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 727, __pyx_L3_error)
__pyx_L3_error:;
__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_118getArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_readonly);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_118getArray(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":728
*
* def getArray(self, readonly=False):
* 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(40, 728, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":729
* def getArray(self, readonly=False):
* 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(40, 729, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":728
*
* def getArray(self, readonly=False):
* if readonly: # <<<<<<<<<<<<<<
* return vec_getarray_r(self)
* else:
*/
}
/* "petsc4py/PETSc/Vec.pyx":731
* return vec_getarray_r(self)
* else:
* return vec_getarray_w(self) # <<<<<<<<<<<<<<
*
* def setArray(self, array):
*/
/*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(40, 731, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Vec.pyx":727
* return vec_getbuffer_w(self)
*
* def getArray(self, readonly=False): # <<<<<<<<<<<<<<
* if readonly:
* return vec_getarray_r(self)
*/
/* 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":733
* return vec_getarray_w(self)
*
* def setArray(self, array): # <<<<<<<<<<<<<<
* vec_setarray(self, array)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_121setArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_120setArray[] = "Vec.setArray(self, array)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_121setArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_array = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setArray") < 0)) __PYX_ERR(40, 733, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_array = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setArray", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 733, __pyx_L3_error)
__pyx_L3_error:;
__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_120setArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_array);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_120setArray(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":734
*
* def setArray(self, array):
* vec_setarray(self, array) # <<<<<<<<<<<<<<
*
* def placeArray(self, array):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vec_setarray(__pyx_v_self, __pyx_v_array); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 734, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":733
* return vec_getarray_w(self)
*
* def setArray(self, array): # <<<<<<<<<<<<<<
* vec_setarray(self, array)
*
*/
/* 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":736
* vec_setarray(self, array)
*
* def placeArray(self, array): # <<<<<<<<<<<<<<
* cdef PetscInt nv=0
* cdef PetscInt na=0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_123placeArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_122placeArray[] = "Vec.placeArray(self, array)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_123placeArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_array = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "placeArray") < 0)) __PYX_ERR(40, 736, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_array = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("placeArray", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 736, __pyx_L3_error)
__pyx_L3_error:;
__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_122placeArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_array);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_122placeArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array) {
PetscInt __pyx_v_nv;
PetscInt __pyx_v_na;
PetscScalar *__pyx_v_a;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("placeArray", 0);
__Pyx_INCREF(__pyx_v_array);
/* "petsc4py/PETSc/Vec.pyx":737
*
* def placeArray(self, array):
* cdef PetscInt nv=0 # <<<<<<<<<<<<<<
* cdef PetscInt na=0
* cdef PetscScalar *a = NULL
*/
__pyx_v_nv = 0;
/* "petsc4py/PETSc/Vec.pyx":738
* def placeArray(self, array):
* 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":739
* 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":740
* 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(40, 740, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":741
* 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(40, 741, __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":742
* 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) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/Vec.pyx":744
* if (na != nv): raise ValueError(
* "cannot place input array size %d, vector size %d" %
* (toInt(na), toInt(nv))) # <<<<<<<<<<<<<<
* CHKERR( VecPlaceArray(self.vec, a) )
* self.set_attr('__placed_array__', array)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 744, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 744, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 744, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
__pyx_t_2 = 0;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Vec.pyx":743
* array = oarray_s(array, &na, &a)
* if (na != nv): raise ValueError(
* "cannot place input array size %d, vector size %d" % # <<<<<<<<<<<<<<
* (toInt(na), toInt(nv)))
* CHKERR( VecPlaceArray(self.vec, a) )
*/
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_cannot_place_input_array_size_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 743, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/Vec.pyx":742
* CHKERR( VecGetLocalSize(self.vec, &nv) )
* array = oarray_s(array, &na, &a)
* if (na != nv): raise ValueError( # <<<<<<<<<<<<<<
* "cannot place input array size %d, vector size %d" %
* (toInt(na), toInt(nv)))
*/
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 742, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(40, 742, __pyx_L1_error)
}
/* "petsc4py/PETSc/Vec.pyx":745
* "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(40, 745, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":746
* (toInt(na), toInt(nv)))
* CHKERR( VecPlaceArray(self.vec, a) )
* self.set_attr('__placed_array__', array) # <<<<<<<<<<<<<<
*
* def resetArray(self, force=False):
*/
__pyx_t_5 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__placed_array__"), __pyx_v_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 746, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/Vec.pyx":736
* vec_setarray(self, array)
*
* def placeArray(self, array): # <<<<<<<<<<<<<<
* cdef PetscInt nv=0
* cdef PetscInt na=0
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.placeArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_array);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":748
* self.set_attr('__placed_array__', array)
*
* def resetArray(self, force=False): # <<<<<<<<<<<<<<
* cdef object array = None
* array = self.get_attr('__placed_array__')
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_125resetArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_124resetArray[] = "Vec.resetArray(self, force=False)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_125resetArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_force = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_force,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_False);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_force);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resetArray") < 0)) __PYX_ERR(40, 748, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_force = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("resetArray", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 748, __pyx_L3_error)
__pyx_L3_error:;
__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_124resetArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_force);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_124resetArray(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":749
*
* def resetArray(self, force=False):
* 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":750
* def resetArray(self, force=False):
* 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(40, 750, __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":751
* 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);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
} else {
__pyx_t_2 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(40, 751, __pyx_L1_error)
__pyx_t_3 = ((!__pyx_t_4) != 0);
__pyx_t_2 = __pyx_t_3;
__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":752
* 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(40, 752, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":753
* 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(40, 753, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":754
* CHKERR( VecResetArray(self.vec) )
* self.set_attr('__placed_array__', None)
* return array # <<<<<<<<<<<<<<
*
* def bindToCPU(self, flg):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_array);
__pyx_r = __pyx_v_array;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":748
* self.set_attr('__placed_array__', array)
*
* def resetArray(self, force=False): # <<<<<<<<<<<<<<
* cdef object array = None
* array = self.get_attr('__placed_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":756
* return array
*
* def bindToCPU(self, flg): # <<<<<<<<<<<<<<
* """
* If *flg* is *True*, all subsequent operations of *self* would be
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_127bindToCPU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_126bindToCPU[] = "Vec.bindToCPU(self, flg)\n\n If *flg* is *True*, all subsequent operations of *self* would be\n performed on CPU. If *flg* is *False*, all subsequent operations of\n *self* would be offloaded to the device, provided that the VecType is\n capable of offloading.\n\n :arg flg: An instance of :class:`bool`.\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_127bindToCPU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flg = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flg,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flg)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bindToCPU") < 0)) __PYX_ERR(40, 756, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flg = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("bindToCPU", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 756, __pyx_L3_error)
__pyx_L3_error:;
__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_126bindToCPU(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_flg);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_126bindToCPU(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":765
* :arg flg: An instance of :class:`bool`.
* """
* 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(40, 765, __pyx_L1_error)
__pyx_v_bindFlg = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":766
* """
* cdef PetscBool bindFlg = asBool(flg)
* CHKERR( VecBindToCPU(self.vec, bindFlg) ) # <<<<<<<<<<<<<<
*
* def boundToCPU(self):
*/
__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(40, 766, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":756
* return array
*
* def bindToCPU(self, flg): # <<<<<<<<<<<<<<
* """
* If *flg* is *True*, all subsequent operations of *self* would be
*/
/* 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":768
* CHKERR( VecBindToCPU(self.vec, bindFlg) )
*
* def boundToCPU(self): # <<<<<<<<<<<<<<
* cdef PetscBool flg = PETSC_TRUE
* CHKERR( VecBoundToCPU(self.vec, &flg) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_129boundToCPU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_128boundToCPU[] = "Vec.boundToCPU(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_129boundToCPU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("boundToCPU (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("boundToCPU", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "boundToCPU", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_128boundToCPU(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_128boundToCPU(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":769
*
* def boundToCPU(self):
* cdef PetscBool flg = PETSC_TRUE # <<<<<<<<<<<<<<
* CHKERR( VecBoundToCPU(self.vec, &flg) )
* return toBool(flg)
*/
__pyx_v_flg = PETSC_TRUE;
/* "petsc4py/PETSc/Vec.pyx":770
* def boundToCPU(self):
* 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(40, 770, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":771
* cdef PetscBool flg = PETSC_TRUE
* CHKERR( VecBoundToCPU(self.vec, &flg) )
* return toBool(flg) # <<<<<<<<<<<<<<
*
* def getCUDAHandle(self, mode='rw'):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flg); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 771, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":768
* CHKERR( VecBindToCPU(self.vec, bindFlg) )
*
* def boundToCPU(self): # <<<<<<<<<<<<<<
* cdef PetscBool flg = PETSC_TRUE
* CHKERR( VecBoundToCPU(self.vec, &flg) )
*/
/* 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":773
* return toBool(flg)
*
* def getCUDAHandle(self, mode='rw'): # <<<<<<<<<<<<<<
* cdef PetscScalar *hdl = NULL
* cdef const char *m = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_131getCUDAHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_130getCUDAHandle[] = "Vec.getCUDAHandle(self, mode='rw')";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_131getCUDAHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)__pyx_n_s_rw);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getCUDAHandle") < 0)) __PYX_ERR(40, 773, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mode = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getCUDAHandle", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 773, __pyx_L3_error)
__pyx_L3_error:;
__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_130getCUDAHandle(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_130getCUDAHandle(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;
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("getCUDAHandle", 0);
__Pyx_INCREF(__pyx_v_mode);
/* "petsc4py/PETSc/Vec.pyx":774
*
* def getCUDAHandle(self, mode='rw'):
* 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":775
* def getCUDAHandle(self, mode='rw'):
* 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":776
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
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(40, 776, __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":777
* 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_1 = ((__pyx_v_m == NULL) != 0);
if (!__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_1 = (((__pyx_v_m[0]) == 'r') != 0);
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_1 = (((__pyx_v_m[1]) == 'w') != 0);
__pyx_t_2 = __pyx_t_1;
__pyx_L5_bool_binop_done:;
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":778
* 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(40, 778, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":777
* 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":779
* 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_2 = (((__pyx_v_m[0]) == 'r') != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":780
* 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(40, 780, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":779
* 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":781
* 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_2 = (((__pyx_v_m[0]) == 'w') != 0);
if (likely(__pyx_t_2)) {
/* "petsc4py/PETSc/Vec.pyx":782
* 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(40, 782, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":781
* 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":784
* CHKERR( VecCUDAGetArrayWrite(self.vec, &hdl) )
* else:
* raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") # <<<<<<<<<<<<<<
* return <Py_uintptr_t>hdl
*
*/
/*else*/ {
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 784, __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(40, 784, __pyx_L1_error)
}
__pyx_L4:;
/* "petsc4py/PETSc/Vec.pyx":785
* else:
* raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")
* return <Py_uintptr_t>hdl # <<<<<<<<<<<<<<
*
* def restoreCUDAHandle(self, handle, mode='rw'):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_FromSize_t(((Py_uintptr_t)__pyx_v_hdl)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 785, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":773
* return toBool(flg)
*
* def getCUDAHandle(self, mode='rw'): # <<<<<<<<<<<<<<
* cdef PetscScalar *hdl = NULL
* cdef const char *m = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":787
* return <Py_uintptr_t>hdl
*
* def restoreCUDAHandle(self, handle, mode='rw'): # <<<<<<<<<<<<<<
* cdef PetscScalar *hdl = <PetscScalar*>(<Py_uintptr_t>handle)
* cdef const char *m = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_133restoreCUDAHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_132restoreCUDAHandle[] = "Vec.restoreCUDAHandle(self, handle, mode='rw')";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_133restoreCUDAHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_handle = 0;
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_mode,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)__pyx_n_s_rw);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restoreCUDAHandle") < 0)) __PYX_ERR(40, 787, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_handle = values[0];
__pyx_v_mode = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("restoreCUDAHandle", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 787, __pyx_L3_error)
__pyx_L3_error:;
__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_132restoreCUDAHandle(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_handle, __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_132restoreCUDAHandle(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;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PetscErrorCode __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("restoreCUDAHandle", 0);
__Pyx_INCREF(__pyx_v_mode);
/* "petsc4py/PETSc/Vec.pyx":788
*
* def restoreCUDAHandle(self, handle, mode='rw'):
* 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_PyInt_As_size_t(__pyx_v_handle); if (unlikely((__pyx_t_1 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(40, 788, __pyx_L1_error)
__pyx_v_hdl = ((PetscScalar *)((Py_uintptr_t)__pyx_t_1));
/* "petsc4py/PETSc/Vec.pyx":789
* def restoreCUDAHandle(self, handle, mode='rw'):
* 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":790
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mode, (&__pyx_v_m)); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 790, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_4);
__pyx_t_4 = 0;
}
/* "petsc4py/PETSc/Vec.pyx":791
* 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_2 = ((__pyx_v_m == NULL) != 0);
if (!__pyx_t_2) {
} else {
__pyx_t_3 = __pyx_t_2;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_2 = (((__pyx_v_m[0]) == 'r') != 0);
if (__pyx_t_2) {
} else {
__pyx_t_3 = __pyx_t_2;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_2 = (((__pyx_v_m[1]) == 'w') != 0);
__pyx_t_3 = __pyx_t_2;
__pyx_L5_bool_binop_done:;
if (__pyx_t_3) {
/* "petsc4py/PETSc/Vec.pyx":792
* 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(40, 792, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":791
* 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":793
* 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_3 = (((__pyx_v_m[0]) == 'r') != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Vec.pyx":794
* 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(40, 794, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":793
* 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":795
* 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_3 = (((__pyx_v_m[0]) == 'w') != 0);
if (likely(__pyx_t_3)) {
/* "petsc4py/PETSc/Vec.pyx":796
* 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(40, 796, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":795
* 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":798
* CHKERR( VecCUDARestoreArrayWrite(self.vec, &hdl) )
* else:
* raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") # <<<<<<<<<<<<<<
*
* def getHIPHandle(self, mode='rw'):
*/
/*else*/ {
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 798, __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(40, 798, __pyx_L1_error)
}
__pyx_L4:;
/* "petsc4py/PETSc/Vec.pyx":787
* return <Py_uintptr_t>hdl
*
* def restoreCUDAHandle(self, handle, mode='rw'): # <<<<<<<<<<<<<<
* cdef PetscScalar *hdl = <PetscScalar*>(<Py_uintptr_t>handle)
* cdef const char *m = NULL
*/
/* 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.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":800
* raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")
*
* def getHIPHandle(self, mode='rw'): # <<<<<<<<<<<<<<
* cdef PetscScalar *hdl = NULL
* cdef const char *m = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_135getHIPHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_134getHIPHandle[] = "Vec.getHIPHandle(self, mode='rw')";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_135getHIPHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)__pyx_n_s_rw);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getHIPHandle") < 0)) __PYX_ERR(40, 800, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mode = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getHIPHandle", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 800, __pyx_L3_error)
__pyx_L3_error:;
__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_134getHIPHandle(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_134getHIPHandle(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;
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("getHIPHandle", 0);
__Pyx_INCREF(__pyx_v_mode);
/* "petsc4py/PETSc/Vec.pyx":801
*
* def getHIPHandle(self, mode='rw'):
* 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":802
* def getHIPHandle(self, mode='rw'):
* 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":803
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
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(40, 803, __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":804
* 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_1 = ((__pyx_v_m == NULL) != 0);
if (!__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_1 = (((__pyx_v_m[0]) == 'r') != 0);
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_1 = (((__pyx_v_m[1]) == 'w') != 0);
__pyx_t_2 = __pyx_t_1;
__pyx_L5_bool_binop_done:;
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":805
* 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(40, 805, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":804
* 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":806
* 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_2 = (((__pyx_v_m[0]) == 'r') != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":807
* 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(40, 807, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":806
* 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":808
* 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_2 = (((__pyx_v_m[0]) == 'w') != 0);
if (likely(__pyx_t_2)) {
/* "petsc4py/PETSc/Vec.pyx":809
* 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(40, 809, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":808
* 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":811
* CHKERR( VecHIPGetArrayWrite(self.vec, &hdl) )
* else:
* raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") # <<<<<<<<<<<<<<
* return <Py_uintptr_t>hdl
*
*/
/*else*/ {
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 811, __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(40, 811, __pyx_L1_error)
}
__pyx_L4:;
/* "petsc4py/PETSc/Vec.pyx":812
* else:
* raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")
* return <Py_uintptr_t>hdl # <<<<<<<<<<<<<<
*
* def restoreHIPHandle(self, handle, mode='rw'):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_FromSize_t(((Py_uintptr_t)__pyx_v_hdl)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 812, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":800
* raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")
*
* def getHIPHandle(self, mode='rw'): # <<<<<<<<<<<<<<
* cdef PetscScalar *hdl = NULL
* cdef const char *m = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":814
* return <Py_uintptr_t>hdl
*
* def restoreHIPHandle(self, handle, mode='rw'): # <<<<<<<<<<<<<<
* cdef PetscScalar *hdl = <PetscScalar*>(<Py_uintptr_t>handle)
* cdef const char *m = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_137restoreHIPHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_136restoreHIPHandle[] = "Vec.restoreHIPHandle(self, handle, mode='rw')";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_137restoreHIPHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_handle = 0;
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_mode,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)__pyx_n_s_rw);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restoreHIPHandle") < 0)) __PYX_ERR(40, 814, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_handle = values[0];
__pyx_v_mode = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("restoreHIPHandle", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 814, __pyx_L3_error)
__pyx_L3_error:;
__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_136restoreHIPHandle(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_handle, __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_136restoreHIPHandle(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;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PetscErrorCode __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("restoreHIPHandle", 0);
__Pyx_INCREF(__pyx_v_mode);
/* "petsc4py/PETSc/Vec.pyx":815
*
* def restoreHIPHandle(self, handle, mode='rw'):
* 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_PyInt_As_size_t(__pyx_v_handle); if (unlikely((__pyx_t_1 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(40, 815, __pyx_L1_error)
__pyx_v_hdl = ((PetscScalar *)((Py_uintptr_t)__pyx_t_1));
/* "petsc4py/PETSc/Vec.pyx":816
* def restoreHIPHandle(self, handle, mode='rw'):
* 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":817
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mode, (&__pyx_v_m)); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 817, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_4);
__pyx_t_4 = 0;
}
/* "petsc4py/PETSc/Vec.pyx":818
* 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_2 = ((__pyx_v_m == NULL) != 0);
if (!__pyx_t_2) {
} else {
__pyx_t_3 = __pyx_t_2;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_2 = (((__pyx_v_m[0]) == 'r') != 0);
if (__pyx_t_2) {
} else {
__pyx_t_3 = __pyx_t_2;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_2 = (((__pyx_v_m[1]) == 'w') != 0);
__pyx_t_3 = __pyx_t_2;
__pyx_L5_bool_binop_done:;
if (__pyx_t_3) {
/* "petsc4py/PETSc/Vec.pyx":819
* 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(40, 819, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":818
* 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":820
* 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_3 = (((__pyx_v_m[0]) == 'r') != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Vec.pyx":821
* 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(40, 821, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":820
* 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":822
* 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_3 = (((__pyx_v_m[0]) == 'w') != 0);
if (likely(__pyx_t_3)) {
/* "petsc4py/PETSc/Vec.pyx":823
* 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(40, 823, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":822
* 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":825
* CHKERR( VecHIPRestoreArrayWrite(self.vec, &hdl) )
* else:
* raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") # <<<<<<<<<<<<<<
*
* def getOffloadMask(self):
*/
/*else*/ {
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 825, __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(40, 825, __pyx_L1_error)
}
__pyx_L4:;
/* "petsc4py/PETSc/Vec.pyx":814
* return <Py_uintptr_t>hdl
*
* def restoreHIPHandle(self, handle, mode='rw'): # <<<<<<<<<<<<<<
* cdef PetscScalar *hdl = <PetscScalar*>(<Py_uintptr_t>handle)
* cdef const char *m = NULL
*/
/* 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.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":827
* raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")
*
* def getOffloadMask(self): # <<<<<<<<<<<<<<
* """
* Returns :class:`int` of the Vec's PetscOffloadMask enum value.
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_139getOffloadMask(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_138getOffloadMask[] = "Vec.getOffloadMask(self)\n\n Returns :class:`int` of the Vec's PetscOffloadMask enum value.\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_139getOffloadMask(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOffloadMask (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOffloadMask", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOffloadMask", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_138getOffloadMask(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_138getOffloadMask(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":832
* """
* cdef PetscOffloadMask mask
* CHKERR( VecGetOffloadMask(self.vec, &mask) ) # <<<<<<<<<<<<<<
* return mask
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetOffloadMask(__pyx_v_self->vec, (&__pyx_v_mask))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 832, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":833
* cdef PetscOffloadMask mask
* CHKERR( VecGetOffloadMask(self.vec, &mask) )
* return mask # <<<<<<<<<<<<<<
*
* def getCLContextHandle(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_PetscOffloadMask(__pyx_v_mask); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 833, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":827
* raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")
*
* def getOffloadMask(self): # <<<<<<<<<<<<<<
* """
* Returns :class:`int` of the Vec's PetscOffloadMask enum value.
*/
/* 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":835
* return mask
*
* def getCLContextHandle(self): # <<<<<<<<<<<<<<
* """
* Returns a Vec's CL Context as :class:`int`.
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_141getCLContextHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_140getCLContextHandle[] = "Vec.getCLContextHandle(self)\n\n Returns a Vec's CL Context as :class:`int`.\n\n To interface with :mod:`pyopencl` refer\n :meth:`pyopencl.Context.from_int_ptr`\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_141getCLContextHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getCLContextHandle (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getCLContextHandle", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCLContextHandle", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_140getCLContextHandle(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_140getCLContextHandle(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":842
* :meth:`pyopencl.Context.from_int_ptr`
* """
* cdef Py_uintptr_t ctxhdl = 0 # <<<<<<<<<<<<<<
* CHKERR( VecViennaCLGetCLContext(self.vec, &ctxhdl) )
* return ctxhdl
*/
__pyx_v_ctxhdl = 0;
/* "petsc4py/PETSc/Vec.pyx":843
* """
* 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(40, 843, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":844
* cdef Py_uintptr_t ctxhdl = 0
* CHKERR( VecViennaCLGetCLContext(self.vec, &ctxhdl) )
* return ctxhdl # <<<<<<<<<<<<<<
*
* def getCLQueueHandle(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_ctxhdl); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":835
* return mask
*
* def getCLContextHandle(self): # <<<<<<<<<<<<<<
* """
* Returns a Vec's CL Context as :class:`int`.
*/
/* 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":846
* return ctxhdl
*
* def getCLQueueHandle(self): # <<<<<<<<<<<<<<
* """
* Returns a Vec's CL Context as :class:`int`.
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_143getCLQueueHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_142getCLQueueHandle[] = "Vec.getCLQueueHandle(self)\n\n Returns a Vec's CL Context as :class:`int`.\n\n To interface with :mod:`pyopencl` refer\n :meth:`pyopencl.Context.from_int_ptr`\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_143getCLQueueHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getCLQueueHandle (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getCLQueueHandle", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCLQueueHandle", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_142getCLQueueHandle(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_142getCLQueueHandle(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":853
* :meth:`pyopencl.Context.from_int_ptr`
* """
* cdef Py_uintptr_t queuehdl = 0 # <<<<<<<<<<<<<<
* CHKERR( VecViennaCLGetCLQueue(self.vec, &queuehdl) )
* return queuehdl
*/
__pyx_v_queuehdl = 0;
/* "petsc4py/PETSc/Vec.pyx":854
* """
* 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(40, 854, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":855
* cdef Py_uintptr_t queuehdl = 0
* CHKERR( VecViennaCLGetCLQueue(self.vec, &queuehdl) )
* return queuehdl # <<<<<<<<<<<<<<
*
* def getCLMemHandle(self, mode='rw'):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_queuehdl); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 855, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":846
* return ctxhdl
*
* def getCLQueueHandle(self): # <<<<<<<<<<<<<<
* """
* Returns a Vec's CL Context as :class:`int`.
*/
/* 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":857
* return queuehdl
*
* def getCLMemHandle(self, mode='rw'): # <<<<<<<<<<<<<<
* """
* Returns a Vec's CL buffer as :class:`int`.
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_145getCLMemHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_144getCLMemHandle[] = "Vec.getCLMemHandle(self, mode='rw')\n\n Returns a Vec's CL buffer as :class:`int`.\n\n To interface with :mod:`pyopencl` refer\n :meth:`pyopencl.MemoryObject.from_int_ptr`.\n\n :arg mode: An instance of class:`str` denoting the intended access\n usage to the CL buffer. Can be one of 'r'(read-only), 'w'\n (write-only) or 'rw' (read-write). See also\n :meth:`Vec.restoreCLMemHandle`.\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_145getCLMemHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)__pyx_n_s_rw);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getCLMemHandle") < 0)) __PYX_ERR(40, 857, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mode = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getCLMemHandle", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 857, __pyx_L3_error)
__pyx_L3_error:;
__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_144getCLMemHandle(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_144getCLMemHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode) {
Py_uintptr_t __pyx_v_memhdl;
char const *__pyx_v_m;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getCLMemHandle", 0);
__Pyx_INCREF(__pyx_v_mode);
/* "petsc4py/PETSc/Vec.pyx":869
* :meth:`Vec.restoreCLMemHandle`.
* """
* cdef Py_uintptr_t memhdl = 0 # <<<<<<<<<<<<<<
* cdef const char *m = NULL
* mode = str2bytes(mode, &m)
*/
__pyx_v_memhdl = 0;
/* "petsc4py/PETSc/Vec.pyx":870
* """
* 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":871
* 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(40, 871, __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":872
* 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) != 0);
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') != 0);
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') != 0);
__pyx_t_2 = __pyx_t_3;
__pyx_L4_bool_binop_done:;
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":873
* 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(40, 873, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":872
* 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":874
* 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') != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":875
* 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(40, 875, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":874
* 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":876
* 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') != 0);
if (likely(__pyx_t_2)) {
/* "petsc4py/PETSc/Vec.pyx":877
* 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(40, 877, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":876
* 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":879
* CHKERR( VecViennaCLGetCLMemWrite(self.vec, &memhdl) )
* else:
* raise ValueError("Invalid mode: expected 'r', 'w' or 'rw'") # <<<<<<<<<<<<<<
* return memhdl
*
*/
/*else*/ {
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 879, __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(40, 879, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/Vec.pyx":880
* else:
* raise ValueError("Invalid mode: expected 'r', 'w' or 'rw'")
* return memhdl # <<<<<<<<<<<<<<
*
* def restoreCLMemHandle(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_memhdl); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 880, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":857
* return queuehdl
*
* def getCLMemHandle(self, mode='rw'): # <<<<<<<<<<<<<<
* """
* Returns a Vec's CL buffer as :class:`int`.
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.getCLMemHandle", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_mode);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":882
* return memhdl
*
* def restoreCLMemHandle(self): # <<<<<<<<<<<<<<
* """
* To be called after accessing a Vec's cl_mem in 'w' or 'rw' modes.
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_147restoreCLMemHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_146restoreCLMemHandle[] = "Vec.restoreCLMemHandle(self)\n\n To be called after accessing a Vec's cl_mem in 'w' or 'rw' modes.\n See also :meth:`Vec.getCLMemHandle`.\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_147restoreCLMemHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("restoreCLMemHandle (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("restoreCLMemHandle", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "restoreCLMemHandle", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_146restoreCLMemHandle(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_146restoreCLMemHandle(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":887
* See also :meth:`Vec.getCLMemHandle`.
* """
* CHKERR( VecViennaCLRestoreCLMemWrite(self.vec) ) # <<<<<<<<<<<<<<
*
* def duplicate(self, array=None):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecViennaCLRestoreCLMemWrite(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 887, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":882
* return memhdl
*
* def restoreCLMemHandle(self): # <<<<<<<<<<<<<<
* """
* To be called after accessing a Vec's cl_mem in 'w' or 'rw' modes.
*/
/* 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":889
* CHKERR( VecViennaCLRestoreCLMemWrite(self.vec) )
*
* def duplicate(self, array=None): # <<<<<<<<<<<<<<
* cdef Vec vec = type(self)()
* CHKERR( VecDuplicate(self.vec, &vec.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_149duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_148duplicate[] = "Vec.duplicate(self, array=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_149duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_array = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "duplicate") < 0)) __PYX_ERR(40, 889, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_array = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("duplicate", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 889, __pyx_L3_error)
__pyx_L3_error:;
__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_148duplicate(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_array);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_148duplicate(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;
PetscErrorCode __pyx_t_4;
int __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":890
*
* def duplicate(self, array=None):
* cdef Vec vec = type(self)() # <<<<<<<<<<<<<<
* CHKERR( VecDuplicate(self.vec, &vec.vec) )
* # duplicate tensor context
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 890, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(40, 890, __pyx_L1_error)
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":891
* def duplicate(self, array=None):
* cdef Vec vec = type(self)()
* CHKERR( VecDuplicate(self.vec, &vec.vec) ) # <<<<<<<<<<<<<<
* # duplicate tensor context
* cdef object ctx0 = self.get_attr('__dltensor_ctx__')
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_self->vec, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 891, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":893
* 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(40, 893, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ctx0 = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":894
* # 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_5 = (__pyx_v_ctx0 != Py_None);
__pyx_t_6 = (__pyx_t_5 != 0);
if (__pyx_t_6) {
/* "petsc4py/PETSc/Vec.pyx":895
* 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(40, 895, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":894
* # 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":896
* 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);
__pyx_t_5 = (__pyx_t_6 != 0);
if (__pyx_t_5) {
/* "petsc4py/PETSc/Vec.pyx":897
* 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(40, 897, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":896
* 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":898
* if array is not None:
* vec_setarray(vec, array)
* return vec # <<<<<<<<<<<<<<
*
* def copy(self, Vec result=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_vec));
__pyx_r = ((PyObject *)__pyx_v_vec);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":889
* CHKERR( VecViennaCLRestoreCLMemWrite(self.vec) )
*
* def duplicate(self, array=None): # <<<<<<<<<<<<<<
* 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.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":900
* return vec
*
* def copy(self, Vec result=None): # <<<<<<<<<<<<<<
* if result is None:
* result = type(self)()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_151copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_150copy[] = "Vec.copy(self, Vec result=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_151copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_result = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy") < 0)) __PYX_ERR(40, 900, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_result = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("copy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 900, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(40, 900, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_150copy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_result);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_150copy(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result) {
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;
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":901
*
* def copy(self, Vec result=None):
* if result is None: # <<<<<<<<<<<<<<
* result = type(self)()
* if result.vec == NULL:
*/
__pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":902
* def copy(self, Vec result=None):
* if result is None:
* result = type(self)() # <<<<<<<<<<<<<<
* if result.vec == NULL:
* CHKERR( VecDuplicate(self.vec, &result.vec) )
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 902, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(40, 902, __pyx_L1_error)
__Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_3));
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Vec.pyx":901
*
* def copy(self, Vec result=None):
* if result is None: # <<<<<<<<<<<<<<
* result = type(self)()
* if result.vec == NULL:
*/
}
/* "petsc4py/PETSc/Vec.pyx":903
* 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_2 = ((__pyx_v_result->vec == NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Vec.pyx":904
* 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(40, 904, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":903
* 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":905
* 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(40, 905, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":906
* CHKERR( VecDuplicate(self.vec, &result.vec) )
* CHKERR( VecCopy(self.vec, result.vec) )
* return result # <<<<<<<<<<<<<<
*
* def chop(self, tol):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":900
* return vec
*
* def copy(self, Vec result=None): # <<<<<<<<<<<<<<
* if result is None:
* result = type(self)()
*/
/* 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.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":908
* return result
*
* def chop(self, tol): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(tol)
* CHKERR( VecChop(self.vec, rval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_153chop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_152chop[] = "Vec.chop(self, tol)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_153chop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tol = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chop") < 0)) __PYX_ERR(40, 908, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_tol = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("chop", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 908, __pyx_L3_error)
__pyx_L3_error:;
__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_152chop(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_tol);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_152chop(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":909
*
* def chop(self, tol):
* cdef PetscReal rval = asReal(tol) # <<<<<<<<<<<<<<
* CHKERR( VecChop(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(40, 909, __pyx_L1_error)
__pyx_v_rval = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":910
* def chop(self, tol):
* cdef PetscReal rval = asReal(tol)
* CHKERR( VecChop(self.vec, rval) ) # <<<<<<<<<<<<<<
*
* def load(self, Viewer viewer):
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecChop(__pyx_v_self->vec, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 910, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":908
* return result
*
* def chop(self, tol): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(tol)
* CHKERR( VecChop(self.vec, rval) )
*/
/* 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":912
* CHKERR( VecChop(self.vec, rval) )
*
* def load(self, Viewer viewer): # <<<<<<<<<<<<<<
* cdef MPI_Comm comm = MPI_COMM_NULL
* cdef PetscObject obj = <PetscObject>(viewer.vwr)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_155load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_154load[] = "Vec.load(self, Viewer viewer)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_155load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load") < 0)) __PYX_ERR(40, 912, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 912, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(40, 912, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_154load(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_154load(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":913
*
* def load(self, Viewer viewer):
* 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":914
* def load(self, Viewer viewer):
* 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":915
* 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) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Vec.pyx":916
* 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(40, 916, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":917
* 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(40, 917, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":915
* 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":918
* 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(40, 918, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":919
* CHKERR( VecCreate(comm, &self.vec) )
* CHKERR( VecLoad(self.vec, viewer.vwr) )
* return self # <<<<<<<<<<<<<<
*
* def equal(self, Vec vec):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":912
* CHKERR( VecChop(self.vec, rval) )
*
* def load(self, Viewer viewer): # <<<<<<<<<<<<<<
* cdef MPI_Comm comm = MPI_COMM_NULL
* cdef PetscObject obj = <PetscObject>(viewer.vwr)
*/
/* 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":921
* return self
*
* def equal(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( VecEqual(self.vec, vec.vec, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_157equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_156equal[] = "Vec.equal(self, Vec vec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_157equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(40, 921, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("equal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 921, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.equal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(40, 921, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_156equal(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_156equal(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":922
*
* def equal(self, Vec vec):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( VecEqual(self.vec, vec.vec, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/Vec.pyx":923
* def equal(self, Vec vec):
* 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(40, 923, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":924
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( VecEqual(self.vec, vec.vec, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def dot(self, Vec vec):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 924, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":921
* return self
*
* def equal(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( VecEqual(self.vec, vec.vec, &flag) )
*/
/* 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":926
* return toBool(flag)
*
* def dot(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( VecDot(self.vec, vec.vec, &sval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_159dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_158dot[] = "Vec.dot(self, Vec vec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_159dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dot") < 0)) __PYX_ERR(40, 926, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("dot", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 926, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(40, 926, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_158dot(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_158dot(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":927
*
* def dot(self, Vec vec):
* cdef PetscScalar sval = 0 # <<<<<<<<<<<<<<
* CHKERR( VecDot(self.vec, vec.vec, &sval) )
* return toScalar(sval)
*/
__pyx_v_sval = 0.0;
/* "petsc4py/PETSc/Vec.pyx":928
* def dot(self, Vec vec):
* 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(40, 928, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":929
* cdef PetscScalar sval = 0
* CHKERR( VecDot(self.vec, vec.vec, &sval) )
* return toScalar(sval) # <<<<<<<<<<<<<<
*
* def dotBegin(self, Vec vec):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 929, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":926
* return toBool(flag)
*
* def dot(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( VecDot(self.vec, vec.vec, &sval) )
*/
/* 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":931
* return toScalar(sval)
*
* def dotBegin(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( VecDotBegin(self.vec, vec.vec, &sval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_161dotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_160dotBegin[] = "Vec.dotBegin(self, Vec vec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_161dotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dotBegin") < 0)) __PYX_ERR(40, 931, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("dotBegin", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 931, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.dotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(40, 931, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_160dotBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_160dotBegin(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":932
*
* def dotBegin(self, Vec vec):
* cdef PetscScalar sval = 0 # <<<<<<<<<<<<<<
* CHKERR( VecDotBegin(self.vec, vec.vec, &sval) )
*
*/
__pyx_v_sval = 0.0;
/* "petsc4py/PETSc/Vec.pyx":933
* def dotBegin(self, Vec vec):
* cdef PetscScalar sval = 0
* CHKERR( VecDotBegin(self.vec, vec.vec, &sval) ) # <<<<<<<<<<<<<<
*
* def dotEnd(self, Vec vec):
*/
__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(40, 933, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":931
* return toScalar(sval)
*
* def dotBegin(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( VecDotBegin(self.vec, vec.vec, &sval) )
*/
/* 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":935
* CHKERR( VecDotBegin(self.vec, vec.vec, &sval) )
*
* def dotEnd(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( VecDotEnd(self.vec, vec.vec, &sval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_163dotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_162dotEnd[] = "Vec.dotEnd(self, Vec vec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_163dotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dotEnd") < 0)) __PYX_ERR(40, 935, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("dotEnd", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 935, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.dotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(40, 935, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_162dotEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_162dotEnd(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":936
*
* def dotEnd(self, Vec vec):
* cdef PetscScalar sval = 0 # <<<<<<<<<<<<<<
* CHKERR( VecDotEnd(self.vec, vec.vec, &sval) )
* return toScalar(sval)
*/
__pyx_v_sval = 0.0;
/* "petsc4py/PETSc/Vec.pyx":937
* def dotEnd(self, Vec vec):
* 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(40, 937, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":938
* cdef PetscScalar sval = 0
* CHKERR( VecDotEnd(self.vec, vec.vec, &sval) )
* return toScalar(sval) # <<<<<<<<<<<<<<
*
* def tDot(self, Vec vec):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 938, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":935
* CHKERR( VecDotBegin(self.vec, vec.vec, &sval) )
*
* def dotEnd(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( VecDotEnd(self.vec, vec.vec, &sval) )
*/
/* 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":940
* return toScalar(sval)
*
* def tDot(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( VecTDot(self.vec, vec.vec, &sval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_165tDot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_164tDot[] = "Vec.tDot(self, Vec vec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_165tDot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tDot") < 0)) __PYX_ERR(40, 940, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("tDot", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 940, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.tDot", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(40, 940, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_164tDot(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_164tDot(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":941
*
* def tDot(self, Vec vec):
* cdef PetscScalar sval = 0 # <<<<<<<<<<<<<<
* CHKERR( VecTDot(self.vec, vec.vec, &sval) )
* return toScalar(sval)
*/
__pyx_v_sval = 0.0;
/* "petsc4py/PETSc/Vec.pyx":942
* def tDot(self, Vec vec):
* 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(40, 942, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":943
* cdef PetscScalar sval = 0
* CHKERR( VecTDot(self.vec, vec.vec, &sval) )
* return toScalar(sval) # <<<<<<<<<<<<<<
*
* def tDotBegin(self, Vec vec):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 943, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":940
* return toScalar(sval)
*
* def tDot(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( VecTDot(self.vec, vec.vec, &sval) )
*/
/* 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":945
* return toScalar(sval)
*
* def tDotBegin(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_167tDotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_166tDotBegin[] = "Vec.tDotBegin(self, Vec vec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_167tDotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tDotBegin") < 0)) __PYX_ERR(40, 945, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("tDotBegin", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 945, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.tDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(40, 945, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_166tDotBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_166tDotBegin(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":946
*
* def tDotBegin(self, Vec vec):
* cdef PetscScalar sval = 0 # <<<<<<<<<<<<<<
* CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) )
*
*/
__pyx_v_sval = 0.0;
/* "petsc4py/PETSc/Vec.pyx":947
* def tDotBegin(self, Vec vec):
* cdef PetscScalar sval = 0
* CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) ) # <<<<<<<<<<<<<<
*
* def tDotEnd(self, Vec vec):
*/
__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(40, 947, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":945
* return toScalar(sval)
*
* def tDotBegin(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) )
*/
/* 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":949
* CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) )
*
* def tDotEnd(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( VecTDotEnd(self.vec, vec.vec, &sval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_169tDotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_168tDotEnd[] = "Vec.tDotEnd(self, Vec vec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_169tDotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tDotEnd") < 0)) __PYX_ERR(40, 949, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("tDotEnd", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 949, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.tDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(40, 949, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_168tDotEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_168tDotEnd(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":950
*
* def tDotEnd(self, Vec vec):
* cdef PetscScalar sval = 0 # <<<<<<<<<<<<<<
* CHKERR( VecTDotEnd(self.vec, vec.vec, &sval) )
* return toScalar(sval)
*/
__pyx_v_sval = 0.0;
/* "petsc4py/PETSc/Vec.pyx":951
* def tDotEnd(self, Vec vec):
* 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(40, 951, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":952
* cdef PetscScalar sval = 0
* CHKERR( VecTDotEnd(self.vec, vec.vec, &sval) )
* return toScalar(sval) # <<<<<<<<<<<<<<
*
* def mDot(self, vecs, out=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 952, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":949
* CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) )
*
* def tDotEnd(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( VecTDotEnd(self.vec, vec.vec, &sval) )
*/
/* 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":954
* return toScalar(sval)
*
* def mDot(self, vecs, out=None): # <<<<<<<<<<<<<<
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_171mDot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_170mDot[] = "Vec.mDot(self, vecs, out=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_171mDot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vecs = 0;
PyObject *__pyx_v_out = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mDot") < 0)) __PYX_ERR(40, 954, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_vecs = values[0];
__pyx_v_out = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("mDot", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 954, __pyx_L3_error)
__pyx_L3_error:;
__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_170mDot(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_170mDot(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mDot", 0);
/* "petsc4py/PETSc/Vec.pyx":955
*
* def mDot(self, vecs, out=None):
* <void>self; <void>vecs; <void>out; # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
*
*/
((void)__pyx_v_self);
((void)__pyx_v_vecs);
((void)__pyx_v_out);
/* "petsc4py/PETSc/Vec.pyx":956
* def mDot(self, vecs, out=None):
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
*
* def mDotBegin(self, vecs, out=None):
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(40, 956, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":954
* return toScalar(sval)
*
* def mDot(self, vecs, out=None): # <<<<<<<<<<<<<<
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.mDot", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":958
* raise NotImplementedError
*
* def mDotBegin(self, vecs, out=None): # <<<<<<<<<<<<<<
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_173mDotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_172mDotBegin[] = "Vec.mDotBegin(self, vecs, out=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_173mDotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vecs = 0;
PyObject *__pyx_v_out = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mDotBegin") < 0)) __PYX_ERR(40, 958, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_vecs = values[0];
__pyx_v_out = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("mDotBegin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 958, __pyx_L3_error)
__pyx_L3_error:;
__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_172mDotBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_172mDotBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mDotBegin", 0);
/* "petsc4py/PETSc/Vec.pyx":959
*
* def mDotBegin(self, vecs, out=None):
* <void>self; <void>vecs; <void>out; # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
*
*/
((void)__pyx_v_self);
((void)__pyx_v_vecs);
((void)__pyx_v_out);
/* "petsc4py/PETSc/Vec.pyx":960
* def mDotBegin(self, vecs, out=None):
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
*
* def mDotEnd(self, vecs, out=None):
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(40, 960, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":958
* raise NotImplementedError
*
* def mDotBegin(self, vecs, out=None): # <<<<<<<<<<<<<<
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.mDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":962
* raise NotImplementedError
*
* def mDotEnd(self, vecs, out=None): # <<<<<<<<<<<<<<
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_175mDotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_174mDotEnd[] = "Vec.mDotEnd(self, vecs, out=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_175mDotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vecs = 0;
PyObject *__pyx_v_out = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mDotEnd") < 0)) __PYX_ERR(40, 962, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_vecs = values[0];
__pyx_v_out = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("mDotEnd", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 962, __pyx_L3_error)
__pyx_L3_error:;
__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_174mDotEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_174mDotEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mDotEnd", 0);
/* "petsc4py/PETSc/Vec.pyx":963
*
* def mDotEnd(self, vecs, out=None):
* <void>self; <void>vecs; <void>out; # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
*
*/
((void)__pyx_v_self);
((void)__pyx_v_vecs);
((void)__pyx_v_out);
/* "petsc4py/PETSc/Vec.pyx":964
* def mDotEnd(self, vecs, out=None):
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
*
* def mtDot(self, vecs, out=None):
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(40, 964, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":962
* raise NotImplementedError
*
* def mDotEnd(self, vecs, out=None): # <<<<<<<<<<<<<<
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.mDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":966
* raise NotImplementedError
*
* def mtDot(self, vecs, out=None): # <<<<<<<<<<<<<<
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_177mtDot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_176mtDot[] = "Vec.mtDot(self, vecs, out=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_177mtDot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vecs = 0;
PyObject *__pyx_v_out = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mtDot") < 0)) __PYX_ERR(40, 966, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_vecs = values[0];
__pyx_v_out = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("mtDot", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 966, __pyx_L3_error)
__pyx_L3_error:;
__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_176mtDot(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_176mtDot(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mtDot", 0);
/* "petsc4py/PETSc/Vec.pyx":967
*
* def mtDot(self, vecs, out=None):
* <void>self; <void>vecs; <void>out; # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
*
*/
((void)__pyx_v_self);
((void)__pyx_v_vecs);
((void)__pyx_v_out);
/* "petsc4py/PETSc/Vec.pyx":968
* def mtDot(self, vecs, out=None):
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
*
* def mtDotBegin(self, vecs, out=None):
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(40, 968, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":966
* raise NotImplementedError
*
* def mtDot(self, vecs, out=None): # <<<<<<<<<<<<<<
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDot", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":970
* raise NotImplementedError
*
* def mtDotBegin(self, vecs, out=None): # <<<<<<<<<<<<<<
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_179mtDotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_178mtDotBegin[] = "Vec.mtDotBegin(self, vecs, out=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_179mtDotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vecs = 0;
PyObject *__pyx_v_out = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mtDotBegin") < 0)) __PYX_ERR(40, 970, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_vecs = values[0];
__pyx_v_out = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("mtDotBegin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 970, __pyx_L3_error)
__pyx_L3_error:;
__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_178mtDotBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_178mtDotBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mtDotBegin", 0);
/* "petsc4py/PETSc/Vec.pyx":971
*
* def mtDotBegin(self, vecs, out=None):
* <void>self; <void>vecs; <void>out; # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
*
*/
((void)__pyx_v_self);
((void)__pyx_v_vecs);
((void)__pyx_v_out);
/* "petsc4py/PETSc/Vec.pyx":972
* def mtDotBegin(self, vecs, out=None):
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
*
* def mtDotEnd(self, vecs, out=None):
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(40, 972, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":970
* raise NotImplementedError
*
* def mtDotBegin(self, vecs, out=None): # <<<<<<<<<<<<<<
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":974
* raise NotImplementedError
*
* def mtDotEnd(self, vecs, out=None): # <<<<<<<<<<<<<<
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_181mtDotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_180mtDotEnd[] = "Vec.mtDotEnd(self, vecs, out=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_181mtDotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vecs = 0;
PyObject *__pyx_v_out = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mtDotEnd") < 0)) __PYX_ERR(40, 974, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_vecs = values[0];
__pyx_v_out = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("mtDotEnd", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 974, __pyx_L3_error)
__pyx_L3_error:;
__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_180mtDotEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_180mtDotEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mtDotEnd", 0);
/* "petsc4py/PETSc/Vec.pyx":975
*
* def mtDotEnd(self, vecs, out=None):
* <void>self; <void>vecs; <void>out; # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
*
*/
((void)__pyx_v_self);
((void)__pyx_v_vecs);
((void)__pyx_v_out);
/* "petsc4py/PETSc/Vec.pyx":976
* def mtDotEnd(self, vecs, out=None):
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
*
* def norm(self, norm_type=None):
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(40, 976, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":974
* raise NotImplementedError
*
* def mtDotEnd(self, vecs, out=None): # <<<<<<<<<<<<<<
* <void>self; <void>vecs; <void>out; # unused
* raise NotImplementedError
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":978
* raise NotImplementedError
*
* def norm(self, norm_type=None): # <<<<<<<<<<<<<<
* cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2
* cdef PetscNormType ntype = PETSC_NORM_2
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_183norm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_182norm[] = "Vec.norm(self, norm_type=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_183norm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_norm_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm_type,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norm_type);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "norm") < 0)) __PYX_ERR(40, 978, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_norm_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("norm", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 978, __pyx_L3_error)
__pyx_L3_error:;
__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_182norm(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_norm_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_182norm(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;
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("norm", 0);
/* "petsc4py/PETSc/Vec.pyx":979
*
* def norm(self, norm_type=None):
* 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":980
* def norm(self, norm_type=None):
* 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":981
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = ((NormType)__Pyx_PyInt_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 981, __pyx_L1_error)
__pyx_v_ntype = __pyx_t_3;
}
/* "petsc4py/PETSc/Vec.pyx":983
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNorm(__pyx_v_self->vec, __pyx_v_ntype, __pyx_v_rval)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 983, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":984
* 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_2 = ((__pyx_v_ntype != __pyx_v_norm_1_2) != 0);
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(40, 984, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Vec.pyx":985
* 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(self, norm_type=None):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 985, __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(40, 985, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 985, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
__pyx_t_5 = 0;
__pyx_t_6 = 0;
__pyx_r = __pyx_t_7;
__pyx_t_7 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Vec.pyx":978
* raise NotImplementedError
*
* def norm(self, norm_type=None): # <<<<<<<<<<<<<<
* cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2
* cdef PetscNormType ntype = PETSC_NORM_2
*/
/* 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.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":987
* else: return (toReal(rval[0]), toReal(rval[1]))
*
* def normBegin(self, norm_type=None): # <<<<<<<<<<<<<<
* cdef PetscNormType ntype = PETSC_NORM_2
* if norm_type is not None: ntype = norm_type
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_185normBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_184normBegin[] = "Vec.normBegin(self, norm_type=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_185normBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_norm_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm_type,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norm_type);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "normBegin") < 0)) __PYX_ERR(40, 987, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_norm_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("normBegin", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 987, __pyx_L3_error)
__pyx_L3_error:;
__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_184normBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_norm_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_184normBegin(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;
int __pyx_t_2;
NormType __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("normBegin", 0);
/* "petsc4py/PETSc/Vec.pyx":988
*
* def normBegin(self, norm_type=None):
* 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":989
* def normBegin(self, norm_type=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = ((NormType)__Pyx_PyInt_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 989, __pyx_L1_error)
__pyx_v_ntype = __pyx_t_3;
}
/* "petsc4py/PETSc/Vec.pyx":991
* if norm_type is not None: ntype = norm_type
* cdef PetscReal dummy[2]
* CHKERR( VecNormBegin(self.vec, ntype, dummy) ) # <<<<<<<<<<<<<<
*
* def normEnd(self, norm_type=None):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNormBegin(__pyx_v_self->vec, __pyx_v_ntype, __pyx_v_dummy)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 991, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":987
* else: return (toReal(rval[0]), toReal(rval[1]))
*
* def normBegin(self, norm_type=None): # <<<<<<<<<<<<<<
* cdef PetscNormType ntype = PETSC_NORM_2
* if norm_type is not None: ntype = norm_type
*/
/* 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":993
* CHKERR( VecNormBegin(self.vec, ntype, dummy) )
*
* def normEnd(self, norm_type=None): # <<<<<<<<<<<<<<
* cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2
* cdef PetscNormType ntype = PETSC_NORM_2
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_187normEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_186normEnd[] = "Vec.normEnd(self, norm_type=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_187normEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_norm_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm_type,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norm_type);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "normEnd") < 0)) __PYX_ERR(40, 993, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_norm_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("normEnd", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 993, __pyx_L3_error)
__pyx_L3_error:;
__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_186normEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_norm_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_186normEnd(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;
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("normEnd", 0);
/* "petsc4py/PETSc/Vec.pyx":994
*
* def normEnd(self, norm_type=None):
* 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":995
* def normEnd(self, norm_type=None):
* 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":996
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = ((NormType)__Pyx_PyInt_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 996, __pyx_L1_error)
__pyx_v_ntype = __pyx_t_3;
}
/* "petsc4py/PETSc/Vec.pyx":998
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNormEnd(__pyx_v_self->vec, __pyx_v_ntype, __pyx_v_rval)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 998, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":999
* 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_2 = ((__pyx_v_ntype != __pyx_v_norm_1_2) != 0);
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(40, 999, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Vec.pyx":1000
* CHKERR( VecNormEnd(self.vec, ntype, rval) )
* if ntype != norm_1_2: return toReal(rval[0])
* else: return (toReal(rval[0]), toReal(rval[1])) # <<<<<<<<<<<<<<
*
* def sum(self):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 1000, __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(40, 1000, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 1000, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
__pyx_t_5 = 0;
__pyx_t_6 = 0;
__pyx_r = __pyx_t_7;
__pyx_t_7 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Vec.pyx":993
* CHKERR( VecNormBegin(self.vec, ntype, dummy) )
*
* def normEnd(self, norm_type=None): # <<<<<<<<<<<<<<
* cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2
* cdef PetscNormType ntype = PETSC_NORM_2
*/
/* 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.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":1002
* else: return (toReal(rval[0]), toReal(rval[1]))
*
* def sum(self): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( VecSum(self.vec, &sval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_189sum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_188sum[] = "Vec.sum(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_189sum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("sum", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sum", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_188sum(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_188sum(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":1003
*
* def sum(self):
* cdef PetscScalar sval = 0 # <<<<<<<<<<<<<<
* CHKERR( VecSum(self.vec, &sval) )
* return toScalar(sval)
*/
__pyx_v_sval = 0.0;
/* "petsc4py/PETSc/Vec.pyx":1004
* def sum(self):
* 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(40, 1004, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1005
* cdef PetscScalar sval = 0
* CHKERR( VecSum(self.vec, &sval) )
* return toScalar(sval) # <<<<<<<<<<<<<<
*
* def min(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1005, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1002
* else: return (toReal(rval[0]), toReal(rval[1]))
*
* def sum(self): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = 0
* CHKERR( VecSum(self.vec, &sval) )
*/
/* 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":1007
* return toScalar(sval)
*
* def min(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* cdef PetscReal rval = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_191min(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_190min[] = "Vec.min(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_191min(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("min (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("min", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "min", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_190min(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_190min(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":1008
*
* def min(self):
* cdef PetscInt ival = 0 # <<<<<<<<<<<<<<
* cdef PetscReal rval = 0
* CHKERR( VecMin(self.vec, &ival, &rval) )
*/
__pyx_v_ival = 0;
/* "petsc4py/PETSc/Vec.pyx":1009
* def min(self):
* 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":1010
* 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(40, 1010, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1011
* cdef PetscReal rval = 0
* CHKERR( VecMin(self.vec, &ival, &rval) )
* return (toInt(ival), toReal(rval)) # <<<<<<<<<<<<<<
*
* def max(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1011, __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(40, 1011, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 1011, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1007
* return toScalar(sval)
*
* def min(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* cdef PetscReal rval = 0
*/
/* 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":1013
* return (toInt(ival), toReal(rval))
*
* def max(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* cdef PetscReal rval = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_193max(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_192max[] = "Vec.max(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_193max(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("max (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("max", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "max", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_192max(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_192max(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":1014
*
* def max(self):
* cdef PetscInt ival = 0 # <<<<<<<<<<<<<<
* cdef PetscReal rval = 0
* CHKERR( VecMax(self.vec, &ival, &rval) )
*/
__pyx_v_ival = 0;
/* "petsc4py/PETSc/Vec.pyx":1015
* def max(self):
* 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":1016
* 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(40, 1016, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1017
* cdef PetscReal rval = 0
* CHKERR( VecMax(self.vec, &ival, &rval) )
* return (toInt(ival), toReal(rval)) # <<<<<<<<<<<<<<
*
* def normalize(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1017, __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(40, 1017, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 1017, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1013
* return (toInt(ival), toReal(rval))
*
* def max(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* cdef PetscReal rval = 0
*/
/* 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":1019
* return (toInt(ival), toReal(rval))
*
* def normalize(self): # <<<<<<<<<<<<<<
* cdef PetscReal rval = 0
* CHKERR( VecNormalize(self.vec, &rval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_195normalize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_194normalize[] = "Vec.normalize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_195normalize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("normalize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("normalize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "normalize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_194normalize(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_194normalize(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":1020
*
* def normalize(self):
* cdef PetscReal rval = 0 # <<<<<<<<<<<<<<
* CHKERR( VecNormalize(self.vec, &rval) )
* return toReal(rval)
*/
__pyx_v_rval = 0.0;
/* "petsc4py/PETSc/Vec.pyx":1021
* def normalize(self):
* 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(40, 1021, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1022
* cdef PetscReal rval = 0
* CHKERR( VecNormalize(self.vec, &rval) )
* return toReal(rval) # <<<<<<<<<<<<<<
*
* def reciprocal(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1022, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1019
* return (toInt(ival), toReal(rval))
*
* def normalize(self): # <<<<<<<<<<<<<<
* cdef PetscReal rval = 0
* CHKERR( VecNormalize(self.vec, &rval) )
*/
/* 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":1024
* return toReal(rval)
*
* def reciprocal(self): # <<<<<<<<<<<<<<
* CHKERR( VecReciprocal(self.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_197reciprocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_196reciprocal[] = "Vec.reciprocal(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_197reciprocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reciprocal (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("reciprocal", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reciprocal", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_196reciprocal(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_196reciprocal(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":1025
*
* def reciprocal(self):
* CHKERR( VecReciprocal(self.vec) ) # <<<<<<<<<<<<<<
*
* def exp(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecReciprocal(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1025, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1024
* return toReal(rval)
*
* def reciprocal(self): # <<<<<<<<<<<<<<
* CHKERR( VecReciprocal(self.vec) )
*
*/
/* 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":1027
* CHKERR( VecReciprocal(self.vec) )
*
* def exp(self): # <<<<<<<<<<<<<<
* CHKERR( VecExp(self.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_199exp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_198exp[] = "Vec.exp(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_199exp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("exp (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("exp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "exp", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_198exp(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_198exp(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":1028
*
* def exp(self):
* CHKERR( VecExp(self.vec) ) # <<<<<<<<<<<<<<
*
* def log(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecExp(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1028, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1027
* CHKERR( VecReciprocal(self.vec) )
*
* def exp(self): # <<<<<<<<<<<<<<
* CHKERR( VecExp(self.vec) )
*
*/
/* 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":1030
* CHKERR( VecExp(self.vec) )
*
* def log(self): # <<<<<<<<<<<<<<
* CHKERR( VecLog(self.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_201log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_200log[] = "Vec.log(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_201log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("log (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("log", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "log", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_200log(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_200log(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":1031
*
* def log(self):
* CHKERR( VecLog(self.vec) ) # <<<<<<<<<<<<<<
*
* def sqrtabs(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecLog(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1031, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1030
* CHKERR( VecExp(self.vec) )
*
* def log(self): # <<<<<<<<<<<<<<
* CHKERR( VecLog(self.vec) )
*
*/
/* 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":1033
* CHKERR( VecLog(self.vec) )
*
* def sqrtabs(self): # <<<<<<<<<<<<<<
* CHKERR( VecSqrtAbs(self.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_203sqrtabs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_202sqrtabs[] = "Vec.sqrtabs(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_203sqrtabs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sqrtabs (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("sqrtabs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sqrtabs", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_202sqrtabs(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_202sqrtabs(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":1034
*
* def sqrtabs(self):
* CHKERR( VecSqrtAbs(self.vec) ) # <<<<<<<<<<<<<<
*
* def abs(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSqrtAbs(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1034, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1033
* CHKERR( VecLog(self.vec) )
*
* def sqrtabs(self): # <<<<<<<<<<<<<<
* CHKERR( VecSqrtAbs(self.vec) )
*
*/
/* 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":1036
* CHKERR( VecSqrtAbs(self.vec) )
*
* def abs(self): # <<<<<<<<<<<<<<
* CHKERR( VecAbs(self.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_205abs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_204abs[] = "Vec.abs(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_205abs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("abs (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("abs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "abs", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_204abs(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_204abs(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":1037
*
* def abs(self):
* CHKERR( VecAbs(self.vec) ) # <<<<<<<<<<<<<<
*
* def conjugate(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAbs(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1037, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1036
* CHKERR( VecSqrtAbs(self.vec) )
*
* def abs(self): # <<<<<<<<<<<<<<
* CHKERR( VecAbs(self.vec) )
*
*/
/* 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":1039
* CHKERR( VecAbs(self.vec) )
*
* def conjugate(self): # <<<<<<<<<<<<<<
* CHKERR( VecConjugate(self.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_207conjugate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_206conjugate[] = "Vec.conjugate(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_207conjugate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("conjugate (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("conjugate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "conjugate", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_206conjugate(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_206conjugate(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":1040
*
* def conjugate(self):
* CHKERR( VecConjugate(self.vec) ) # <<<<<<<<<<<<<<
*
* def setRandom(self, Random random=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(40, 1040, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1039
* CHKERR( VecAbs(self.vec) )
*
* def conjugate(self): # <<<<<<<<<<<<<<
* CHKERR( VecConjugate(self.vec) )
*
*/
/* 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":1042
* CHKERR( VecConjugate(self.vec) )
*
* def setRandom(self, Random random=None): # <<<<<<<<<<<<<<
* cdef PetscRandom rnd = NULL
* if random is not None: rnd = random.rnd
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_209setRandom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_208setRandom[] = "Vec.setRandom(self, Random random=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_209setRandom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscRandomObject *__pyx_v_random = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_random,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscRandomObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_random);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setRandom") < 0)) __PYX_ERR(40, 1042, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_random = ((struct PyPetscRandomObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setRandom", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1042, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.setRandom", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_random), __pyx_ptype_8petsc4py_5PETSc_Random, 1, "random", 0))) __PYX_ERR(40, 1042, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_208setRandom(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_random);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_208setRandom(struct PyPetscVecObject *__pyx_v_self, struct PyPetscRandomObject *__pyx_v_random) {
PetscRandom __pyx_v_rnd;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PetscRandom __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setRandom", 0);
/* "petsc4py/PETSc/Vec.pyx":1043
*
* def setRandom(self, Random random=None):
* 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":1044
* def setRandom(self, Random random=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_random->rnd;
__pyx_v_rnd = __pyx_t_3;
}
/* "petsc4py/PETSc/Vec.pyx":1045
* cdef PetscRandom rnd = NULL
* if random is not None: rnd = random.rnd
* CHKERR( VecSetRandom(self.vec, rnd) ) # <<<<<<<<<<<<<<
*
* def permute(self, IS order, invert=False):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetRandom(__pyx_v_self->vec, __pyx_v_rnd)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1045, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1042
* CHKERR( VecConjugate(self.vec) )
*
* def setRandom(self, Random random=None): # <<<<<<<<<<<<<<
* cdef PetscRandom rnd = NULL
* if random is not None: rnd = random.rnd
*/
/* 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":1047
* CHKERR( VecSetRandom(self.vec, rnd) )
*
* def permute(self, IS order, invert=False): # <<<<<<<<<<<<<<
* cdef PetscBool cinvert = PETSC_FALSE
* if invert: cinvert = PETSC_TRUE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_211permute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_210permute[] = "Vec.permute(self, IS order, invert=False)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_211permute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_order = 0;
PyObject *__pyx_v_invert = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_order,&__pyx_n_s_invert,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_False);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_order)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_invert);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "permute") < 0)) __PYX_ERR(40, 1047, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_order = ((struct PyPetscISObject *)values[0]);
__pyx_v_invert = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("permute", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1047, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.permute", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "order", 0))) __PYX_ERR(40, 1047, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_210permute(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_order, __pyx_v_invert);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_210permute(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":1048
*
* def permute(self, IS order, invert=False):
* 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":1049
* def permute(self, IS order, invert=False):
* 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(40, 1049, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_v_cinvert = PETSC_TRUE;
}
/* "petsc4py/PETSc/Vec.pyx":1050
* cdef PetscBool cinvert = PETSC_FALSE
* if invert: cinvert = PETSC_TRUE
* CHKERR( VecPermute(self.vec, order.iset, cinvert) ) # <<<<<<<<<<<<<<
*
* def zeroEntries(self):
*/
__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(40, 1050, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1047
* CHKERR( VecSetRandom(self.vec, rnd) )
*
* def permute(self, IS order, invert=False): # <<<<<<<<<<<<<<
* cdef PetscBool cinvert = PETSC_FALSE
* if invert: cinvert = PETSC_TRUE
*/
/* 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":1052
* CHKERR( VecPermute(self.vec, order.iset, cinvert) )
*
* def zeroEntries(self): # <<<<<<<<<<<<<<
* CHKERR( VecZeroEntries(self.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_213zeroEntries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_212zeroEntries[] = "Vec.zeroEntries(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_213zeroEntries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("zeroEntries (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("zeroEntries", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "zeroEntries", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_212zeroEntries(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_212zeroEntries(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":1053
*
* def zeroEntries(self):
* CHKERR( VecZeroEntries(self.vec) ) # <<<<<<<<<<<<<<
*
* def set(self, alpha):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecZeroEntries(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1053, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1052
* CHKERR( VecPermute(self.vec, order.iset, cinvert) )
*
* def zeroEntries(self): # <<<<<<<<<<<<<<
* CHKERR( VecZeroEntries(self.vec) )
*
*/
/* 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":1055
* CHKERR( VecZeroEntries(self.vec) )
*
* def set(self, alpha): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecSet(self.vec, sval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_215set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_214set[] = "Vec.set(self, alpha)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_215set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_alpha = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(40, 1055, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_alpha = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("set", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1055, __pyx_L3_error)
__pyx_L3_error:;
__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_214set(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_214set(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":1056
*
* def set(self, alpha):
* cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<<
* CHKERR( VecSet(self.vec, sval) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(40, 1056, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1057
* def set(self, alpha):
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecSet(self.vec, sval) ) # <<<<<<<<<<<<<<
*
* def isset(self, IS idx, alpha):
*/
__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(40, 1057, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1055
* CHKERR( VecZeroEntries(self.vec) )
*
* def set(self, alpha): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecSet(self.vec, sval) )
*/
/* 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":1059
* CHKERR( VecSet(self.vec, sval) )
*
* def isset(self, IS idx, alpha): # <<<<<<<<<<<<<<
* cdef PetscScalar aval = asScalar(alpha)
* CHKERR( VecISSet(self.vec, idx.iset, aval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_217isset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_216isset[] = "Vec.isset(self, IS idx, alpha)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_217isset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_idx = 0;
PyObject *__pyx_v_alpha = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_idx,&__pyx_n_s_alpha,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idx)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("isset", 1, 2, 2, 1); __PYX_ERR(40, 1059, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isset") < 0)) __PYX_ERR(40, 1059, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_idx = ((struct PyPetscISObject *)values[0]);
__pyx_v_alpha = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("isset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1059, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.isset", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_idx), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "idx", 0))) __PYX_ERR(40, 1059, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_216isset(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_idx, __pyx_v_alpha);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_216isset(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":1060
*
* def isset(self, IS idx, alpha):
* cdef PetscScalar aval = asScalar(alpha) # <<<<<<<<<<<<<<
* CHKERR( VecISSet(self.vec, idx.iset, aval) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(40, 1060, __pyx_L1_error)
__pyx_v_aval = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1061
* def isset(self, IS idx, alpha):
* cdef PetscScalar aval = asScalar(alpha)
* CHKERR( VecISSet(self.vec, idx.iset, aval) ) # <<<<<<<<<<<<<<
*
* def scale(self, alpha):
*/
__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(40, 1061, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1059
* CHKERR( VecSet(self.vec, sval) )
*
* def isset(self, IS idx, alpha): # <<<<<<<<<<<<<<
* cdef PetscScalar aval = asScalar(alpha)
* CHKERR( VecISSet(self.vec, idx.iset, aval) )
*/
/* 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":1063
* CHKERR( VecISSet(self.vec, idx.iset, aval) )
*
* def scale(self, alpha): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecScale(self.vec, sval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_219scale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_218scale[] = "Vec.scale(self, alpha)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_219scale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_alpha = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scale") < 0)) __PYX_ERR(40, 1063, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_alpha = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("scale", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1063, __pyx_L3_error)
__pyx_L3_error:;
__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_218scale(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_218scale(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":1064
*
* def scale(self, alpha):
* cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<<
* CHKERR( VecScale(self.vec, sval) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(40, 1064, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1065
* def scale(self, alpha):
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecScale(self.vec, sval) ) # <<<<<<<<<<<<<<
*
* def shift(self, alpha):
*/
__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(40, 1065, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1063
* CHKERR( VecISSet(self.vec, idx.iset, aval) )
*
* def scale(self, alpha): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecScale(self.vec, sval) )
*/
/* 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":1067
* CHKERR( VecScale(self.vec, sval) )
*
* def shift(self, alpha): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecShift(self.vec, sval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_221shift(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_220shift[] = "Vec.shift(self, alpha)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_221shift(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_alpha = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shift") < 0)) __PYX_ERR(40, 1067, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_alpha = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("shift", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1067, __pyx_L3_error)
__pyx_L3_error:;
__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_220shift(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_220shift(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":1068
*
* def shift(self, alpha):
* cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<<
* CHKERR( VecShift(self.vec, sval) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(40, 1068, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1069
* def shift(self, alpha):
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecShift(self.vec, sval) ) # <<<<<<<<<<<<<<
*
* def chop(self, tol):
*/
__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(40, 1069, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1067
* CHKERR( VecScale(self.vec, sval) )
*
* def shift(self, alpha): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecShift(self.vec, sval) )
*/
/* 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":1071
* CHKERR( VecShift(self.vec, sval) )
*
* def chop(self, tol): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(tol)
* CHKERR( VecChop(self.vec, rval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_223chop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_222chop[] = "Vec.chop(self, tol)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_223chop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tol = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chop") < 0)) __PYX_ERR(40, 1071, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_tol = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("chop", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1071, __pyx_L3_error)
__pyx_L3_error:;
__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_222chop(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_tol);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_222chop(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":1072
*
* def chop(self, tol):
* cdef PetscReal rval = asReal(tol) # <<<<<<<<<<<<<<
* CHKERR( VecChop(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(40, 1072, __pyx_L1_error)
__pyx_v_rval = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1073
* def chop(self, tol):
* cdef PetscReal rval = asReal(tol)
* CHKERR( VecChop(self.vec, rval) ) # <<<<<<<<<<<<<<
*
* def swap(self, Vec vec):
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecChop(__pyx_v_self->vec, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1073, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1071
* CHKERR( VecShift(self.vec, sval) )
*
* def chop(self, tol): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(tol)
* CHKERR( VecChop(self.vec, rval) )
*/
/* 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":1075
* CHKERR( VecChop(self.vec, rval) )
*
* def swap(self, Vec vec): # <<<<<<<<<<<<<<
* CHKERR( VecSwap(self.vec, vec.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_225swap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_224swap[] = "Vec.swap(self, Vec vec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_225swap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "swap") < 0)) __PYX_ERR(40, 1075, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("swap", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1075, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.swap", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(40, 1075, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_224swap(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_224swap(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":1076
*
* def swap(self, Vec vec):
* CHKERR( VecSwap(self.vec, vec.vec) ) # <<<<<<<<<<<<<<
*
* def axpy(self, alpha, Vec x):
*/
__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(40, 1076, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1075
* CHKERR( VecChop(self.vec, rval) )
*
* def swap(self, Vec vec): # <<<<<<<<<<<<<<
* CHKERR( VecSwap(self.vec, vec.vec) )
*
*/
/* 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":1078
* CHKERR( VecSwap(self.vec, vec.vec) )
*
* def axpy(self, alpha, Vec x): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecAXPY(self.vec, sval, x.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_227axpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_226axpy[] = "Vec.axpy(self, alpha, Vec x)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_227axpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_alpha = 0;
struct PyPetscVecObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_x,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("axpy", 1, 2, 2, 1); __PYX_ERR(40, 1078, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "axpy") < 0)) __PYX_ERR(40, 1078, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_alpha = values[0];
__pyx_v_x = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("axpy", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1078, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.axpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(40, 1078, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_226axpy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_x);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_226axpy(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":1079
*
* def axpy(self, alpha, Vec x):
* cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<<
* CHKERR( VecAXPY(self.vec, sval, x.vec) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(40, 1079, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1080
* def axpy(self, alpha, Vec x):
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecAXPY(self.vec, sval, x.vec) ) # <<<<<<<<<<<<<<
*
* def isaxpy(self, IS idx, alpha, Vec x):
*/
__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(40, 1080, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1078
* CHKERR( VecSwap(self.vec, vec.vec) )
*
* def axpy(self, alpha, Vec x): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecAXPY(self.vec, sval, x.vec) )
*/
/* 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":1082
* CHKERR( VecAXPY(self.vec, sval, x.vec) )
*
* def isaxpy(self, IS idx, alpha, Vec x): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_229isaxpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_228isaxpy[] = "Vec.isaxpy(self, IS idx, alpha, Vec x)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_229isaxpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_idx = 0;
PyObject *__pyx_v_alpha = 0;
struct PyPetscVecObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_idx,&__pyx_n_s_alpha,&__pyx_n_s_x,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idx)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("isaxpy", 1, 3, 3, 1); __PYX_ERR(40, 1082, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("isaxpy", 1, 3, 3, 2); __PYX_ERR(40, 1082, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isaxpy") < 0)) __PYX_ERR(40, 1082, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_idx = ((struct PyPetscISObject *)values[0]);
__pyx_v_alpha = values[1];
__pyx_v_x = ((struct PyPetscVecObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("isaxpy", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1082, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.isaxpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_idx), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "idx", 0))) __PYX_ERR(40, 1082, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(40, 1082, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_228isaxpy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_idx, __pyx_v_alpha, __pyx_v_x);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_228isaxpy(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":1083
*
* def isaxpy(self, IS idx, alpha, Vec x):
* cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<<
* CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(40, 1083, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1084
* def isaxpy(self, IS idx, alpha, Vec x):
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) ) # <<<<<<<<<<<<<<
*
* def aypx(self, alpha, Vec x):
*/
__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(40, 1084, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1082
* CHKERR( VecAXPY(self.vec, sval, x.vec) )
*
* def isaxpy(self, IS idx, alpha, Vec x): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) )
*/
/* 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":1086
* CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) )
*
* def aypx(self, alpha, Vec x): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecAYPX(self.vec, sval, x.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_231aypx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_230aypx[] = "Vec.aypx(self, alpha, Vec x)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_231aypx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_alpha = 0;
struct PyPetscVecObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_x,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("aypx", 1, 2, 2, 1); __PYX_ERR(40, 1086, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aypx") < 0)) __PYX_ERR(40, 1086, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_alpha = values[0];
__pyx_v_x = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("aypx", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1086, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.aypx", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(40, 1086, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_230aypx(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_x);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_230aypx(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":1087
*
* def aypx(self, alpha, Vec x):
* cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<<
* CHKERR( VecAYPX(self.vec, sval, x.vec) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(40, 1087, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1088
* def aypx(self, alpha, Vec x):
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecAYPX(self.vec, sval, x.vec) ) # <<<<<<<<<<<<<<
*
* def axpby(self, alpha, beta, Vec y):
*/
__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(40, 1088, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1086
* CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) )
*
* def aypx(self, alpha, Vec x): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecAYPX(self.vec, sval, x.vec) )
*/
/* 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":1090
* CHKERR( VecAYPX(self.vec, sval, x.vec) )
*
* def axpby(self, alpha, beta, Vec y): # <<<<<<<<<<<<<<
* cdef PetscScalar sval1 = asScalar(alpha)
* cdef PetscScalar sval2 = asScalar(beta)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_233axpby(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_232axpby[] = "Vec.axpby(self, alpha, beta, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_233axpby(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_alpha = 0;
PyObject *__pyx_v_beta = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_beta,&__pyx_n_s_y,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("axpby", 1, 3, 3, 1); __PYX_ERR(40, 1090, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("axpby", 1, 3, 3, 2); __PYX_ERR(40, 1090, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "axpby") < 0)) __PYX_ERR(40, 1090, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_alpha = values[0];
__pyx_v_beta = values[1];
__pyx_v_y = ((struct PyPetscVecObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("axpby", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1090, __pyx_L3_error)
__pyx_L3_error:;
__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_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(40, 1090, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_232axpby(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_beta, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_232axpby(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, PyObject *__pyx_v_beta, struct PyPetscVecObject *__pyx_v_y) {
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":1091
*
* def axpby(self, alpha, beta, Vec y):
* cdef PetscScalar sval1 = asScalar(alpha) # <<<<<<<<<<<<<<
* cdef PetscScalar sval2 = asScalar(beta)
* CHKERR( VecAXPBY(self.vec, sval1, sval2, y.vec) )
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(40, 1091, __pyx_L1_error)
__pyx_v_sval1 = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1092
* def axpby(self, alpha, beta, Vec y):
* cdef PetscScalar sval1 = asScalar(alpha)
* cdef PetscScalar sval2 = asScalar(beta) # <<<<<<<<<<<<<<
* CHKERR( VecAXPBY(self.vec, sval1, sval2, y.vec) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_beta); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(40, 1092, __pyx_L1_error)
__pyx_v_sval2 = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1093
* cdef PetscScalar sval1 = asScalar(alpha)
* cdef PetscScalar sval2 = asScalar(beta)
* CHKERR( VecAXPBY(self.vec, sval1, sval2, y.vec) ) # <<<<<<<<<<<<<<
*
* def waxpy(self, alpha, Vec x, Vec y):
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPBY(__pyx_v_self->vec, __pyx_v_sval1, __pyx_v_sval2, __pyx_v_y->vec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1093, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1090
* CHKERR( VecAYPX(self.vec, sval, x.vec) )
*
* def axpby(self, alpha, beta, Vec y): # <<<<<<<<<<<<<<
* cdef PetscScalar sval1 = asScalar(alpha)
* cdef PetscScalar sval2 = asScalar(beta)
*/
/* 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":1095
* CHKERR( VecAXPBY(self.vec, sval1, sval2, y.vec) )
*
* def waxpy(self, alpha, Vec x, Vec y): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_235waxpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_234waxpy[] = "Vec.waxpy(self, alpha, Vec x, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_235waxpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_alpha = 0;
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("waxpy", 1, 3, 3, 1); __PYX_ERR(40, 1095, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("waxpy", 1, 3, 3, 2); __PYX_ERR(40, 1095, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "waxpy") < 0)) __PYX_ERR(40, 1095, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_alpha = values[0];
__pyx_v_x = ((struct PyPetscVecObject *)values[1]);
__pyx_v_y = ((struct PyPetscVecObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("waxpy", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1095, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.waxpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(40, 1095, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(40, 1095, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_234waxpy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_x, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_234waxpy(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":1096
*
* def waxpy(self, alpha, Vec x, Vec y):
* cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<<
* CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(40, 1096, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1097
* def waxpy(self, alpha, Vec x, Vec y):
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) ) # <<<<<<<<<<<<<<
*
* def maxpy(self, alphas, vecs):
*/
__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(40, 1097, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1095
* CHKERR( VecAXPBY(self.vec, sval1, sval2, y.vec) )
*
* def waxpy(self, alpha, Vec x, Vec y): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) )
*/
/* 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":1099
* CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) )
*
* def maxpy(self, alphas, vecs): # <<<<<<<<<<<<<<
* cdef PetscInt n = 0
* cdef PetscScalar *a = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_237maxpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_236maxpy[] = "Vec.maxpy(self, alphas, vecs)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_237maxpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_alphas = 0;
PyObject *__pyx_v_vecs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alphas,&__pyx_n_s_vecs,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alphas)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("maxpy", 1, 2, 2, 1); __PYX_ERR(40, 1099, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "maxpy") < 0)) __PYX_ERR(40, 1099, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_alphas = values[0];
__pyx_v_vecs = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("maxpy", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1099, __pyx_L3_error)
__pyx_L3_error:;
__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_236maxpy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alphas, __pyx_v_vecs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_236maxpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alphas, PyObject *__pyx_v_vecs) {
PetscInt __pyx_v_n;
PetscScalar *__pyx_v_a;
Vec *__pyx_v_v;
CYTHON_UNUSED PyObject *__pyx_v_tmp1 = 0;
CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0;
Py_ssize_t __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
PetscInt __pyx_t_4;
Vec __pyx_t_5;
PetscErrorCode __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("maxpy", 0);
/* "petsc4py/PETSc/Vec.pyx":1100
*
* def maxpy(self, alphas, vecs):
* cdef PetscInt n = 0 # <<<<<<<<<<<<<<
* cdef PetscScalar *a = NULL
* cdef PetscVec *v = NULL
*/
__pyx_v_n = 0;
/* "petsc4py/PETSc/Vec.pyx":1101
* def maxpy(self, alphas, vecs):
* cdef PetscInt n = 0
* cdef PetscScalar *a = NULL # <<<<<<<<<<<<<<
* cdef PetscVec *v = NULL
* cdef object tmp1 = iarray_s(alphas, &n, &a)
*/
__pyx_v_a = NULL;
/* "petsc4py/PETSc/Vec.pyx":1102
* cdef PetscInt n = 0
* cdef PetscScalar *a = NULL
* cdef PetscVec *v = NULL # <<<<<<<<<<<<<<
* cdef object tmp1 = iarray_s(alphas, &n, &a)
* cdef object tmp2 = oarray_p(empty_p(n),NULL, <void**>&v)
*/
__pyx_v_v = NULL;
/* "petsc4py/PETSc/Vec.pyx":1103
* cdef PetscScalar *a = NULL
* cdef PetscVec *v = NULL
* cdef object tmp1 = iarray_s(alphas, &n, &a) # <<<<<<<<<<<<<<
* cdef object tmp2 = oarray_p(empty_p(n),NULL, <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(40, 1103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_tmp1 = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":1104
* cdef PetscVec *v = NULL
* cdef object tmp1 = iarray_s(alphas, &n, &a)
* cdef object tmp2 = 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(40, 1104, __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(40, 1104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_tmp2 = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Vec.pyx":1105
* cdef object tmp1 = iarray_s(alphas, &n, &a)
* cdef object tmp2 = 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(40, 1105, __pyx_L1_error)
if (unlikely(!((__pyx_v_n == __pyx_t_3) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(40, 1105, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/Vec.pyx":1106
* cdef object tmp2 = 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":1107
* 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_4 = __pyx_v_n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
/* "petsc4py/PETSc/Vec.pyx":1108
* 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, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(40, 1108, __pyx_L1_error)
__pyx_t_5 = ((struct PyPetscVecObject *)__pyx_t_2)->vec;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
(__pyx_v_v[__pyx_v_i]) = __pyx_t_5;
}
/* "petsc4py/PETSc/Vec.pyx":1109
* 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):
*/
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMAXPY(__pyx_v_self->vec, __pyx_v_n, __pyx_v_a, __pyx_v_v)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1109, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1099
* CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) )
*
* def maxpy(self, alphas, vecs): # <<<<<<<<<<<<<<
* cdef PetscInt n = 0
* cdef PetscScalar *a = NULL
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.maxpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmp1);
__Pyx_XDECREF(__pyx_v_tmp2);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1111
* CHKERR( VecMAXPY(self.vec, n, a, v) )
*
* def pointwiseMult(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( VecPointwiseMult(self.vec, x.vec, y.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_239pointwiseMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_238pointwiseMult[] = "Vec.pointwiseMult(self, Vec x, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_239pointwiseMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("pointwiseMult", 1, 2, 2, 1); __PYX_ERR(40, 1111, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pointwiseMult") < 0)) __PYX_ERR(40, 1111, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_y = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("pointwiseMult", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1111, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMult", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(40, 1111, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(40, 1111, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_238pointwiseMult(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_238pointwiseMult(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":1112
*
* def pointwiseMult(self, Vec x, Vec y):
* CHKERR( VecPointwiseMult(self.vec, x.vec, y.vec) ) # <<<<<<<<<<<<<<
*
* def pointwiseDivide(self, Vec x, Vec y):
*/
__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(40, 1112, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1111
* CHKERR( VecMAXPY(self.vec, n, a, v) )
*
* def pointwiseMult(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( VecPointwiseMult(self.vec, x.vec, y.vec) )
*
*/
/* 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":1114
* CHKERR( VecPointwiseMult(self.vec, x.vec, y.vec) )
*
* def pointwiseDivide(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( VecPointwiseDivide(self.vec, x.vec, y.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_241pointwiseDivide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_240pointwiseDivide[] = "Vec.pointwiseDivide(self, Vec x, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_241pointwiseDivide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("pointwiseDivide", 1, 2, 2, 1); __PYX_ERR(40, 1114, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pointwiseDivide") < 0)) __PYX_ERR(40, 1114, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_y = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("pointwiseDivide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1114, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseDivide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(40, 1114, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(40, 1114, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_240pointwiseDivide(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_240pointwiseDivide(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":1115
*
* def pointwiseDivide(self, Vec x, Vec y):
* CHKERR( VecPointwiseDivide(self.vec, x.vec, y.vec) ) # <<<<<<<<<<<<<<
*
* def pointwiseMin(self, Vec x, Vec y):
*/
__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(40, 1115, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1114
* CHKERR( VecPointwiseMult(self.vec, x.vec, y.vec) )
*
* def pointwiseDivide(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( VecPointwiseDivide(self.vec, x.vec, y.vec) )
*
*/
/* 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":1117
* CHKERR( VecPointwiseDivide(self.vec, x.vec, y.vec) )
*
* def pointwiseMin(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( VecPointwiseMin(self.vec, x.vec, y.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_243pointwiseMin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_242pointwiseMin[] = "Vec.pointwiseMin(self, Vec x, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_243pointwiseMin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("pointwiseMin", 1, 2, 2, 1); __PYX_ERR(40, 1117, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pointwiseMin") < 0)) __PYX_ERR(40, 1117, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_y = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("pointwiseMin", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1117, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(40, 1117, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(40, 1117, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_242pointwiseMin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_242pointwiseMin(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":1118
*
* def pointwiseMin(self, Vec x, Vec y):
* CHKERR( VecPointwiseMin(self.vec, x.vec, y.vec) ) # <<<<<<<<<<<<<<
*
* def pointwiseMax(self, Vec x, Vec y):
*/
__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(40, 1118, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1117
* CHKERR( VecPointwiseDivide(self.vec, x.vec, y.vec) )
*
* def pointwiseMin(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( VecPointwiseMin(self.vec, x.vec, y.vec) )
*
*/
/* 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":1120
* CHKERR( VecPointwiseMin(self.vec, x.vec, y.vec) )
*
* def pointwiseMax(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( VecPointwiseMax(self.vec, x.vec, y.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_245pointwiseMax(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_244pointwiseMax[] = "Vec.pointwiseMax(self, Vec x, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_245pointwiseMax(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("pointwiseMax", 1, 2, 2, 1); __PYX_ERR(40, 1120, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pointwiseMax") < 0)) __PYX_ERR(40, 1120, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_y = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("pointwiseMax", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1120, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMax", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(40, 1120, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(40, 1120, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_244pointwiseMax(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_244pointwiseMax(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":1121
*
* def pointwiseMax(self, Vec x, Vec y):
* CHKERR( VecPointwiseMax(self.vec, x.vec, y.vec) ) # <<<<<<<<<<<<<<
*
* def pointwiseMaxAbs(self, Vec x, Vec y):
*/
__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(40, 1121, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1120
* CHKERR( VecPointwiseMin(self.vec, x.vec, y.vec) )
*
* def pointwiseMax(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( VecPointwiseMax(self.vec, x.vec, y.vec) )
*
*/
/* 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":1123
* CHKERR( VecPointwiseMax(self.vec, x.vec, y.vec) )
*
* def pointwiseMaxAbs(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( VecPointwiseMaxAbs(self.vec, x.vec, y.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_247pointwiseMaxAbs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_246pointwiseMaxAbs[] = "Vec.pointwiseMaxAbs(self, Vec x, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_247pointwiseMaxAbs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("pointwiseMaxAbs", 1, 2, 2, 1); __PYX_ERR(40, 1123, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pointwiseMaxAbs") < 0)) __PYX_ERR(40, 1123, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_y = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("pointwiseMaxAbs", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1123, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMaxAbs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(40, 1123, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(40, 1123, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_246pointwiseMaxAbs(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_246pointwiseMaxAbs(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":1124
*
* def pointwiseMaxAbs(self, Vec x, Vec y):
* CHKERR( VecPointwiseMaxAbs(self.vec, x.vec, y.vec) ) # <<<<<<<<<<<<<<
*
* def maxPointwiseDivide(self, Vec vec):
*/
__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(40, 1124, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1123
* CHKERR( VecPointwiseMax(self.vec, x.vec, y.vec) )
*
* def pointwiseMaxAbs(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( VecPointwiseMaxAbs(self.vec, x.vec, y.vec) )
*
*/
/* 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":1126
* CHKERR( VecPointwiseMaxAbs(self.vec, x.vec, y.vec) )
*
* def maxPointwiseDivide(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscReal rval = 0
* CHKERR( VecMaxPointwiseDivide(self.vec, vec.vec, &rval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_249maxPointwiseDivide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_248maxPointwiseDivide[] = "Vec.maxPointwiseDivide(self, Vec vec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_249maxPointwiseDivide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "maxPointwiseDivide") < 0)) __PYX_ERR(40, 1126, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("maxPointwiseDivide", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1126, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.maxPointwiseDivide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(40, 1126, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_248maxPointwiseDivide(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_248maxPointwiseDivide(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":1127
*
* def maxPointwiseDivide(self, Vec vec):
* cdef PetscReal rval = 0 # <<<<<<<<<<<<<<
* CHKERR( VecMaxPointwiseDivide(self.vec, vec.vec, &rval) )
* return toReal(rval)
*/
__pyx_v_rval = 0.0;
/* "petsc4py/PETSc/Vec.pyx":1128
* def maxPointwiseDivide(self, Vec vec):
* 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(40, 1128, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1129
* cdef PetscReal rval = 0
* CHKERR( VecMaxPointwiseDivide(self.vec, vec.vec, &rval) )
* return toReal(rval) # <<<<<<<<<<<<<<
*
* def getValue(self, index):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1126
* CHKERR( VecPointwiseMaxAbs(self.vec, x.vec, y.vec) )
*
* def maxPointwiseDivide(self, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscReal rval = 0
* CHKERR( VecMaxPointwiseDivide(self.vec, vec.vec, &rval) )
*/
/* 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":1131
* return toReal(rval)
*
* def getValue(self, index): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(index)
* cdef PetscScalar sval = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_251getValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_250getValue[] = "Vec.getValue(self, index)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_251getValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_index = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getValue") < 0)) __PYX_ERR(40, 1131, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_index = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getValue", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1131, __pyx_L3_error)
__pyx_L3_error:;
__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_250getValue(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_index);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_250getValue(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":1132
*
* def getValue(self, index):
* 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(40, 1132, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1133
* def getValue(self, index):
* 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":1134
* 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(40, 1134, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1135
* cdef PetscScalar sval = 0
* CHKERR( VecGetValues(self.vec, 1, &ival, &sval) )
* return toScalar(sval) # <<<<<<<<<<<<<<
*
* def getValues(self, indices, values=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 1135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1131
* return toReal(rval)
*
* def getValue(self, index): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(index)
* cdef PetscScalar sval = 0
*/
/* 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":1137
* return toScalar(sval)
*
* def getValues(self, indices, values=None): # <<<<<<<<<<<<<<
* return vecgetvalues(self.vec, indices, values)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_253getValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_252getValues[] = "Vec.getValues(self, indices, values=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_253getValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_indices = 0;
PyObject *__pyx_v_values = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getValues") < 0)) __PYX_ERR(40, 1137, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_indices = values[0];
__pyx_v_values = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getValues", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1137, __pyx_L3_error)
__pyx_L3_error:;
__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_252getValues(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_252getValues(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":1138
*
* def getValues(self, indices, values=None):
* return vecgetvalues(self.vec, indices, values) # <<<<<<<<<<<<<<
*
* def getValuesStagStencil(self, indices, values=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(40, 1138, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1137
* return toScalar(sval)
*
* def getValues(self, indices, values=None): # <<<<<<<<<<<<<<
* return vecgetvalues(self.vec, indices, values)
*
*/
/* 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":1140
* return vecgetvalues(self.vec, indices, values)
*
* def getValuesStagStencil(self, indices, values=None): # <<<<<<<<<<<<<<
* raise NotImplementedError('getValuesStagStencil not yet implemented in petsc4py')
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_255getValuesStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_254getValuesStagStencil[] = "Vec.getValuesStagStencil(self, indices, values=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_255getValuesStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED PyObject *__pyx_v_indices = 0;
CYTHON_UNUSED PyObject *__pyx_v_values = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getValuesStagStencil") < 0)) __PYX_ERR(40, 1140, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_indices = values[0];
__pyx_v_values = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getValuesStagStencil", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1140, __pyx_L3_error)
__pyx_L3_error:;
__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_254getValuesStagStencil(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_254getValuesStagStencil(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
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getValuesStagStencil", 0);
/* "petsc4py/PETSc/Vec.pyx":1141
*
* def getValuesStagStencil(self, indices, values=None):
* raise NotImplementedError('getValuesStagStencil not yet implemented in petsc4py') # <<<<<<<<<<<<<<
*
* def setValue(self, index, value, addv=None):
*/
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1141, __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(40, 1141, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1140
* return vecgetvalues(self.vec, indices, values)
*
* def getValuesStagStencil(self, indices, values=None): # <<<<<<<<<<<<<<
* raise NotImplementedError('getValuesStagStencil not yet implemented in petsc4py')
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__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":1143
* raise NotImplementedError('getValuesStagStencil not yet implemented in petsc4py')
*
* def setValue(self, index, value, addv=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(index)
* cdef PetscScalar sval = asScalar(value)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_257setValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_256setValue[] = "Vec.setValue(self, index, value, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_257setValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_index = 0;
PyObject *__pyx_v_value = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_value,&__pyx_n_s_addv,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValue", 0, 2, 3, 1); __PYX_ERR(40, 1143, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValue") < 0)) __PYX_ERR(40, 1143, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_index = values[0];
__pyx_v_value = values[1];
__pyx_v_addv = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValue", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1143, __pyx_L3_error)
__pyx_L3_error:;
__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_256setValue(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_index, __pyx_v_value, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_256setValue(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":1144
*
* def setValue(self, index, value, addv=None):
* 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(40, 1144, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1145
* def setValue(self, index, value, addv=None):
* cdef PetscInt ival = asInt(index)
* cdef PetscScalar sval = asScalar(value) # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) )
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_value); if (unlikely(__pyx_t_2 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(40, 1145, __pyx_L1_error)
__pyx_v_sval = __pyx_t_2;
/* "petsc4py/PETSc/Vec.pyx":1146
* 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(40, 1146, __pyx_L1_error)
__pyx_v_caddv = __pyx_t_3;
/* "petsc4py/PETSc/Vec.pyx":1147
* cdef PetscScalar sval = asScalar(value)
* cdef PetscInsertMode caddv = insertmode(addv)
* CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) ) # <<<<<<<<<<<<<<
*
* def setValues(self, indices, values, addv=None):
*/
__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(40, 1147, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1143
* raise NotImplementedError('getValuesStagStencil not yet implemented in petsc4py')
*
* def setValue(self, index, value, addv=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(index)
* cdef PetscScalar sval = asScalar(value)
*/
/* 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":1149
* CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) )
*
* def setValues(self, indices, values, addv=None): # <<<<<<<<<<<<<<
* vecsetvalues(self.vec, indices, values, addv, 0, 0)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_259setValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_258setValues[] = "Vec.setValues(self, indices, values, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_259setValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_indices = 0;
PyObject *__pyx_v_values = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_addv,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValues", 0, 2, 3, 1); __PYX_ERR(40, 1149, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValues") < 0)) __PYX_ERR(40, 1149, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_indices = values[0];
__pyx_v_values = values[1];
__pyx_v_addv = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValues", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1149, __pyx_L3_error)
__pyx_L3_error:;
__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_258setValues(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_258setValues(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":1150
*
* def setValues(self, indices, values, addv=None):
* vecsetvalues(self.vec, indices, values, addv, 0, 0) # <<<<<<<<<<<<<<
*
* def setValuesBlocked(self, indices, values, addv=None):
*/
__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(40, 1150, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1149
* CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) )
*
* def setValues(self, indices, values, addv=None): # <<<<<<<<<<<<<<
* vecsetvalues(self.vec, indices, values, addv, 0, 0)
*
*/
/* 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":1152
* vecsetvalues(self.vec, indices, values, addv, 0, 0)
*
* def setValuesBlocked(self, indices, values, addv=None): # <<<<<<<<<<<<<<
* vecsetvalues(self.vec, indices, values, addv, 1, 0)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_261setValuesBlocked(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_260setValuesBlocked[] = "Vec.setValuesBlocked(self, indices, values, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_261setValuesBlocked(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_indices = 0;
PyObject *__pyx_v_values = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_addv,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 2, 3, 1); __PYX_ERR(40, 1152, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlocked") < 0)) __PYX_ERR(40, 1152, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_indices = values[0];
__pyx_v_values = values[1];
__pyx_v_addv = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1152, __pyx_L3_error)
__pyx_L3_error:;
__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_260setValuesBlocked(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_260setValuesBlocked(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":1153
*
* def setValuesBlocked(self, indices, values, addv=None):
* vecsetvalues(self.vec, indices, values, addv, 1, 0) # <<<<<<<<<<<<<<
*
* def setValuesStagStencil(self, indices, values, addv=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(40, 1153, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1152
* vecsetvalues(self.vec, indices, values, addv, 0, 0)
*
* def setValuesBlocked(self, indices, values, addv=None): # <<<<<<<<<<<<<<
* vecsetvalues(self.vec, indices, values, addv, 1, 0)
*
*/
/* 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":1155
* vecsetvalues(self.vec, indices, values, addv, 1, 0)
*
* def setValuesStagStencil(self, indices, values, addv=None): # <<<<<<<<<<<<<<
* raise NotImplementedError('setValuesStagStencil not yet implemented in petsc4py')
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_263setValuesStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_262setValuesStagStencil[] = "Vec.setValuesStagStencil(self, indices, values, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_263setValuesStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED PyObject *__pyx_v_indices = 0;
CYTHON_UNUSED PyObject *__pyx_v_values = 0;
CYTHON_UNUSED PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_addv,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesStagStencil", 0, 2, 3, 1); __PYX_ERR(40, 1155, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesStagStencil") < 0)) __PYX_ERR(40, 1155, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_indices = values[0];
__pyx_v_values = values[1];
__pyx_v_addv = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesStagStencil", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1155, __pyx_L3_error)
__pyx_L3_error:;
__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_262setValuesStagStencil(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_262setValuesStagStencil(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
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setValuesStagStencil", 0);
/* "petsc4py/PETSc/Vec.pyx":1156
*
* def setValuesStagStencil(self, indices, values, addv=None):
* raise NotImplementedError('setValuesStagStencil not yet implemented in petsc4py') # <<<<<<<<<<<<<<
*
* def setLGMap(self, LGMap lgmap):
*/
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1156, __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(40, 1156, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1155
* vecsetvalues(self.vec, indices, values, addv, 1, 0)
*
* def setValuesStagStencil(self, indices, values, addv=None): # <<<<<<<<<<<<<<
* raise NotImplementedError('setValuesStagStencil not yet implemented in petsc4py')
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__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":1158
* raise NotImplementedError('setValuesStagStencil not yet implemented in petsc4py')
*
* def setLGMap(self, LGMap lgmap): # <<<<<<<<<<<<<<
* CHKERR( VecSetLocalToGlobalMapping(self.vec, lgmap.lgm) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_265setLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_264setLGMap[] = "Vec.setLGMap(self, LGMap lgmap)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_265setLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscLGMapObject *__pyx_v_lgmap = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lgmap,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lgmap)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLGMap") < 0)) __PYX_ERR(40, 1158, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_lgmap = ((struct PyPetscLGMapObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setLGMap", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1158, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.setLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lgmap), __pyx_ptype_8petsc4py_5PETSc_LGMap, 0, "lgmap", 0))) __PYX_ERR(40, 1158, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_264setLGMap(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_lgmap);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_264setLGMap(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":1159
*
* def setLGMap(self, LGMap lgmap):
* CHKERR( VecSetLocalToGlobalMapping(self.vec, lgmap.lgm) ) # <<<<<<<<<<<<<<
*
* def getLGMap(self):
*/
__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(40, 1159, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1158
* raise NotImplementedError('setValuesStagStencil not yet implemented in petsc4py')
*
* def setLGMap(self, LGMap lgmap): # <<<<<<<<<<<<<<
* CHKERR( VecSetLocalToGlobalMapping(self.vec, lgmap.lgm) )
*
*/
/* 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":1161
* CHKERR( VecSetLocalToGlobalMapping(self.vec, lgmap.lgm) )
*
* def getLGMap(self): # <<<<<<<<<<<<<<
* cdef LGMap cmap = LGMap()
* CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_267getLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_266getLGMap[] = "Vec.getLGMap(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_267getLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getLGMap (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getLGMap", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLGMap", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_266getLGMap(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_266getLGMap(struct PyPetscVecObject *__pyx_v_self) {
struct PyPetscLGMapObject *__pyx_v_cmap = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getLGMap", 0);
/* "petsc4py/PETSc/Vec.pyx":1162
*
* def getLGMap(self):
* cdef LGMap cmap = LGMap() # <<<<<<<<<<<<<<
* CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) )
* PetscINCREF(cmap.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_cmap = ((struct PyPetscLGMapObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":1163
* def getLGMap(self):
* cdef LGMap cmap = LGMap()
* CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) ) # <<<<<<<<<<<<<<
* PetscINCREF(cmap.obj)
* return cmap
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalToGlobalMapping(__pyx_v_self->vec, (&__pyx_v_cmap->lgm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1163, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1164
* cdef LGMap cmap = LGMap()
* CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) )
* PetscINCREF(cmap.obj) # <<<<<<<<<<<<<<
* return cmap
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cmap->__pyx_base.obj));
/* "petsc4py/PETSc/Vec.pyx":1165
* CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) )
* PetscINCREF(cmap.obj)
* return cmap # <<<<<<<<<<<<<<
*
* def setValueLocal(self, index, value, addv=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_cmap));
__pyx_r = ((PyObject *)__pyx_v_cmap);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1161
* CHKERR( VecSetLocalToGlobalMapping(self.vec, lgmap.lgm) )
*
* def getLGMap(self): # <<<<<<<<<<<<<<
* cdef LGMap cmap = LGMap()
* CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.getLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_cmap);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1167
* return cmap
*
* def setValueLocal(self, index, value, addv=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(index)
* cdef PetscScalar sval = asScalar(value)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_269setValueLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_268setValueLocal[] = "Vec.setValueLocal(self, index, value, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_269setValueLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_index = 0;
PyObject *__pyx_v_value = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_value,&__pyx_n_s_addv,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 2, 3, 1); __PYX_ERR(40, 1167, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValueLocal") < 0)) __PYX_ERR(40, 1167, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_index = values[0];
__pyx_v_value = values[1];
__pyx_v_addv = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1167, __pyx_L3_error)
__pyx_L3_error:;
__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_268setValueLocal(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_index, __pyx_v_value, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_268setValueLocal(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":1168
*
* def setValueLocal(self, index, value, addv=None):
* 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(40, 1168, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1169
* def setValueLocal(self, index, value, addv=None):
* cdef PetscInt ival = asInt(index)
* cdef PetscScalar sval = asScalar(value) # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) )
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_value); if (unlikely(__pyx_t_2 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(40, 1169, __pyx_L1_error)
__pyx_v_sval = __pyx_t_2;
/* "petsc4py/PETSc/Vec.pyx":1170
* 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(40, 1170, __pyx_L1_error)
__pyx_v_caddv = __pyx_t_3;
/* "petsc4py/PETSc/Vec.pyx":1171
* cdef PetscScalar sval = asScalar(value)
* cdef PetscInsertMode caddv = insertmode(addv)
* CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) ) # <<<<<<<<<<<<<<
*
* def setValuesLocal(self, indices, values, addv=None):
*/
__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(40, 1171, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1167
* return cmap
*
* def setValueLocal(self, index, value, addv=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(index)
* cdef PetscScalar sval = asScalar(value)
*/
/* 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":1173
* CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) )
*
* def setValuesLocal(self, indices, values, addv=None): # <<<<<<<<<<<<<<
* vecsetvalues(self.vec, indices, values, addv, 0, 1)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_271setValuesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_270setValuesLocal[] = "Vec.setValuesLocal(self, indices, values, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_271setValuesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_indices = 0;
PyObject *__pyx_v_values = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_addv,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 2, 3, 1); __PYX_ERR(40, 1173, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesLocal") < 0)) __PYX_ERR(40, 1173, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_indices = values[0];
__pyx_v_values = values[1];
__pyx_v_addv = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1173, __pyx_L3_error)
__pyx_L3_error:;
__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_270setValuesLocal(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_270setValuesLocal(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":1174
*
* def setValuesLocal(self, indices, values, addv=None):
* vecsetvalues(self.vec, indices, values, addv, 0, 1) # <<<<<<<<<<<<<<
*
* def setValuesBlockedLocal(self, indices, values, addv=None):
*/
__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(40, 1174, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1173
* CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) )
*
* def setValuesLocal(self, indices, values, addv=None): # <<<<<<<<<<<<<<
* vecsetvalues(self.vec, indices, values, addv, 0, 1)
*
*/
/* 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":1176
* vecsetvalues(self.vec, indices, values, addv, 0, 1)
*
* def setValuesBlockedLocal(self, indices, values, addv=None): # <<<<<<<<<<<<<<
* vecsetvalues(self.vec, indices, values, addv, 1, 1)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_273setValuesBlockedLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_272setValuesBlockedLocal[] = "Vec.setValuesBlockedLocal(self, indices, values, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_273setValuesBlockedLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_indices = 0;
PyObject *__pyx_v_values = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_addv,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 2, 3, 1); __PYX_ERR(40, 1176, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedLocal") < 0)) __PYX_ERR(40, 1176, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_indices = values[0];
__pyx_v_values = values[1];
__pyx_v_addv = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1176, __pyx_L3_error)
__pyx_L3_error:;
__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_272setValuesBlockedLocal(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_272setValuesBlockedLocal(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":1177
*
* def setValuesBlockedLocal(self, indices, values, addv=None):
* vecsetvalues(self.vec, indices, values, addv, 1, 1) # <<<<<<<<<<<<<<
*
* def assemblyBegin(self):
*/
__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(40, 1177, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1176
* vecsetvalues(self.vec, indices, values, addv, 0, 1)
*
* def setValuesBlockedLocal(self, indices, values, addv=None): # <<<<<<<<<<<<<<
* vecsetvalues(self.vec, indices, values, addv, 1, 1)
*
*/
/* 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":1179
* vecsetvalues(self.vec, indices, values, addv, 1, 1)
*
* def assemblyBegin(self): # <<<<<<<<<<<<<<
* CHKERR( VecAssemblyBegin(self.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_275assemblyBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_274assemblyBegin[] = "Vec.assemblyBegin(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_275assemblyBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("assemblyBegin (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("assemblyBegin", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assemblyBegin", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_274assemblyBegin(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_274assemblyBegin(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":1180
*
* def assemblyBegin(self):
* CHKERR( VecAssemblyBegin(self.vec) ) # <<<<<<<<<<<<<<
*
* def assemblyEnd(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAssemblyBegin(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1180, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1179
* vecsetvalues(self.vec, indices, values, addv, 1, 1)
*
* def assemblyBegin(self): # <<<<<<<<<<<<<<
* CHKERR( VecAssemblyBegin(self.vec) )
*
*/
/* 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":1182
* CHKERR( VecAssemblyBegin(self.vec) )
*
* def assemblyEnd(self): # <<<<<<<<<<<<<<
* CHKERR( VecAssemblyEnd(self.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_277assemblyEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_276assemblyEnd[] = "Vec.assemblyEnd(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_277assemblyEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("assemblyEnd (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("assemblyEnd", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assemblyEnd", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_276assemblyEnd(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_276assemblyEnd(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":1183
*
* def assemblyEnd(self):
* CHKERR( VecAssemblyEnd(self.vec) ) # <<<<<<<<<<<<<<
*
* def assemble(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAssemblyEnd(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1183, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1182
* CHKERR( VecAssemblyBegin(self.vec) )
*
* def assemblyEnd(self): # <<<<<<<<<<<<<<
* CHKERR( VecAssemblyEnd(self.vec) )
*
*/
/* 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":1185
* CHKERR( VecAssemblyEnd(self.vec) )
*
* def assemble(self): # <<<<<<<<<<<<<<
* CHKERR( VecAssemblyBegin(self.vec) )
* CHKERR( VecAssemblyEnd(self.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_279assemble(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_278assemble[] = "Vec.assemble(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_279assemble(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("assemble (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("assemble", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assemble", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_278assemble(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_278assemble(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":1186
*
* def assemble(self):
* 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(40, 1186, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1187
* def assemble(self):
* 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(40, 1187, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1185
* CHKERR( VecAssemblyEnd(self.vec) )
*
* def assemble(self): # <<<<<<<<<<<<<<
* CHKERR( VecAssemblyBegin(self.vec) )
* CHKERR( VecAssemblyEnd(self.vec) )
*/
/* 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":1191
* # --- methods for strided vectors ---
*
* def strideScale(self, field, alpha): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(field)
* cdef PetscScalar sval = asScalar(alpha)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_281strideScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_280strideScale[] = "Vec.strideScale(self, field, alpha)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_281strideScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_field = 0;
PyObject *__pyx_v_alpha = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_alpha,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("strideScale", 1, 2, 2, 1); __PYX_ERR(40, 1191, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strideScale") < 0)) __PYX_ERR(40, 1191, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_field = values[0];
__pyx_v_alpha = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("strideScale", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1191, __pyx_L3_error)
__pyx_L3_error:;
__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_280strideScale(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_alpha);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_280strideScale(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":1192
*
* def strideScale(self, field, alpha):
* 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(40, 1192, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1193
* def strideScale(self, field, alpha):
* cdef PetscInt ival = asInt(field)
* cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<<
* CHKERR( VecStrideScale(self.vec, ival, sval) )
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_2 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(40, 1193, __pyx_L1_error)
__pyx_v_sval = __pyx_t_2;
/* "petsc4py/PETSc/Vec.pyx":1194
* cdef PetscInt ival = asInt(field)
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( VecStrideScale(self.vec, ival, sval) ) # <<<<<<<<<<<<<<
*
* def strideSum(self, field):
*/
__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(40, 1194, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1191
* # --- methods for strided vectors ---
*
* def strideScale(self, field, alpha): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(field)
* cdef PetscScalar sval = asScalar(alpha)
*/
/* 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":1196
* CHKERR( VecStrideScale(self.vec, ival, sval) )
*
* def strideSum(self, field): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(field)
* cdef PetscScalar sval = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_283strideSum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_282strideSum[] = "Vec.strideSum(self, field)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_283strideSum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_field = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strideSum") < 0)) __PYX_ERR(40, 1196, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_field = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("strideSum", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1196, __pyx_L3_error)
__pyx_L3_error:;
__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_282strideSum(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_282strideSum(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":1197
*
* def strideSum(self, field):
* 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(40, 1197, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1198
* def strideSum(self, field):
* 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":1199
* 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(40, 1199, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1200
* cdef PetscScalar sval = 0
* CHKERR( VecStrideSum(self.vec, ival, &sval) )
* return toScalar(sval) # <<<<<<<<<<<<<<
*
* def strideMin(self, field):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 1200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1196
* CHKERR( VecStrideScale(self.vec, ival, sval) )
*
* def strideSum(self, field): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(field)
* cdef PetscScalar sval = 0
*/
/* 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":1202
* return toScalar(sval)
*
* def strideMin(self, field): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = asInt(field)
* cdef PetscInt ival2 = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_285strideMin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_284strideMin[] = "Vec.strideMin(self, field)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_285strideMin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_field = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strideMin") < 0)) __PYX_ERR(40, 1202, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_field = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("strideMin", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1202, __pyx_L3_error)
__pyx_L3_error:;
__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_284strideMin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_284strideMin(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":1203
*
* def strideMin(self, field):
* 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(40, 1203, __pyx_L1_error)
__pyx_v_ival1 = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1204
* def strideMin(self, field):
* 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":1205
* 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":1206
* 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(40, 1206, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1207
* cdef PetscReal rval = 0
* CHKERR( VecStrideMin(self.vec, ival1, &ival2, &rval) )
* return (toInt(ival2), toReal(rval)) # <<<<<<<<<<<<<<
*
* def strideMax(self, field):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival2); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 1207, __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(40, 1207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 1207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1202
* return toScalar(sval)
*
* def strideMin(self, field): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = asInt(field)
* cdef PetscInt ival2 = 0
*/
/* 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":1209
* return (toInt(ival2), toReal(rval))
*
* def strideMax(self, field): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = asInt(field)
* cdef PetscInt ival2 = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_287strideMax(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_286strideMax[] = "Vec.strideMax(self, field)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_287strideMax(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_field = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strideMax") < 0)) __PYX_ERR(40, 1209, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_field = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("strideMax", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1209, __pyx_L3_error)
__pyx_L3_error:;
__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_286strideMax(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_286strideMax(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":1210
*
* def strideMax(self, field):
* 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(40, 1210, __pyx_L1_error)
__pyx_v_ival1 = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1211
* def strideMax(self, field):
* 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":1212
* 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":1213
* 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(40, 1213, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1214
* cdef PetscReal rval = 0
* CHKERR( VecStrideMax(self.vec, ival1, &ival2, &rval) )
* return (toInt(ival2), toReal(rval)) # <<<<<<<<<<<<<<
*
* def strideNorm(self, field, norm_type=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival2); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 1214, __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(40, 1214, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 1214, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1209
* return (toInt(ival2), toReal(rval))
*
* def strideMax(self, field): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = asInt(field)
* cdef PetscInt ival2 = 0
*/
/* 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":1216
* return (toInt(ival2), toReal(rval))
*
* def strideNorm(self, field, norm_type=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(field)
* cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_289strideNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_288strideNorm[] = "Vec.strideNorm(self, field, norm_type=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_289strideNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_field = 0;
PyObject *__pyx_v_norm_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_norm_type,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norm_type);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strideNorm") < 0)) __PYX_ERR(40, 1216, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_field = values[0];
__pyx_v_norm_type = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("strideNorm", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1216, __pyx_L3_error)
__pyx_L3_error:;
__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_288strideNorm(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_norm_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_288strideNorm(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;
int __pyx_t_3;
NormType __pyx_t_4;
PetscErrorCode __pyx_t_5;
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("strideNorm", 0);
/* "petsc4py/PETSc/Vec.pyx":1217
*
* def strideNorm(self, field, norm_type=None):
* 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(40, 1217, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1218
* def strideNorm(self, field, norm_type=None):
* 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":1219
* 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":1220
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_4 = ((NormType)__Pyx_PyInt_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 1220, __pyx_L1_error)
__pyx_v_ntype = __pyx_t_4;
}
/* "petsc4py/PETSc/Vec.pyx":1222
* 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecStrideNorm(__pyx_v_self->vec, __pyx_v_ival, __pyx_v_ntype, __pyx_v_rval)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1222, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1223
* 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_3 = ((__pyx_v_ntype != __pyx_v_norm_1_2) != 0);
if (__pyx_t_3) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(40, 1223, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Vec.pyx":1224
* 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(self, field, Vec vec, addv=None):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(40, 1224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[1])); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 1224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 1224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
__pyx_t_6 = 0;
__pyx_t_7 = 0;
__pyx_r = __pyx_t_8;
__pyx_t_8 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Vec.pyx":1216
* return (toInt(ival2), toReal(rval))
*
* def strideNorm(self, field, norm_type=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(field)
* cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("petsc4py.PETSc.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":1226
* else: return (toReal(rval[0]), toReal(rval[1]))
*
* def strideScatter(self, field, Vec vec, addv=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(field)
* cdef PetscInsertMode caddv = insertmode(addv)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_291strideScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_290strideScatter[] = "Vec.strideScatter(self, field, Vec vec, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_291strideScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_field = 0;
struct PyPetscVecObject *__pyx_v_vec = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_vec,&__pyx_n_s_addv,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("strideScatter", 0, 2, 3, 1); __PYX_ERR(40, 1226, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strideScatter") < 0)) __PYX_ERR(40, 1226, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_field = values[0];
__pyx_v_vec = ((struct PyPetscVecObject *)values[1]);
__pyx_v_addv = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("strideScatter", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1226, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.strideScatter", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(40, 1226, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_290strideScatter(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_vec, __pyx_v_addv);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_290strideScatter(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":1227
*
* def strideScatter(self, field, Vec vec, addv=None):
* 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(40, 1227, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1228
* def strideScatter(self, field, Vec vec, addv=None):
* 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(40, 1228, __pyx_L1_error)
__pyx_v_caddv = __pyx_t_2;
/* "petsc4py/PETSc/Vec.pyx":1229
* cdef PetscInt ival = asInt(field)
* cdef PetscInsertMode caddv = insertmode(addv)
* CHKERR( VecStrideScatter(self.vec, ival, vec.vec, caddv) ) # <<<<<<<<<<<<<<
*
* def strideGather(self, field, Vec vec, addv=None):
*/
__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(40, 1229, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1226
* else: return (toReal(rval[0]), toReal(rval[1]))
*
* def strideScatter(self, field, Vec vec, addv=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(field)
* cdef PetscInsertMode caddv = insertmode(addv)
*/
/* 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":1231
* CHKERR( VecStrideScatter(self.vec, ival, vec.vec, caddv) )
*
* def strideGather(self, field, Vec vec, addv=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(field)
* cdef PetscInsertMode caddv = insertmode(addv)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_293strideGather(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_292strideGather[] = "Vec.strideGather(self, field, Vec vec, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_293strideGather(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_field = 0;
struct PyPetscVecObject *__pyx_v_vec = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_vec,&__pyx_n_s_addv,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("strideGather", 0, 2, 3, 1); __PYX_ERR(40, 1231, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strideGather") < 0)) __PYX_ERR(40, 1231, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_field = values[0];
__pyx_v_vec = ((struct PyPetscVecObject *)values[1]);
__pyx_v_addv = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("strideGather", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1231, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.strideGather", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(40, 1231, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_292strideGather(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_vec, __pyx_v_addv);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_292strideGather(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":1232
*
* def strideGather(self, field, Vec vec, addv=None):
* 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(40, 1232, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1233
* def strideGather(self, field, Vec vec, addv=None):
* 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(40, 1233, __pyx_L1_error)
__pyx_v_caddv = __pyx_t_2;
/* "petsc4py/PETSc/Vec.pyx":1234
* 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(40, 1234, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1231
* CHKERR( VecStrideScatter(self.vec, ival, vec.vec, caddv) )
*
* def strideGather(self, field, Vec vec, addv=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(field)
* cdef PetscInsertMode caddv = insertmode(addv)
*/
/* 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":1238
* # --- methods for vectors with ghost values ---
*
* def localForm(self): # <<<<<<<<<<<<<<
* """
* Intended for use in context manager::
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_295localForm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_294localForm[] = "Vec.localForm(self)\n\n Intended for use in context manager::\n\n with vec.localForm() as lf:\n use(lf)\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_295localForm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("localForm (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("localForm", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "localForm", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_294localForm(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_294localForm(struct PyPetscVecObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("localForm", 0);
/* "petsc4py/PETSc/Vec.pyx":1245
* use(lf)
* """
* return _Vec_LocalForm(self) # <<<<<<<<<<<<<<
*
* def ghostUpdateBegin(self, addv=None, mode=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1238
* # --- methods for vectors with ghost values ---
*
* def localForm(self): # <<<<<<<<<<<<<<
* """
* Intended for use in context manager::
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.localForm", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1247
* return _Vec_LocalForm(self)
*
* def ghostUpdateBegin(self, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_297ghostUpdateBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_296ghostUpdateBegin[] = "Vec.ghostUpdateBegin(self, addv=None, mode=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_297ghostUpdateBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_addv = 0;
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_addv,&__pyx_n_s_mode,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ghostUpdateBegin") < 0)) __PYX_ERR(40, 1247, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_addv = values[0];
__pyx_v_mode = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("ghostUpdateBegin", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1247, __pyx_L3_error)
__pyx_L3_error:;
__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_296ghostUpdateBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_addv, __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_296ghostUpdateBegin(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":1248
*
* def ghostUpdateBegin(self, addv=None, mode=None):
* 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(40, 1248, __pyx_L1_error)
__pyx_v_caddv = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1249
* def ghostUpdateBegin(self, addv=None, mode=None):
* 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(40, 1249, __pyx_L1_error)
__pyx_v_csctm = __pyx_t_2;
/* "petsc4py/PETSc/Vec.pyx":1250
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
* CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) # <<<<<<<<<<<<<<
*
* def ghostUpdateEnd(self, addv=None, mode=None):
*/
__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(40, 1250, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1247
* return _Vec_LocalForm(self)
*
* def ghostUpdateBegin(self, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* 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":1252
* CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) )
*
* def ghostUpdateEnd(self, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_299ghostUpdateEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_298ghostUpdateEnd[] = "Vec.ghostUpdateEnd(self, addv=None, mode=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_299ghostUpdateEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_addv = 0;
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_addv,&__pyx_n_s_mode,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ghostUpdateEnd") < 0)) __PYX_ERR(40, 1252, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_addv = values[0];
__pyx_v_mode = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("ghostUpdateEnd", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1252, __pyx_L3_error)
__pyx_L3_error:;
__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_298ghostUpdateEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_addv, __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_298ghostUpdateEnd(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":1253
*
* def ghostUpdateEnd(self, addv=None, mode=None):
* 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(40, 1253, __pyx_L1_error)
__pyx_v_caddv = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1254
* def ghostUpdateEnd(self, addv=None, mode=None):
* 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(40, 1254, __pyx_L1_error)
__pyx_v_csctm = __pyx_t_2;
/* "petsc4py/PETSc/Vec.pyx":1255
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
* CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) # <<<<<<<<<<<<<<
*
* def ghostUpdate(self, addv=None, mode=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(40, 1255, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1252
* CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) )
*
* def ghostUpdateEnd(self, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* 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":1257
* CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) )
*
* def ghostUpdate(self, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_301ghostUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_300ghostUpdate[] = "Vec.ghostUpdate(self, addv=None, mode=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_301ghostUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_addv = 0;
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_addv,&__pyx_n_s_mode,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ghostUpdate") < 0)) __PYX_ERR(40, 1257, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_addv = values[0];
__pyx_v_mode = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("ghostUpdate", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1257, __pyx_L3_error)
__pyx_L3_error:;
__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_300ghostUpdate(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_addv, __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_300ghostUpdate(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":1258
*
* def ghostUpdate(self, addv=None, mode=None):
* 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(40, 1258, __pyx_L1_error)
__pyx_v_caddv = __pyx_t_1;
/* "petsc4py/PETSc/Vec.pyx":1259
* def ghostUpdate(self, addv=None, mode=None):
* 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(40, 1259, __pyx_L1_error)
__pyx_v_csctm = __pyx_t_2;
/* "petsc4py/PETSc/Vec.pyx":1260
* 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(40, 1260, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1261
* cdef PetscScatterMode csctm = scattermode(mode)
* CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) )
* CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) # <<<<<<<<<<<<<<
*
* def setMPIGhost(self, ghosts):
*/
__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(40, 1261, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1257
* CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) )
*
* def ghostUpdate(self, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* 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":1263
* CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) )
*
* def setMPIGhost(self, ghosts): # <<<<<<<<<<<<<<
* "Alternative to createGhost()"
* cdef PetscInt ng=0, *ig=NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_303setMPIGhost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_302setMPIGhost[] = "Vec.setMPIGhost(self, ghosts)\nAlternative to createGhost()";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_303setMPIGhost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ghosts = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ghosts,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ghosts)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMPIGhost") < 0)) __PYX_ERR(40, 1263, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_ghosts = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMPIGhost", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1263, __pyx_L3_error)
__pyx_L3_error:;
__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_302setMPIGhost(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_ghosts);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_302setMPIGhost(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":1265
* def setMPIGhost(self, ghosts):
* "Alternative to createGhost()"
* 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":1266
* "Alternative to createGhost()"
* 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(40, 1266, __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":1267
* cdef PetscInt ng=0, *ig=NULL
* ghosts = iarray_i(ghosts, &ng, &ig)
* CHKERR( VecMPISetGhost(self.vec, ng, ig) ) # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMPISetGhost(__pyx_v_self->vec, __pyx_v_ng, __pyx_v_ig)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1267, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1263
* CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) )
*
* def setMPIGhost(self, ghosts): # <<<<<<<<<<<<<<
* "Alternative to createGhost()"
* cdef PetscInt ng=0, *ig=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.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":1271
* #
*
* def getSubVector(self, IS iset, Vec subvec=None): # <<<<<<<<<<<<<<
* if subvec is None: subvec = Vec()
* else: CHKERR( VecDestroy(&subvec.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_305getSubVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_304getSubVector[] = "Vec.getSubVector(self, IS iset, Vec subvec=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_305getSubVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_iset = 0;
struct PyPetscVecObject *__pyx_v_subvec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,&__pyx_n_s_subvec,0};
PyObject* values[2] = {0,0};
values[1] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subvec);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getSubVector") < 0)) __PYX_ERR(40, 1271, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_iset = ((struct PyPetscISObject *)values[0]);
__pyx_v_subvec = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getSubVector", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1271, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.getSubVector", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(40, 1271, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "subvec", 0))) __PYX_ERR(40, 1271, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_304getSubVector(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_subvec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_304getSubVector(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;
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("getSubVector", 0);
__Pyx_INCREF((PyObject *)__pyx_v_subvec);
/* "petsc4py/PETSc/Vec.pyx":1272
*
* def getSubVector(self, IS iset, Vec subvec=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 1272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_subvec, ((struct PyPetscVecObject *)__pyx_t_3));
__pyx_t_3 = 0;
goto __pyx_L3;
}
/* "petsc4py/PETSc/Vec.pyx":1273
* def getSubVector(self, IS iset, Vec subvec=None):
* if subvec is None: subvec = Vec()
* else: CHKERR( VecDestroy(&subvec.vec) ) # <<<<<<<<<<<<<<
* CHKERR( VecGetSubVector(self.vec, iset.iset, &subvec.vec) )
* return subvec
*/
/*else*/ {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_subvec->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1273, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/Vec.pyx":1274
* if subvec is None: subvec = Vec()
* else: CHKERR( VecDestroy(&subvec.vec) )
* CHKERR( VecGetSubVector(self.vec, iset.iset, &subvec.vec) ) # <<<<<<<<<<<<<<
* return subvec
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetSubVector(__pyx_v_self->vec, __pyx_v_iset->iset, (&__pyx_v_subvec->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1274, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1275
* else: CHKERR( VecDestroy(&subvec.vec) )
* CHKERR( VecGetSubVector(self.vec, iset.iset, &subvec.vec) )
* return subvec # <<<<<<<<<<<<<<
*
* def restoreSubVector(self, IS iset, Vec subvec):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_subvec));
__pyx_r = ((PyObject *)__pyx_v_subvec);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1271
* #
*
* def getSubVector(self, IS iset, Vec subvec=None): # <<<<<<<<<<<<<<
* if subvec is None: subvec = Vec()
* else: CHKERR( VecDestroy(&subvec.vec) )
*/
/* function exit code */
__pyx_L1_error:;
__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":1277
* return subvec
*
* def restoreSubVector(self, IS iset, Vec subvec): # <<<<<<<<<<<<<<
* CHKERR( VecRestoreSubVector(self.vec, iset.iset, &subvec.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_307restoreSubVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_306restoreSubVector[] = "Vec.restoreSubVector(self, IS iset, Vec subvec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_307restoreSubVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_iset = 0;
struct PyPetscVecObject *__pyx_v_subvec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,&__pyx_n_s_subvec,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subvec)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("restoreSubVector", 1, 2, 2, 1); __PYX_ERR(40, 1277, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restoreSubVector") < 0)) __PYX_ERR(40, 1277, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_iset = ((struct PyPetscISObject *)values[0]);
__pyx_v_subvec = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("restoreSubVector", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1277, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreSubVector", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(40, 1277, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "subvec", 0))) __PYX_ERR(40, 1277, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_306restoreSubVector(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_subvec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_306restoreSubVector(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":1278
*
* def restoreSubVector(self, IS iset, Vec subvec):
* CHKERR( VecRestoreSubVector(self.vec, iset.iset, &subvec.vec) ) # <<<<<<<<<<<<<<
*
* def getNestSubVecs(self):
*/
__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(40, 1278, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1277
* return subvec
*
* def restoreSubVector(self, IS iset, Vec subvec): # <<<<<<<<<<<<<<
* CHKERR( VecRestoreSubVector(self.vec, iset.iset, &subvec.vec) )
*
*/
/* 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":1280
* CHKERR( VecRestoreSubVector(self.vec, iset.iset, &subvec.vec) )
*
* def getNestSubVecs(self): # <<<<<<<<<<<<<<
* cdef PetscInt N=0
* cdef PetscVec* sx=NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_309getNestSubVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_308getNestSubVecs[] = "Vec.getNestSubVecs(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_309getNestSubVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNestSubVecs (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNestSubVecs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNestSubVecs", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_308getNestSubVecs(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_308getNestSubVecs(struct PyPetscVecObject *__pyx_v_self) {
PetscInt __pyx_v_N;
Vec *__pyx_v_sx;
PyObject *__pyx_v_output = NULL;
PetscInt __pyx_v_i;
struct PyPetscVecObject *__pyx_v_pyvec = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscInt __pyx_t_3;
PetscInt __pyx_t_4;
PetscInt __pyx_t_5;
int __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNestSubVecs", 0);
/* "petsc4py/PETSc/Vec.pyx":1281
*
* def getNestSubVecs(self):
* cdef PetscInt N=0 # <<<<<<<<<<<<<<
* cdef PetscVec* sx=NULL
* CHKERR( VecNestGetSubVecs(self.vec, &N, &sx) )
*/
__pyx_v_N = 0;
/* "petsc4py/PETSc/Vec.pyx":1282
* def getNestSubVecs(self):
* cdef PetscInt N=0
* cdef PetscVec* sx=NULL # <<<<<<<<<<<<<<
* CHKERR( VecNestGetSubVecs(self.vec, &N, &sx) )
* output = []
*/
__pyx_v_sx = NULL;
/* "petsc4py/PETSc/Vec.pyx":1283
* 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(40, 1283, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1284
* 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(40, 1284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_output = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Vec.pyx":1285
* 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":1286
* output = []
* for i in range(N):
* pyvec = Vec() # <<<<<<<<<<<<<<
* pyvec.vec = sx[i]
* CHKERR( PetscObjectReference(<PetscObject> pyvec.vec) )
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1286, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_pyvec, ((struct PyPetscVecObject *)__pyx_t_2));
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Vec.pyx":1287
* 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":1288
* 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(40, 1288, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1289
* pyvec.vec = sx[i]
* CHKERR( PetscObjectReference(<PetscObject> pyvec.vec) )
* output.append(pyvec) # <<<<<<<<<<<<<<
*
* return output
*/
__pyx_t_6 = __Pyx_PyList_Append(__pyx_v_output, ((PyObject *)__pyx_v_pyvec)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(40, 1289, __pyx_L1_error)
}
/* "petsc4py/PETSc/Vec.pyx":1291
* output.append(pyvec)
*
* return output # <<<<<<<<<<<<<<
*
* def setNestSubVecs(self, sx, idxm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_output);
__pyx_r = __pyx_v_output;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1280
* CHKERR( VecRestoreSubVector(self.vec, iset.iset, &subvec.vec) )
*
* def getNestSubVecs(self): # <<<<<<<<<<<<<<
* cdef PetscInt N=0
* cdef PetscVec* sx=NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.getNestSubVecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_output);
__Pyx_XDECREF((PyObject *)__pyx_v_pyvec);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1293
* return output
*
* def setNestSubVecs(self, sx, idxm=None): # <<<<<<<<<<<<<<
* if idxm is None: idxm = range(len(sx))
* else: assert len(idxm) == len(sx)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_311setNestSubVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_310setNestSubVecs[] = "Vec.setNestSubVecs(self, sx, idxm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_311setNestSubVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_sx = 0;
PyObject *__pyx_v_idxm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sx,&__pyx_n_s_idxm,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sx)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxm);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNestSubVecs") < 0)) __PYX_ERR(40, 1293, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_sx = values[0];
__pyx_v_idxm = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setNestSubVecs", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1293, __pyx_L3_error)
__pyx_L3_error:;
__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_310setNestSubVecs(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_sx, __pyx_v_idxm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_310setNestSubVecs(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_sx, PyObject *__pyx_v_idxm) {
PetscInt __pyx_v_N;
PetscInt *__pyx_v_cidxm;
Vec *__pyx_v_csx;
CYTHON_UNUSED PyArrayObject *__pyx_v_tmp = NULL;
long __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
Py_ssize_t __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
Py_ssize_t __pyx_t_6;
PetscInt __pyx_t_7;
Vec __pyx_t_8;
PetscErrorCode __pyx_t_9;
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":1294
*
* def setNestSubVecs(self, sx, idxm=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = PyObject_Length(__pyx_v_sx); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(40, 1294, __pyx_L1_error)
__pyx_t_4 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 1294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 1294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_idxm, __pyx_t_5);
__pyx_t_5 = 0;
goto __pyx_L3;
}
/* "petsc4py/PETSc/Vec.pyx":1295
* def setNestSubVecs(self, sx, idxm=None):
* 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_3 = PyObject_Length(__pyx_v_idxm); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(40, 1295, __pyx_L1_error)
__pyx_t_6 = PyObject_Length(__pyx_v_sx); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(40, 1295, __pyx_L1_error)
if (unlikely(!((__pyx_t_3 == __pyx_t_6) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(40, 1295, __pyx_L1_error)
}
}
#endif
}
__pyx_L3:;
/* "petsc4py/PETSc/Vec.pyx":1296
* 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":1297
* 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":1298
* cdef PetscInt N = 0
* cdef PetscInt* cidxm = NULL
* idxm = iarray_i(idxm, &N, &cidxm) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_idxm, (&__pyx_v_N), (&__pyx_v_cidxm))); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 1298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF_SET(__pyx_v_idxm, __pyx_t_5);
__pyx_t_5 = 0;
/* "petsc4py/PETSc/Vec.pyx":1301
*
*
* cdef PetscVec* csx = NULL # <<<<<<<<<<<<<<
* tmp = 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":1302
*
* cdef PetscVec* csx = NULL
* tmp = oarray_p(empty_p(N), NULL, <void**>&csx) # <<<<<<<<<<<<<<
* for i from 0 <= i < N: csx[i] = (<Vec?>sx[i]).vec
*
*/
__pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_N)); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 1302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_5, NULL, ((void **)(&__pyx_v_csx)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 1302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_tmp = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Vec.pyx":1303
* cdef PetscVec* csx = NULL
* tmp = 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_7 = __pyx_v_N;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_sx, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 1303, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(40, 1303, __pyx_L1_error)
__pyx_t_8 = ((struct PyPetscVecObject *)__pyx_t_4)->vec;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
(__pyx_v_csx[__pyx_v_i]) = __pyx_t_8;
}
/* "petsc4py/PETSc/Vec.pyx":1305
* for i from 0 <= i < N: csx[i] = (<Vec?>sx[i]).vec
*
* CHKERR( VecNestSetSubVecs(self.vec, N, cidxm, csx) ) # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNestSetSubVecs(__pyx_v_self->vec, __pyx_v_N, __pyx_v_cidxm, __pyx_v_csx)); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1305, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1293
* return output
*
* def setNestSubVecs(self, sx, idxm=None): # <<<<<<<<<<<<<<
* if idxm is None: idxm = range(len(sx))
* else: assert len(idxm) == len(sx)
*/
/* 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.Vec.setNestSubVecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_tmp);
__Pyx_XDECREF(__pyx_v_idxm);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1309
* #
*
* def setDM(self, DM dm): # <<<<<<<<<<<<<<
* CHKERR( VecSetDM(self.vec, dm.dm) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_313setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_312setDM[] = "Vec.setDM(self, DM dm)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_313setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscDMObject *__pyx_v_dm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDM") < 0)) __PYX_ERR(40, 1309, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_dm = ((struct PyPetscDMObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 1309, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Vec.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(40, 1309, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_312setDM(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_dm);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_312setDM(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":1310
*
* def setDM(self, DM dm):
* CHKERR( VecSetDM(self.vec, dm.dm) ) # <<<<<<<<<<<<<<
*
* def getDM(self):
*/
__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(40, 1310, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1309
* #
*
* def setDM(self, DM dm): # <<<<<<<<<<<<<<
* CHKERR( VecSetDM(self.vec, dm.dm) )
*
*/
/* 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":1312
* CHKERR( VecSetDM(self.vec, dm.dm) )
*
* def getDM(self): # <<<<<<<<<<<<<<
* cdef DM dm = DM()
* CHKERR( VecGetDM(self.vec, &dm.dm) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_315getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Vec_314getDM[] = "Vec.getDM(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_315getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDM (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_314getDM(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_314getDM(struct PyPetscVecObject *__pyx_v_self) {
struct PyPetscDMObject *__pyx_v_dm = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDM", 0);
/* "petsc4py/PETSc/Vec.pyx":1313
*
* def getDM(self):
* cdef DM dm = DM() # <<<<<<<<<<<<<<
* CHKERR( VecGetDM(self.vec, &dm.dm) )
* return dm
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":1314
* def getDM(self):
* cdef DM dm = DM()
* CHKERR( VecGetDM(self.vec, &dm.dm) ) # <<<<<<<<<<<<<<
* return dm
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetDM(__pyx_v_self->vec, (&__pyx_v_dm->dm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 1314, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1315
* cdef DM dm = DM()
* CHKERR( VecGetDM(self.vec, &dm.dm) )
* return dm # <<<<<<<<<<<<<<
*
* #
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_dm));
__pyx_r = ((PyObject *)__pyx_v_dm);
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1312
* CHKERR( VecSetDM(self.vec, dm.dm) )
*
* def getDM(self): # <<<<<<<<<<<<<<
* cdef DM dm = DM()
* CHKERR( VecGetDM(self.vec, &dm.dm) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_dm);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1320
*
* property sizes:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getSizes()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5sizes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5sizes_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_5sizes___get__(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_5sizes___get__(struct PyPetscVecObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Vec.pyx":1321
* property sizes:
* def __get__(self):
* return self.getSizes() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setSizes(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1320
*
* property sizes:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getSizes()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1322
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_5sizes_2__set__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3Vec_5sizes_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Vec.pyx":1323
* return self.getSizes()
* def __set__(self, value):
* self.setSizes(value) # <<<<<<<<<<<<<<
*
* property size:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1323, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":1322
* def __get__(self):
* return self.getSizes()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setSizes(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.sizes.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1326
*
* property size:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_4size___get__(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_4size___get__(struct PyPetscVecObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Vec.pyx":1327
* property size:
* def __get__(self):
* return self.getSize() # <<<<<<<<<<<<<<
*
* property local_size:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1326
*
* property size:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getSize()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1330
*
* property local_size:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_10local_size___get__(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10local_size___get__(struct PyPetscVecObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Vec.pyx":1331
* property local_size:
* def __get__(self):
* return self.getLocalSize() # <<<<<<<<<<<<<<
*
* property block_size:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getLocalSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1331, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1331, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1330
*
* property local_size:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getLocalSize()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.local_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1334
*
* property block_size:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_10block_size___get__(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10block_size___get__(struct PyPetscVecObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Vec.pyx":1335
* property block_size:
* def __get__(self):
* return self.getBlockSize() # <<<<<<<<<<<<<<
*
* property owner_range:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1334
*
* property block_size:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getBlockSize()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.block_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1338
*
* property owner_range:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_11owner_range___get__(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_11owner_range___get__(struct PyPetscVecObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Vec.pyx":1339
* property owner_range:
* def __get__(self):
* return self.getOwnershipRange() # <<<<<<<<<<<<<<
*
* property owner_ranges:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOwnershipRange); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1339, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1339, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1338
*
* property owner_range:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getOwnershipRange()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.owner_range.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1342
*
* property owner_ranges:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_12owner_ranges___get__(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_12owner_ranges___get__(struct PyPetscVecObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Vec.pyx":1343
* property owner_ranges:
* def __get__(self):
* return self.getOwnershipRanges() # <<<<<<<<<<<<<<
*
* property buffer_w:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOwnershipRanges); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1342
*
* property owner_ranges:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getOwnershipRanges()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.owner_ranges.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1347
* property buffer_w:
* "Vec buffer (writable)"
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_w___get__(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_w___get__(struct PyPetscVecObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Vec.pyx":1348
* "Vec buffer (writable)"
* def __get__(self):
* return self.getBuffer() # <<<<<<<<<<<<<<
*
* property buffer_r:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBuffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1347
* property buffer_w:
* "Vec buffer (writable)"
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getBuffer()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.buffer_w.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1352
* property buffer_r:
* "Vec buffer (read-only)"
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_r___get__(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_r___get__(struct PyPetscVecObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Vec.pyx":1353
* "Vec buffer (read-only)"
* def __get__(self):
* return self.getBuffer(True) # <<<<<<<<<<<<<<
*
* property array_w:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBuffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1353, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, Py_True) : __Pyx_PyObject_CallOneArg(__pyx_t_2, Py_True);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1353, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1352
* property buffer_r:
* "Vec buffer (read-only)"
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getBuffer(True)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.buffer_r.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1357
* property array_w:
* "Vec array (writable)"
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getArray()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_7array_w_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_7array_w_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_7array_w___get__(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_7array_w___get__(struct PyPetscVecObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Vec.pyx":1358
* "Vec array (writable)"
* def __get__(self):
* return self.getArray() # <<<<<<<<<<<<<<
* def __set__(self, value):
* cdef buf = self.getBuffer()
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getArray); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1358, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1358, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1357
* property array_w:
* "Vec array (writable)"
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getArray()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.array_w.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1359
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_7array_w_2__set__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3Vec_7array_w_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value) {
PyObject *__pyx_v_buf = 0;
PyObject *__pyx_v_array = NULL;
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
int __pyx_t_10;
int __pyx_t_11;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Vec.pyx":1360
* return self.getArray()
* def __set__(self, value):
* cdef buf = self.getBuffer() # <<<<<<<<<<<<<<
* with buf as array: array[:] = value
*
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBuffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1360, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1360, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_buf = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":1361
* 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_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 1361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_v_buf, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1361, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1361, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __pyx_t_1;
__pyx_t_1 = 0;
/*try:*/ {
{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
/*try:*/ {
__pyx_v_array = __pyx_t_2;
__pyx_t_2 = 0;
if (__Pyx_PyObject_SetSlice(__pyx_v_array, __pyx_v_value, 0, 0, NULL, NULL, &__pyx_slice__40, 0, 0, 1) < 0) __PYX_ERR(40, 1361, __pyx_L7_error)
}
__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;
goto __pyx_L12_try_end;
__pyx_L7_error:;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
/*except:*/ {
__Pyx_AddTraceback("petsc4py.PETSc.Vec.array_w.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(40, 1361, __pyx_L9_except_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(40, 1361, __pyx_L9_except_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_9)) __PYX_ERR(40, 1361, __pyx_L9_except_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (__pyx_t_10 < 0) __PYX_ERR(40, 1361, __pyx_L9_except_error)
__pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0);
if (__pyx_t_11) {
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_3);
__pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0;
__PYX_ERR(40, 1361, __pyx_L9_except_error)
}
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L8_exception_handled;
}
__pyx_L9_except_error:;
__Pyx_XGIVEREF(__pyx_t_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_exception_handled:;
__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);
__pyx_L12_try_end:;
}
}
/*finally:*/ {
/*normal exit:*/{
if (__pyx_t_4) {
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__21, NULL);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 1361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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":1359
* def __get__(self):
* return self.getArray()
* def __set__(self, value): # <<<<<<<<<<<<<<
* cdef buf = self.getBuffer()
* with buf as array: array[:] = value
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_8);
__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":1365
* property array_r:
* "Vec array (read-only)"
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_7array_r___get__(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_7array_r___get__(struct PyPetscVecObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Vec.pyx":1366
* "Vec array (read-only)"
* def __get__(self):
* return self.getArray(True) # <<<<<<<<<<<<<<
*
* property buffer:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getArray); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1366, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, Py_True) : __Pyx_PyObject_CallOneArg(__pyx_t_2, Py_True);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1366, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1365
* property array_r:
* "Vec array (read-only)"
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getArray(True)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.array_r.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1369
*
* property buffer:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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":1370
* property buffer:
* def __get__(self):
* return self.buffer_w # <<<<<<<<<<<<<<
*
* property array:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_buffer_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1370, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1369
*
* property buffer:
* def __get__(self): # <<<<<<<<<<<<<<
* 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":1373
*
* property array:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.array_w
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5array_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5array_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__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":1374
* property array:
* def __get__(self):
* return self.array_w # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.array_w = value
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_array_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1374, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1373
*
* property array:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.array_w
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.array.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1375
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__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;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Vec.pyx":1376
* return self.array_w
* def __set__(self, value):
* self.array_w = value # <<<<<<<<<<<<<<
*
* # --- NumPy array interface (legacy) ---
*/
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_array_w, __pyx_v_value) < 0) __PYX_ERR(40, 1376, __pyx_L1_error)
/* "petsc4py/PETSc/Vec.pyx":1375
* def __get__(self):
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Vec.pyx":1381
*
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_19__array_interface_____get__(((struct PyPetscVecObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_19__array_interface_____get__(struct PyPetscVecObject *__pyx_v_self) {
PyObject *__pyx_v_buf = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Vec.pyx":1382
* property __array_interface__:
* def __get__(self):
* cdef buf = self.getBuffer() # <<<<<<<<<<<<<<
* return buf.__array_interface__
*
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBuffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 1382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_buf = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Vec.pyx":1383
* def __get__(self):
* cdef buf = self.getBuffer()
* return buf.__array_interface__ # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_buf, __pyx_n_s_array_interface); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 1383, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Vec.pyx":1381
*
* property __array_interface__:
* def __get__(self): # <<<<<<<<<<<<<<
* cdef buf = self.getBuffer()
* return buf.__array_interface__
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Vec.__array_interface__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_buf);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/DT.pyx":5
* cdef class Quad(Object):
*
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad___cinit__(((struct PyPetscQuadObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4Quad___cinit__(struct PyPetscQuadObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/DT.pyx":6
*
* 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):
*/
__pyx_v_self->quad = NULL;
/* "petsc4py/PETSc/DT.pyx":5
* cdef class Quad(Object):
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.quad
* self.quad = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/DT.pyx":9
* self.quad = NULL
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4Quad_2view[] = "Quad.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(41, 9, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 9, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Quad.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(41, 9, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_2view(((struct PyPetscQuadObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/DT.pyx":10
*
* def view(self, Viewer viewer=None):
* 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":11
* def view(self, Viewer viewer=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
}
/* "petsc4py/PETSc/DT.pyx":12
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
* CHKERR( PetscQuadratureView(self.quad, vwr) ) # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscQuadratureView(__pyx_v_self->quad, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 12, __pyx_L1_error)
/* "petsc4py/PETSc/DT.pyx":9
* self.quad = NULL
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.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":14
* CHKERR( PetscQuadratureView(self.quad, vwr) )
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscQuadrature newquad = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_5create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4Quad_4create[] = "Quad.create(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_5create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(41, 14, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 14, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":15
*
* def create(self, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(41, 15, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/DT.pyx":16
* def create(self, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscQuadrature newquad = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscQuadratureCreate(ccomm, &newquad) )
* PetscCLEAR(self.obj); self.quad = newquad
*/
__pyx_v_newquad = NULL;
/* "petsc4py/PETSc/DT.pyx":17
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscQuadrature newquad = NULL
* CHKERR( PetscQuadratureCreate(ccomm, &newquad) ) # <<<<<<<<<<<<<<
* 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(41, 17, __pyx_L1_error)
/* "petsc4py/PETSc/DT.pyx":18
* cdef PetscQuadrature newquad = NULL
* CHKERR( PetscQuadratureCreate(ccomm, &newquad) )
* PetscCLEAR(self.obj); self.quad = newquad # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->quad = __pyx_v_newquad;
/* "petsc4py/PETSc/DT.pyx":19
* CHKERR( PetscQuadratureCreate(ccomm, &newquad) )
* PetscCLEAR(self.obj); self.quad = newquad
* return self # <<<<<<<<<<<<<<
*
* def duplicate(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/DT.pyx":14
* CHKERR( PetscQuadratureView(self.quad, vwr) )
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscQuadrature newquad = NULL
*/
/* 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":21
* return self
*
* def duplicate(self): # <<<<<<<<<<<<<<
* cdef Quad newquad = Quad()
* CHKERR( PetscQuadratureDuplicate(self.quad, &newquad.quad) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_7duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4Quad_6duplicate[] = "Quad.duplicate(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_7duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("duplicate (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("duplicate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "duplicate", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_6duplicate(((struct PyPetscQuadObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_6duplicate(struct PyPetscQuadObject *__pyx_v_self) {
struct PyPetscQuadObject *__pyx_v_newquad = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("duplicate", 0);
/* "petsc4py/PETSc/DT.pyx":22
*
* def duplicate(self):
* cdef Quad newquad = Quad() # <<<<<<<<<<<<<<
* CHKERR( PetscQuadratureDuplicate(self.quad, &newquad.quad) )
* return newquad
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Quad)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 22, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_newquad = ((struct PyPetscQuadObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/DT.pyx":23
* def duplicate(self):
* cdef Quad newquad = Quad()
* CHKERR( PetscQuadratureDuplicate(self.quad, &newquad.quad) ) # <<<<<<<<<<<<<<
* return newquad
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscQuadratureDuplicate(__pyx_v_self->quad, (&__pyx_v_newquad->quad))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 23, __pyx_L1_error)
/* "petsc4py/PETSc/DT.pyx":24
* cdef Quad newquad = Quad()
* CHKERR( PetscQuadratureDuplicate(self.quad, &newquad.quad) )
* return newquad # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_newquad));
__pyx_r = ((PyObject *)__pyx_v_newquad);
goto __pyx_L0;
/* "petsc4py/PETSc/DT.pyx":21
* return self
*
* def duplicate(self): # <<<<<<<<<<<<<<
* cdef Quad newquad = Quad()
* CHKERR( PetscQuadratureDuplicate(self.quad, &newquad.quad) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Quad.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_newquad);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/DT.pyx":26
* return newquad
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PetscQuadratureDestroy(&self.quad) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_9destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4Quad_8destroy[] = "Quad.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_9destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_8destroy(((struct PyPetscQuadObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_8destroy(struct PyPetscQuadObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/DT.pyx":27
*
* def destroy(self):
* 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(41, 27, __pyx_L1_error)
/* "petsc4py/PETSc/DT.pyx":28
* def destroy(self):
* CHKERR( PetscQuadratureDestroy(&self.quad) )
* return self # <<<<<<<<<<<<<<
*
* def getData(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/DT.pyx":26
* return newquad
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PetscQuadratureDestroy(&self.quad) )
* return self
*/
/* 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":30
* return self
*
* def getData(self): # <<<<<<<<<<<<<<
* cdef PetscInt cdim = 0
* cdef PetscInt cnc = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_11getData(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4Quad_10getData[] = "Quad.getData(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_11getData(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getData (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getData", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getData", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_10getData(((struct PyPetscQuadObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_10getData(struct PyPetscQuadObject *__pyx_v_self) {
PetscInt __pyx_v_cdim;
PetscInt __pyx_v_cnc;
PetscInt __pyx_v_cnpoints;
PetscReal const *__pyx_v_cpoints;
PetscReal const *__pyx_v_cweights;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getData", 0);
/* "petsc4py/PETSc/DT.pyx":31
*
* def getData(self):
* cdef PetscInt cdim = 0 # <<<<<<<<<<<<<<
* cdef PetscInt cnc = 0
* cdef PetscInt cnpoints = 0
*/
__pyx_v_cdim = 0;
/* "petsc4py/PETSc/DT.pyx":32
* def getData(self):
* 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":33
* 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":34
* 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":35
* 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":36
* 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(41, 36, __pyx_L1_error)
/* "petsc4py/PETSc/DT.pyx":37
* 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) # <<<<<<<<<<<<<<
*
* def getNumComponents(self):
*/
__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(41, 37, __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(41, 37, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 37, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/DT.pyx":30
* return self
*
* def getData(self): # <<<<<<<<<<<<<<
* cdef PetscInt cdim = 0
* cdef PetscInt cnc = 0
*/
/* 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":39
* return array_r(cnpoints*cdim, cpoints), array_r(cnpoints*cnc, cweights)
*
* def getNumComponents(self): # <<<<<<<<<<<<<<
* cdef PetscInt cnc = 0
* CHKERR( PetscQuadratureGetNumComponents(self.quad, &cnc) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_13getNumComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4Quad_12getNumComponents[] = "Quad.getNumComponents(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_13getNumComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNumComponents (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNumComponents", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumComponents", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_12getNumComponents(((struct PyPetscQuadObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_12getNumComponents(struct PyPetscQuadObject *__pyx_v_self) {
PetscInt __pyx_v_cnc;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNumComponents", 0);
/* "petsc4py/PETSc/DT.pyx":40
*
* def getNumComponents(self):
* cdef PetscInt cnc = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscQuadratureGetNumComponents(self.quad, &cnc) )
* return toInt(cnc)
*/
__pyx_v_cnc = 0;
/* "petsc4py/PETSc/DT.pyx":41
* def getNumComponents(self):
* 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(41, 41, __pyx_L1_error)
/* "petsc4py/PETSc/DT.pyx":42
* cdef PetscInt cnc = 0
* CHKERR( PetscQuadratureGetNumComponents(self.quad, &cnc) )
* return toInt(cnc) # <<<<<<<<<<<<<<
*
* def setNumComponents(self, nc):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnc); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 42, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/DT.pyx":39
* return array_r(cnpoints*cdim, cpoints), array_r(cnpoints*cnc, cweights)
*
* def getNumComponents(self): # <<<<<<<<<<<<<<
* cdef PetscInt cnc = 0
* CHKERR( PetscQuadratureGetNumComponents(self.quad, &cnc) )
*/
/* 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":44
* return toInt(cnc)
*
* def setNumComponents(self, nc): # <<<<<<<<<<<<<<
* cdef PetscInt cnc = asInt(nc)
* CHKERR( PetscQuadratureSetNumComponents(self.quad, cnc) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_15setNumComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4Quad_14setNumComponents[] = "Quad.setNumComponents(self, nc)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_15setNumComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_nc = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nc,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNumComponents") < 0)) __PYX_ERR(41, 44, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_nc = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setNumComponents", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 44, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":45
*
* def setNumComponents(self, nc):
* 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(41, 45, __pyx_L1_error)
__pyx_v_cnc = __pyx_t_1;
/* "petsc4py/PETSc/DT.pyx":46
* def setNumComponents(self, nc):
* cdef PetscInt cnc = asInt(nc)
* CHKERR( PetscQuadratureSetNumComponents(self.quad, cnc) ) # <<<<<<<<<<<<<<
*
* def getOrder(self):
*/
__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(41, 46, __pyx_L1_error)
/* "petsc4py/PETSc/DT.pyx":44
* return toInt(cnc)
*
* def setNumComponents(self, nc): # <<<<<<<<<<<<<<
* cdef PetscInt cnc = asInt(nc)
* CHKERR( PetscQuadratureSetNumComponents(self.quad, cnc) )
*/
/* 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":48
* CHKERR( PetscQuadratureSetNumComponents(self.quad, cnc) )
*
* def getOrder(self): # <<<<<<<<<<<<<<
* cdef PetscInt corder = 0
* CHKERR( PetscQuadratureGetOrder(self.quad, &corder))
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_17getOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4Quad_16getOrder[] = "Quad.getOrder(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_17getOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOrder (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOrder", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOrder", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_16getOrder(((struct PyPetscQuadObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_16getOrder(struct PyPetscQuadObject *__pyx_v_self) {
PetscInt __pyx_v_corder;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getOrder", 0);
/* "petsc4py/PETSc/DT.pyx":49
*
* def getOrder(self):
* cdef PetscInt corder = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscQuadratureGetOrder(self.quad, &corder))
* return toInt(corder)
*/
__pyx_v_corder = 0;
/* "petsc4py/PETSc/DT.pyx":50
* def getOrder(self):
* 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(41, 50, __pyx_L1_error)
/* "petsc4py/PETSc/DT.pyx":51
* cdef PetscInt corder = 0
* CHKERR( PetscQuadratureGetOrder(self.quad, &corder))
* return toInt(corder) # <<<<<<<<<<<<<<
*
* def setOrder(self, order):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_corder); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 51, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/DT.pyx":48
* CHKERR( PetscQuadratureSetNumComponents(self.quad, cnc) )
*
* def getOrder(self): # <<<<<<<<<<<<<<
* cdef PetscInt corder = 0
* CHKERR( PetscQuadratureGetOrder(self.quad, &corder))
*/
/* 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":53
* return toInt(corder)
*
* def setOrder(self, order): # <<<<<<<<<<<<<<
* cdef PetscInt corder = asInt(order)
* CHKERR( PetscQuadratureSetOrder(self.quad, corder))
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_19setOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4Quad_18setOrder[] = "Quad.setOrder(self, order)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_19setOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_order = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_order,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_order)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOrder") < 0)) __PYX_ERR(41, 53, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_order = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setOrder", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 53, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":54
*
* def setOrder(self, order):
* 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(41, 54, __pyx_L1_error)
__pyx_v_corder = __pyx_t_1;
/* "petsc4py/PETSc/DT.pyx":55
* def setOrder(self, order):
* 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(41, 55, __pyx_L1_error)
/* "petsc4py/PETSc/DT.pyx":53
* return toInt(corder)
*
* def setOrder(self, order): # <<<<<<<<<<<<<<
* cdef PetscInt corder = asInt(order)
* CHKERR( PetscQuadratureSetOrder(self.quad, corder))
*/
/* 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":14
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE___cinit__(((struct PyPetscFEObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_2FE___cinit__(struct PyPetscFEObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/FE.pyx":15
*
* 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":16
* def __cinit__(self):
* self.obj = <PetscObject*> &self.fe
* self.fe = NULL # <<<<<<<<<<<<<<
*
* def view(self, Viewer viewer=None):
*/
__pyx_v_self->fe = NULL;
/* "petsc4py/PETSc/FE.pyx":14
* Type = FEType
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.fe
* self.fe = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/FE.pyx":18
* self.fe = NULL
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_2view[] = "FE.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(42, 18, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 18, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.FE.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(42, 18, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_2view(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/FE.pyx":19
*
* def view(self, Viewer viewer=None):
* 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":20
* def view(self, Viewer viewer=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
}
/* "petsc4py/PETSc/FE.pyx":21
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
* CHKERR( PetscFEView(self.fe, vwr) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEView(__pyx_v_self->fe, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 21, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":18
* self.fe = NULL
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.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":23
* CHKERR( PetscFEView(self.fe, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PetscFEDestroy(&self.fe) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_4destroy[] = "FE.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_4destroy(((struct PyPetscFEObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_4destroy(struct PyPetscFEObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/FE.pyx":24
*
* def destroy(self):
* 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(42, 24, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":25
* def destroy(self):
* CHKERR( PetscFEDestroy(&self.fe) )
* return self # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/FE.pyx":23
* CHKERR( PetscFEView(self.fe, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PetscFEDestroy(&self.fe) )
* return self
*/
/* 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":27
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscFE newfe = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_7create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_6create[] = "FE.create(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_7create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(42, 27, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 27, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":28
*
* def create(self, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(42, 28, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/FE.pyx":29
* def create(self, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscFE newfe = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscFECreate(ccomm, &newfe) )
* PetscCLEAR(self.obj); self.fe = newfe
*/
__pyx_v_newfe = NULL;
/* "petsc4py/PETSc/FE.pyx":30
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscFE newfe = NULL
* CHKERR( PetscFECreate(ccomm, &newfe) ) # <<<<<<<<<<<<<<
* 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(42, 30, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":31
* cdef PetscFE newfe = NULL
* CHKERR( PetscFECreate(ccomm, &newfe) )
* PetscCLEAR(self.obj); self.fe = newfe # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->fe = __pyx_v_newfe;
/* "petsc4py/PETSc/FE.pyx":32
* CHKERR( PetscFECreate(ccomm, &newfe) )
* PetscCLEAR(self.obj); self.fe = newfe
* return self # <<<<<<<<<<<<<<
*
* def createDefault(self, dim, nc, isSimplex, qorder, prefix=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/FE.pyx":27
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscFE newfe = NULL
*/
/* 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":34
* return self
*
* def createDefault(self, dim, nc, isSimplex, qorder, prefix=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscFE newfe = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_9createDefault(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_8createDefault[] = "FE.createDefault(self, dim, nc, isSimplex, qorder, prefix=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_9createDefault(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createDefault (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,&__pyx_n_s_nc,&__pyx_n_s_isSimplex,&__pyx_n_s_qorder,&__pyx_n_s_prefix,&__pyx_n_s_comm,0};
PyObject* values[6] = {0,0,0,0,0,0};
values[4] = ((PyObject *)Py_None);
values[5] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
CYTHON_FALLTHROUGH;
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createDefault", 0, 4, 6, 1); __PYX_ERR(42, 34, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isSimplex)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createDefault", 0, 4, 6, 2); __PYX_ERR(42, 34, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qorder)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createDefault", 0, 4, 6, 3); __PYX_ERR(42, 34, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix);
if (value) { values[4] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 5:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[5] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createDefault") < 0)) __PYX_ERR(42, 34, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
CYTHON_FALLTHROUGH;
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_dim = values[0];
__pyx_v_nc = values[1];
__pyx_v_isSimplex = values[2];
__pyx_v_qorder = values[3];
__pyx_v_prefix = values[4];
__pyx_v_comm = values[5];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createDefault", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 34, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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":35
*
* def createDefault(self, dim, nc, isSimplex, qorder, prefix=None, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(42, 35, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/FE.pyx":36
* def createDefault(self, dim, nc, isSimplex, qorder, prefix=None, comm=None):
* 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":37
* 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(42, 37, __pyx_L1_error)
__pyx_v_cdim = __pyx_t_2;
/* "petsc4py/PETSc/FE.pyx":38
* 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(42, 38, __pyx_L1_error)
__pyx_v_cnc = __pyx_t_2;
/* "petsc4py/PETSc/FE.pyx":39
* 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(42, 39, __pyx_L1_error)
__pyx_v_cqorder = __pyx_t_2;
/* "petsc4py/PETSc/FE.pyx":40
* 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(42, 40, __pyx_L1_error)
__pyx_v_cisSimplex = __pyx_t_3;
/* "petsc4py/PETSc/FE.pyx":41
* 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":42
* 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(42, 42, __pyx_L1_error)
if (__pyx_t_4) {
/* "petsc4py/PETSc/FE.pyx":43
* cdef const char *cprefix = NULL
* if prefix:
* prefix = str2bytes(prefix, &cprefix) # <<<<<<<<<<<<<<
* CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe))
* 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(42, 43, __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":42
* 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":44
* if prefix:
* prefix = str2bytes(prefix, &cprefix)
* CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe)) # <<<<<<<<<<<<<<
* 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(42, 44, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":45
* prefix = str2bytes(prefix, &cprefix)
* CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe))
* PetscCLEAR(self.obj); self.fe = newfe # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->fe = __pyx_v_newfe;
/* "petsc4py/PETSc/FE.pyx":46
* CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe))
* PetscCLEAR(self.obj); self.fe = newfe
* return self # <<<<<<<<<<<<<<
*
* def createLagrange(self, dim, nc, isSimplex, k, qorder, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/FE.pyx":34
* return self
*
* def createDefault(self, dim, nc, isSimplex, qorder, prefix=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscFE newfe = NULL
*/
/* 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":48
* return self
*
* def createLagrange(self, dim, nc, isSimplex, k, qorder, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscFE newfe = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_11createLagrange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_10createLagrange[] = "FE.createLagrange(self, dim, nc, isSimplex, k, qorder, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_11createLagrange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createLagrange (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,&__pyx_n_s_nc,&__pyx_n_s_isSimplex,&__pyx_n_s_k,&__pyx_n_s_qorder,&__pyx_n_s_comm,0};
PyObject* values[6] = {0,0,0,0,0,0};
values[5] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
CYTHON_FALLTHROUGH;
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createLagrange", 0, 5, 6, 1); __PYX_ERR(42, 48, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isSimplex)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createLagrange", 0, 5, 6, 2); __PYX_ERR(42, 48, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createLagrange", 0, 5, 6, 3); __PYX_ERR(42, 48, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 4:
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qorder)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createLagrange", 0, 5, 6, 4); __PYX_ERR(42, 48, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 5:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[5] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createLagrange") < 0)) __PYX_ERR(42, 48, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
CYTHON_FALLTHROUGH;
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_dim = values[0];
__pyx_v_nc = values[1];
__pyx_v_isSimplex = values[2];
__pyx_v_k = values[3];
__pyx_v_qorder = values[4];
__pyx_v_comm = values[5];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createLagrange", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 48, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.FE.createLagrange", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_10createLagrange(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_dim, __pyx_v_nc, __pyx_v_isSimplex, __pyx_v_k, __pyx_v_qorder, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_10createLagrange(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_nc, PyObject *__pyx_v_isSimplex, PyObject *__pyx_v_k, PyObject *__pyx_v_qorder, PyObject *__pyx_v_comm) {
MPI_Comm __pyx_v_ccomm;
PetscFE __pyx_v_newfe;
PetscInt __pyx_v_cdim;
PetscInt __pyx_v_cnc;
PetscInt __pyx_v_ck;
PetscInt __pyx_v_cqorder;
PetscBool __pyx_v_cisSimplex;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
PetscInt __pyx_t_2;
PetscBool __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createLagrange", 0);
/* "petsc4py/PETSc/FE.pyx":49
*
* def createLagrange(self, dim, nc, isSimplex, k, qorder, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(42, 49, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/FE.pyx":50
* def createLagrange(self, dim, nc, isSimplex, k, qorder, comm=None):
* 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":51
* 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(42, 51, __pyx_L1_error)
__pyx_v_cdim = __pyx_t_2;
/* "petsc4py/PETSc/FE.pyx":52
* 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(42, 52, __pyx_L1_error)
__pyx_v_cnc = __pyx_t_2;
/* "petsc4py/PETSc/FE.pyx":53
* 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(42, 53, __pyx_L1_error)
__pyx_v_ck = __pyx_t_2;
/* "petsc4py/PETSc/FE.pyx":54
* 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(42, 54, __pyx_L1_error)
__pyx_v_cqorder = __pyx_t_2;
/* "petsc4py/PETSc/FE.pyx":55
* cdef PetscInt ck = asInt(k)
* cdef PetscInt cqorder = asInt(qorder)
* cdef PetscBool cisSimplex = asBool(isSimplex) # <<<<<<<<<<<<<<
* CHKERR( PetscFECreateLagrange(ccomm, cdim, cnc, cisSimplex, ck, cqorder, &newfe))
* 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(42, 55, __pyx_L1_error)
__pyx_v_cisSimplex = __pyx_t_3;
/* "petsc4py/PETSc/FE.pyx":56
* cdef PetscInt cqorder = asInt(qorder)
* cdef PetscBool cisSimplex = asBool(isSimplex)
* CHKERR( PetscFECreateLagrange(ccomm, cdim, cnc, cisSimplex, ck, cqorder, &newfe)) # <<<<<<<<<<<<<<
* 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(42, 56, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":57
* cdef PetscBool cisSimplex = asBool(isSimplex)
* CHKERR( PetscFECreateLagrange(ccomm, cdim, cnc, cisSimplex, ck, cqorder, &newfe))
* PetscCLEAR(self.obj); self.fe = newfe # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->fe = __pyx_v_newfe;
/* "petsc4py/PETSc/FE.pyx":58
* CHKERR( PetscFECreateLagrange(ccomm, cdim, cnc, cisSimplex, ck, cqorder, &newfe))
* PetscCLEAR(self.obj); self.fe = newfe
* return self # <<<<<<<<<<<<<<
*
* def getQuadrature(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/FE.pyx":48
* return self
*
* def createLagrange(self, dim, nc, isSimplex, k, qorder, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscFE newfe = NULL
*/
/* 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":60
* return self
*
* def getQuadrature(self): # <<<<<<<<<<<<<<
* cdef Quad quad = Quad()
* CHKERR( PetscFEGetQuadrature(self.fe, &quad.quad) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_13getQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_12getQuadrature[] = "FE.getQuadrature(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_13getQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getQuadrature (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getQuadrature", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getQuadrature", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_12getQuadrature(((struct PyPetscFEObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_12getQuadrature(struct PyPetscFEObject *__pyx_v_self) {
struct PyPetscQuadObject *__pyx_v_quad = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getQuadrature", 0);
/* "petsc4py/PETSc/FE.pyx":61
*
* def getQuadrature(self):
* cdef Quad quad = Quad() # <<<<<<<<<<<<<<
* CHKERR( PetscFEGetQuadrature(self.fe, &quad.quad) )
* return quad
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Quad)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 61, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_quad = ((struct PyPetscQuadObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/FE.pyx":62
* def getQuadrature(self):
* cdef Quad quad = Quad()
* CHKERR( PetscFEGetQuadrature(self.fe, &quad.quad) ) # <<<<<<<<<<<<<<
* return quad
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetQuadrature(__pyx_v_self->fe, (&__pyx_v_quad->quad))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 62, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":63
* cdef Quad quad = Quad()
* CHKERR( PetscFEGetQuadrature(self.fe, &quad.quad) )
* return quad # <<<<<<<<<<<<<<
*
* def getDimension(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_quad));
__pyx_r = ((PyObject *)__pyx_v_quad);
goto __pyx_L0;
/* "petsc4py/PETSc/FE.pyx":60
* return self
*
* def getQuadrature(self): # <<<<<<<<<<<<<<
* cdef Quad quad = Quad()
* CHKERR( PetscFEGetQuadrature(self.fe, &quad.quad) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.FE.getQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_quad);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/FE.pyx":65
* return quad
*
* def getDimension(self): # <<<<<<<<<<<<<<
* cdef PetscInt cdim = 0
* CHKERR( PetscFEGetDimension(self.fe, &cdim) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_15getDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_14getDimension[] = "FE.getDimension(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_15getDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDimension (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDimension", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDimension", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_14getDimension(((struct PyPetscFEObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_14getDimension(struct PyPetscFEObject *__pyx_v_self) {
PetscInt __pyx_v_cdim;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDimension", 0);
/* "petsc4py/PETSc/FE.pyx":66
*
* def getDimension(self):
* cdef PetscInt cdim = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscFEGetDimension(self.fe, &cdim) )
* return toInt(cdim)
*/
__pyx_v_cdim = 0;
/* "petsc4py/PETSc/FE.pyx":67
* def getDimension(self):
* 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(42, 67, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":68
* cdef PetscInt cdim = 0
* CHKERR( PetscFEGetDimension(self.fe, &cdim) )
* return toInt(cdim) # <<<<<<<<<<<<<<
*
* def getSpatialDimension(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cdim); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 68, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/FE.pyx":65
* return quad
*
* def getDimension(self): # <<<<<<<<<<<<<<
* cdef PetscInt cdim = 0
* CHKERR( PetscFEGetDimension(self.fe, &cdim) )
*/
/* 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":70
* return toInt(cdim)
*
* def getSpatialDimension(self): # <<<<<<<<<<<<<<
* cdef PetscInt csdim = 0
* CHKERR( PetscFEGetSpatialDimension(self.fe, &csdim) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_17getSpatialDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_16getSpatialDimension[] = "FE.getSpatialDimension(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_17getSpatialDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getSpatialDimension (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getSpatialDimension", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSpatialDimension", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_16getSpatialDimension(((struct PyPetscFEObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_16getSpatialDimension(struct PyPetscFEObject *__pyx_v_self) {
PetscInt __pyx_v_csdim;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getSpatialDimension", 0);
/* "petsc4py/PETSc/FE.pyx":71
*
* def getSpatialDimension(self):
* cdef PetscInt csdim = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscFEGetSpatialDimension(self.fe, &csdim) )
* return toInt(csdim)
*/
__pyx_v_csdim = 0;
/* "petsc4py/PETSc/FE.pyx":72
* def getSpatialDimension(self):
* 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(42, 72, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":73
* cdef PetscInt csdim = 0
* CHKERR( PetscFEGetSpatialDimension(self.fe, &csdim) )
* return toInt(csdim) # <<<<<<<<<<<<<<
*
* def getNumComponents(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_csdim); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 73, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/FE.pyx":70
* return toInt(cdim)
*
* def getSpatialDimension(self): # <<<<<<<<<<<<<<
* cdef PetscInt csdim = 0
* CHKERR( PetscFEGetSpatialDimension(self.fe, &csdim) )
*/
/* 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":75
* return toInt(csdim)
*
* def getNumComponents(self): # <<<<<<<<<<<<<<
* cdef PetscInt comp = 0
* CHKERR( PetscFEGetNumComponents(self.fe, &comp) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_19getNumComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_18getNumComponents[] = "FE.getNumComponents(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_19getNumComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNumComponents (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNumComponents", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumComponents", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_18getNumComponents(((struct PyPetscFEObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_18getNumComponents(struct PyPetscFEObject *__pyx_v_self) {
PetscInt __pyx_v_comp;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNumComponents", 0);
/* "petsc4py/PETSc/FE.pyx":76
*
* def getNumComponents(self):
* cdef PetscInt comp = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscFEGetNumComponents(self.fe, &comp) )
* return toInt(comp)
*/
__pyx_v_comp = 0;
/* "petsc4py/PETSc/FE.pyx":77
* def getNumComponents(self):
* 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(42, 77, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":78
* cdef PetscInt comp = 0
* CHKERR( PetscFEGetNumComponents(self.fe, &comp) )
* return toInt(comp) # <<<<<<<<<<<<<<
*
* def setNumComponents(self, comp):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_comp); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 78, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/FE.pyx":75
* return toInt(csdim)
*
* def getNumComponents(self): # <<<<<<<<<<<<<<
* cdef PetscInt comp = 0
* CHKERR( PetscFEGetNumComponents(self.fe, &comp) )
*/
/* 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":80
* return toInt(comp)
*
* def setNumComponents(self, comp): # <<<<<<<<<<<<<<
* cdef PetscInt ccomp = asInt(comp)
* CHKERR( PetscFESetNumComponents(self.fe, comp) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_21setNumComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_20setNumComponents[] = "FE.setNumComponents(self, comp)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_21setNumComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comp = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comp,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comp)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNumComponents") < 0)) __PYX_ERR(42, 80, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_comp = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setNumComponents", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 80, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.FE.setNumComponents", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_20setNumComponents(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_comp);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_20setNumComponents(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_comp) {
CYTHON_UNUSED PetscInt __pyx_v_ccomp;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setNumComponents", 0);
/* "petsc4py/PETSc/FE.pyx":81
*
* def setNumComponents(self, comp):
* cdef PetscInt ccomp = asInt(comp) # <<<<<<<<<<<<<<
* CHKERR( PetscFESetNumComponents(self.fe, comp) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_comp); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(42, 81, __pyx_L1_error)
__pyx_v_ccomp = __pyx_t_1;
/* "petsc4py/PETSc/FE.pyx":82
* def setNumComponents(self, comp):
* cdef PetscInt ccomp = asInt(comp)
* CHKERR( PetscFESetNumComponents(self.fe, comp) ) # <<<<<<<<<<<<<<
*
* def getNumDof(self):
*/
__pyx_t_1 = __Pyx_PyInt_As_PetscInt(__pyx_v_comp); if (unlikely((__pyx_t_1 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(42, 82, __pyx_L1_error)
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetNumComponents(__pyx_v_self->fe, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 82, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":80
* return toInt(comp)
*
* def setNumComponents(self, comp): # <<<<<<<<<<<<<<
* cdef PetscInt ccomp = asInt(comp)
* CHKERR( PetscFESetNumComponents(self.fe, comp) )
*/
/* 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":84
* CHKERR( PetscFESetNumComponents(self.fe, comp) )
*
* def getNumDof(self): # <<<<<<<<<<<<<<
* cdef const PetscInt *numDof = NULL
* cdef PetscInt cdim = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_23getNumDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_22getNumDof[] = "FE.getNumDof(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_23getNumDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNumDof (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNumDof", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumDof", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_22getNumDof(((struct PyPetscFEObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_22getNumDof(struct PyPetscFEObject *__pyx_v_self) {
PetscInt const *__pyx_v_numDof;
PetscInt __pyx_v_cdim;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNumDof", 0);
/* "petsc4py/PETSc/FE.pyx":85
*
* def getNumDof(self):
* cdef const PetscInt *numDof = NULL # <<<<<<<<<<<<<<
* cdef PetscInt cdim = 0
* CHKERR( PetscFEGetDimension(self.fe, &cdim) )
*/
__pyx_v_numDof = NULL;
/* "petsc4py/PETSc/FE.pyx":86
* def getNumDof(self):
* 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":87
* 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(42, 87, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":88
* 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(42, 88, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":89
* CHKERR( PetscFEGetDimension(self.fe, &cdim) )
* CHKERR( PetscFEGetNumDof(self.fe, &numDof) )
* return array_i(cdim, numDof) # <<<<<<<<<<<<<<
*
* def getTileSizes(self):
*/
__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(42, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/FE.pyx":84
* CHKERR( PetscFESetNumComponents(self.fe, comp) )
*
* def getNumDof(self): # <<<<<<<<<<<<<<
* cdef const PetscInt *numDof = NULL
* cdef PetscInt cdim = 0
*/
/* 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":91
* return array_i(cdim, numDof)
*
* def getTileSizes(self): # <<<<<<<<<<<<<<
* cdef PetscInt blockSize = 0, numBlocks = 0
* cdef PetscInt batchSize = 0, numBatches = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_25getTileSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_24getTileSizes[] = "FE.getTileSizes(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_25getTileSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getTileSizes (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getTileSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTileSizes", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_24getTileSizes(((struct PyPetscFEObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_24getTileSizes(struct PyPetscFEObject *__pyx_v_self) {
PetscInt __pyx_v_blockSize;
PetscInt __pyx_v_numBlocks;
PetscInt __pyx_v_batchSize;
PetscInt __pyx_v_numBatches;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getTileSizes", 0);
/* "petsc4py/PETSc/FE.pyx":92
*
* def getTileSizes(self):
* 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":93
* def getTileSizes(self):
* 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":94
* 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(42, 94, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":95
* 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(self, blockSize, numBlocks, batchSize, numBatches):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_blockSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 95, __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(42, 95, __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(42, 95, __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(42, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(42, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5);
__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":91
* return array_i(cdim, numDof)
*
* def getTileSizes(self): # <<<<<<<<<<<<<<
* cdef PetscInt blockSize = 0, numBlocks = 0
* cdef PetscInt batchSize = 0, numBatches = 0
*/
/* 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":97
* return toInt(blockSize), toInt(numBlocks), toInt(batchSize), toInt(numBatches)
*
* def setTileSizes(self, blockSize, numBlocks, batchSize, numBatches): # <<<<<<<<<<<<<<
* cdef PetscInt cblockSize = asInt(blockSize), cnumBlocks = asInt(numBlocks)
* cdef PetscInt cbatchSize = asInt(batchSize), cnumBatches = asInt(numBatches)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_27setTileSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_26setTileSizes[] = "FE.setTileSizes(self, blockSize, numBlocks, batchSize, numBatches)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_27setTileSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_blockSize = 0;
PyObject *__pyx_v_numBlocks = 0;
PyObject *__pyx_v_batchSize = 0;
PyObject *__pyx_v_numBatches = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_blockSize,&__pyx_n_s_numBlocks,&__pyx_n_s_batchSize,&__pyx_n_s_numBatches,0};
PyObject* values[4] = {0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blockSize)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numBlocks)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setTileSizes", 1, 4, 4, 1); __PYX_ERR(42, 97, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_batchSize)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setTileSizes", 1, 4, 4, 2); __PYX_ERR(42, 97, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numBatches)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setTileSizes", 1, 4, 4, 3); __PYX_ERR(42, 97, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTileSizes") < 0)) __PYX_ERR(42, 97, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
}
__pyx_v_blockSize = values[0];
__pyx_v_numBlocks = values[1];
__pyx_v_batchSize = values[2];
__pyx_v_numBatches = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setTileSizes", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 97, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.FE.setTileSizes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_26setTileSizes(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_blockSize, __pyx_v_numBlocks, __pyx_v_batchSize, __pyx_v_numBatches);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_26setTileSizes(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_blockSize, PyObject *__pyx_v_numBlocks, PyObject *__pyx_v_batchSize, PyObject *__pyx_v_numBatches) {
CYTHON_UNUSED PetscInt __pyx_v_cblockSize;
CYTHON_UNUSED PetscInt __pyx_v_cnumBlocks;
CYTHON_UNUSED PetscInt __pyx_v_cbatchSize;
CYTHON_UNUSED PetscInt __pyx_v_cnumBatches;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscInt __pyx_t_2;
PetscInt __pyx_t_3;
PetscInt __pyx_t_4;
PetscErrorCode __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setTileSizes", 0);
/* "petsc4py/PETSc/FE.pyx":98
*
* def setTileSizes(self, blockSize, numBlocks, batchSize, numBatches):
* cdef PetscInt cblockSize = asInt(blockSize), cnumBlocks = asInt(numBlocks) # <<<<<<<<<<<<<<
* cdef PetscInt cbatchSize = asInt(batchSize), cnumBatches = asInt(numBatches)
* CHKERR( PetscFESetTileSizes(self.fe, blockSize, numBlocks, batchSize, numBatches) )
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_blockSize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(42, 98, __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(42, 98, __pyx_L1_error)
__pyx_v_cnumBlocks = __pyx_t_1;
/* "petsc4py/PETSc/FE.pyx":99
* def setTileSizes(self, blockSize, numBlocks, batchSize, numBatches):
* cdef PetscInt cblockSize = asInt(blockSize), cnumBlocks = asInt(numBlocks)
* cdef PetscInt cbatchSize = asInt(batchSize), cnumBatches = asInt(numBatches) # <<<<<<<<<<<<<<
* CHKERR( PetscFESetTileSizes(self.fe, blockSize, numBlocks, batchSize, numBatches) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_batchSize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(42, 99, __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(42, 99, __pyx_L1_error)
__pyx_v_cnumBatches = __pyx_t_1;
/* "petsc4py/PETSc/FE.pyx":100
* cdef PetscInt cblockSize = asInt(blockSize), cnumBlocks = asInt(numBlocks)
* cdef PetscInt cbatchSize = asInt(batchSize), cnumBatches = asInt(numBatches)
* CHKERR( PetscFESetTileSizes(self.fe, blockSize, numBlocks, batchSize, numBatches) ) # <<<<<<<<<<<<<<
*
* def getFaceQuadrature(self):
*/
__pyx_t_1 = __Pyx_PyInt_As_PetscInt(__pyx_v_blockSize); if (unlikely((__pyx_t_1 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(42, 100, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyInt_As_PetscInt(__pyx_v_numBlocks); if (unlikely((__pyx_t_2 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(42, 100, __pyx_L1_error)
__pyx_t_3 = __Pyx_PyInt_As_PetscInt(__pyx_v_batchSize); if (unlikely((__pyx_t_3 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(42, 100, __pyx_L1_error)
__pyx_t_4 = __Pyx_PyInt_As_PetscInt(__pyx_v_numBatches); if (unlikely((__pyx_t_4 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(42, 100, __pyx_L1_error)
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetTileSizes(__pyx_v_self->fe, __pyx_t_1, __pyx_t_2, __pyx_t_3, __pyx_t_4)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 100, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":97
* return toInt(blockSize), toInt(numBlocks), toInt(batchSize), toInt(numBatches)
*
* def setTileSizes(self, blockSize, numBlocks, batchSize, numBatches): # <<<<<<<<<<<<<<
* cdef PetscInt cblockSize = asInt(blockSize), cnumBlocks = asInt(numBlocks)
* cdef PetscInt cbatchSize = asInt(batchSize), cnumBatches = asInt(numBatches)
*/
/* 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":102
* CHKERR( PetscFESetTileSizes(self.fe, blockSize, numBlocks, batchSize, numBatches) )
*
* def getFaceQuadrature(self): # <<<<<<<<<<<<<<
* cdef Quad quad = Quad()
* CHKERR( PetscFEGetFaceQuadrature(self.fe, &quad.quad) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_29getFaceQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_28getFaceQuadrature[] = "FE.getFaceQuadrature(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_29getFaceQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFaceQuadrature (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFaceQuadrature", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFaceQuadrature", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_28getFaceQuadrature(((struct PyPetscFEObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_28getFaceQuadrature(struct PyPetscFEObject *__pyx_v_self) {
struct PyPetscQuadObject *__pyx_v_quad = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFaceQuadrature", 0);
/* "petsc4py/PETSc/FE.pyx":103
*
* def getFaceQuadrature(self):
* cdef Quad quad = Quad() # <<<<<<<<<<<<<<
* CHKERR( PetscFEGetFaceQuadrature(self.fe, &quad.quad) )
* return quad
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Quad)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_quad = ((struct PyPetscQuadObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/FE.pyx":104
* def getFaceQuadrature(self):
* cdef Quad quad = Quad()
* CHKERR( PetscFEGetFaceQuadrature(self.fe, &quad.quad) ) # <<<<<<<<<<<<<<
* return quad
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetFaceQuadrature(__pyx_v_self->fe, (&__pyx_v_quad->quad))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 104, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":105
* cdef Quad quad = Quad()
* CHKERR( PetscFEGetFaceQuadrature(self.fe, &quad.quad) )
* return quad # <<<<<<<<<<<<<<
*
* def setQuadrature(self, Quad quad):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_quad));
__pyx_r = ((PyObject *)__pyx_v_quad);
goto __pyx_L0;
/* "petsc4py/PETSc/FE.pyx":102
* CHKERR( PetscFESetTileSizes(self.fe, blockSize, numBlocks, batchSize, numBatches) )
*
* def getFaceQuadrature(self): # <<<<<<<<<<<<<<
* cdef Quad quad = Quad()
* CHKERR( PetscFEGetFaceQuadrature(self.fe, &quad.quad) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.FE.getFaceQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_quad);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/FE.pyx":107
* return quad
*
* def setQuadrature(self, Quad quad): # <<<<<<<<<<<<<<
* CHKERR( PetscFESetQuadrature(self.fe, quad.quad) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_31setQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_30setQuadrature[] = "FE.setQuadrature(self, Quad quad)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_31setQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscQuadObject *__pyx_v_quad = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_quad,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quad)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setQuadrature") < 0)) __PYX_ERR(42, 107, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_quad = ((struct PyPetscQuadObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setQuadrature", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 107, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.FE.setQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quad), __pyx_ptype_8petsc4py_5PETSc_Quad, 0, "quad", 0))) __PYX_ERR(42, 107, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_30setQuadrature(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_quad);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_30setQuadrature(struct PyPetscFEObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setQuadrature", 0);
/* "petsc4py/PETSc/FE.pyx":108
*
* def setQuadrature(self, Quad quad):
* 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(42, 108, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":109
* def setQuadrature(self, Quad quad):
* CHKERR( PetscFESetQuadrature(self.fe, quad.quad) )
* return self # <<<<<<<<<<<<<<
*
* def setFaceQuadrature(self, 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":107
* return quad
*
* def setQuadrature(self, Quad quad): # <<<<<<<<<<<<<<
* CHKERR( PetscFESetQuadrature(self.fe, quad.quad) )
* return self
*/
/* 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":111
* return self
*
* def setFaceQuadrature(self, Quad quad): # <<<<<<<<<<<<<<
* CHKERR( PetscFESetFaceQuadrature(self.fe, quad.quad) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_33setFaceQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_32setFaceQuadrature[] = "FE.setFaceQuadrature(self, Quad quad)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_33setFaceQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscQuadObject *__pyx_v_quad = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_quad,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quad)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFaceQuadrature") < 0)) __PYX_ERR(42, 111, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_quad = ((struct PyPetscQuadObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFaceQuadrature", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 111, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.FE.setFaceQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quad), __pyx_ptype_8petsc4py_5PETSc_Quad, 0, "quad", 0))) __PYX_ERR(42, 111, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_32setFaceQuadrature(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_quad);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_32setFaceQuadrature(struct PyPetscFEObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFaceQuadrature", 0);
/* "petsc4py/PETSc/FE.pyx":112
*
* def setFaceQuadrature(self, Quad quad):
* 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(42, 112, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":113
* def setFaceQuadrature(self, Quad quad):
* CHKERR( PetscFESetFaceQuadrature(self.fe, quad.quad) )
* return self # <<<<<<<<<<<<<<
*
* def setType(self, fe_type):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/FE.pyx":111
* return self
*
* def setFaceQuadrature(self, Quad quad): # <<<<<<<<<<<<<<
* CHKERR( PetscFESetFaceQuadrature(self.fe, quad.quad) )
* return self
*/
/* 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":115
* return self
*
* def setType(self, fe_type): # <<<<<<<<<<<<<<
* cdef PetscFEType cval = NULL
* fe_type = str2bytes(fe_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_35setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_34setType[] = "FE.setType(self, fe_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_35setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_fe_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fe_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fe_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(42, 115, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_fe_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 115, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.FE.setType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_34setType(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_fe_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_34setType(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_fe_type) {
PetscFEType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setType", 0);
__Pyx_INCREF(__pyx_v_fe_type);
/* "petsc4py/PETSc/FE.pyx":116
*
* def setType(self, fe_type):
* cdef PetscFEType cval = NULL # <<<<<<<<<<<<<<
* fe_type = str2bytes(fe_type, &cval)
* CHKERR( PetscFESetType(self.fe, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/FE.pyx":117
* def setType(self, fe_type):
* 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(42, 117, __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":118
* 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(42, 118, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":119
* fe_type = str2bytes(fe_type, &cval)
* CHKERR( PetscFESetType(self.fe, cval) )
* return self # <<<<<<<<<<<<<<
*
* def getBasisSpace(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/FE.pyx":115
* return self
*
* def setType(self, fe_type): # <<<<<<<<<<<<<<
* cdef PetscFEType cval = NULL
* fe_type = str2bytes(fe_type, &cval)
*/
/* 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":121
* return self
*
* def getBasisSpace(self): # <<<<<<<<<<<<<<
* cdef Space sp = Space()
* CHKERR( PetscFEGetBasisSpace(self.fe, &sp.space ) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_37getBasisSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_36getBasisSpace[] = "FE.getBasisSpace(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_37getBasisSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getBasisSpace (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getBasisSpace", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBasisSpace", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_36getBasisSpace(((struct PyPetscFEObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_36getBasisSpace(struct PyPetscFEObject *__pyx_v_self) {
struct PyPetscSpaceObject *__pyx_v_sp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getBasisSpace", 0);
/* "petsc4py/PETSc/FE.pyx":122
*
* def getBasisSpace(self):
* cdef Space sp = Space() # <<<<<<<<<<<<<<
* CHKERR( PetscFEGetBasisSpace(self.fe, &sp.space ) )
* return sp
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Space)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 122, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_sp = ((struct PyPetscSpaceObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/FE.pyx":123
* def getBasisSpace(self):
* cdef Space sp = Space()
* CHKERR( PetscFEGetBasisSpace(self.fe, &sp.space ) ) # <<<<<<<<<<<<<<
* return sp
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetBasisSpace(__pyx_v_self->fe, (&__pyx_v_sp->space))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 123, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":124
* cdef Space sp = Space()
* CHKERR( PetscFEGetBasisSpace(self.fe, &sp.space ) )
* return sp # <<<<<<<<<<<<<<
*
* def setBasisSpace(self, Space sp):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_sp));
__pyx_r = ((PyObject *)__pyx_v_sp);
goto __pyx_L0;
/* "petsc4py/PETSc/FE.pyx":121
* return self
*
* def getBasisSpace(self): # <<<<<<<<<<<<<<
* cdef Space sp = Space()
* CHKERR( PetscFEGetBasisSpace(self.fe, &sp.space ) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.FE.getBasisSpace", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_sp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/FE.pyx":126
* return sp
*
* def setBasisSpace(self, Space sp): # <<<<<<<<<<<<<<
* CHKERR( PetscFESetBasisSpace(self.fe, sp.space ) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_39setBasisSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_38setBasisSpace[] = "FE.setBasisSpace(self, Space sp)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_39setBasisSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscSpaceObject *__pyx_v_sp = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sp,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sp)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBasisSpace") < 0)) __PYX_ERR(42, 126, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_sp = ((struct PyPetscSpaceObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBasisSpace", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 126, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.FE.setBasisSpace", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sp), __pyx_ptype_8petsc4py_5PETSc_Space, 0, "sp", 0))) __PYX_ERR(42, 126, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_38setBasisSpace(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_sp);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_38setBasisSpace(struct PyPetscFEObject *__pyx_v_self, struct PyPetscSpaceObject *__pyx_v_sp) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBasisSpace", 0);
/* "petsc4py/PETSc/FE.pyx":127
*
* def setBasisSpace(self, Space sp):
* CHKERR( PetscFESetBasisSpace(self.fe, sp.space ) ) # <<<<<<<<<<<<<<
*
* def setFromOptions(self):
*/
__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(42, 127, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":126
* return sp
*
* def setBasisSpace(self, Space sp): # <<<<<<<<<<<<<<
* CHKERR( PetscFESetBasisSpace(self.fe, sp.space ) )
*
*/
/* 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":129
* CHKERR( PetscFESetBasisSpace(self.fe, sp.space ) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( PetscFESetFromOptions(self.fe) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_41setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_40setFromOptions[] = "FE.setFromOptions(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_41setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_40setFromOptions(((struct PyPetscFEObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_40setFromOptions(struct PyPetscFEObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFromOptions", 0);
/* "petsc4py/PETSc/FE.pyx":130
*
* def setFromOptions(self):
* CHKERR( PetscFESetFromOptions(self.fe) ) # <<<<<<<<<<<<<<
*
* def setUp(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetFromOptions(__pyx_v_self->fe)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 130, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":129
* CHKERR( PetscFESetBasisSpace(self.fe, sp.space ) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( PetscFESetFromOptions(self.fe) )
*
*/
/* 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":132
* CHKERR( PetscFESetFromOptions(self.fe) )
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( PetscFESetUp(self.fe) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_43setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_42setUp[] = "FE.setUp(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_43setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setUp (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_42setUp(((struct PyPetscFEObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_42setUp(struct PyPetscFEObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setUp", 0);
/* "petsc4py/PETSc/FE.pyx":133
*
* def setUp(self):
* CHKERR( PetscFESetUp(self.fe) ) # <<<<<<<<<<<<<<
*
* def getDualSpace(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetUp(__pyx_v_self->fe)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 133, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":132
* CHKERR( PetscFESetFromOptions(self.fe) )
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( PetscFESetUp(self.fe) )
*
*/
/* 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":135
* CHKERR( PetscFESetUp(self.fe) )
*
* def getDualSpace(self): # <<<<<<<<<<<<<<
* cdef DualSpace dspace = DualSpace()
* CHKERR( PetscFEGetDualSpace(self.fe, &dspace.dualspace) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_45getDualSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_44getDualSpace[] = "FE.getDualSpace(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_45getDualSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDualSpace (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDualSpace", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDualSpace", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_44getDualSpace(((struct PyPetscFEObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_44getDualSpace(struct PyPetscFEObject *__pyx_v_self) {
struct PyPetscDualSpaceObject *__pyx_v_dspace = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDualSpace", 0);
/* "petsc4py/PETSc/FE.pyx":136
*
* def getDualSpace(self):
* cdef DualSpace dspace = DualSpace() # <<<<<<<<<<<<<<
* CHKERR( PetscFEGetDualSpace(self.fe, &dspace.dualspace) )
* return dspace
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DualSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 136, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_dspace = ((struct PyPetscDualSpaceObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/FE.pyx":137
* def getDualSpace(self):
* cdef DualSpace dspace = DualSpace()
* CHKERR( PetscFEGetDualSpace(self.fe, &dspace.dualspace) ) # <<<<<<<<<<<<<<
* return dspace
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetDualSpace(__pyx_v_self->fe, (&__pyx_v_dspace->dualspace))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 137, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":138
* cdef DualSpace dspace = DualSpace()
* CHKERR( PetscFEGetDualSpace(self.fe, &dspace.dualspace) )
* return dspace # <<<<<<<<<<<<<<
*
* def setDualSpace(self, DualSpace dspace):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_dspace));
__pyx_r = ((PyObject *)__pyx_v_dspace);
goto __pyx_L0;
/* "petsc4py/PETSc/FE.pyx":135
* CHKERR( PetscFESetUp(self.fe) )
*
* def getDualSpace(self): # <<<<<<<<<<<<<<
* cdef DualSpace dspace = DualSpace()
* CHKERR( PetscFEGetDualSpace(self.fe, &dspace.dualspace) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.FE.getDualSpace", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_dspace);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/FE.pyx":140
* return dspace
*
* def setDualSpace(self, DualSpace dspace): # <<<<<<<<<<<<<<
* CHKERR( PetscFESetDualSpace(self.fe, dspace.dualspace) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_47setDualSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_46setDualSpace[] = "FE.setDualSpace(self, DualSpace dspace)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_47setDualSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscDualSpaceObject *__pyx_v_dspace = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dspace,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dspace)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDualSpace") < 0)) __PYX_ERR(42, 140, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_dspace = ((struct PyPetscDualSpaceObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDualSpace", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 140, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.FE.setDualSpace", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dspace), __pyx_ptype_8petsc4py_5PETSc_DualSpace, 0, "dspace", 0))) __PYX_ERR(42, 140, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_46setDualSpace(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_dspace);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_46setDualSpace(struct PyPetscFEObject *__pyx_v_self, struct PyPetscDualSpaceObject *__pyx_v_dspace) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setDualSpace", 0);
/* "petsc4py/PETSc/FE.pyx":141
*
* def setDualSpace(self, DualSpace dspace):
* CHKERR( PetscFESetDualSpace(self.fe, dspace.dualspace) ) # <<<<<<<<<<<<<<
*
* def viewFromOptions(self, name, Object obj=None):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetDualSpace(__pyx_v_self->fe, __pyx_v_dspace->dualspace)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 141, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":140
* return dspace
*
* def setDualSpace(self, DualSpace dspace): # <<<<<<<<<<<<<<
* CHKERR( PetscFESetDualSpace(self.fe, dspace.dualspace) )
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.FE.setDualSpace", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/FE.pyx":143
* CHKERR( PetscFESetDualSpace(self.fe, dspace.dualspace) )
*
* def viewFromOptions(self, name, Object obj=None): # <<<<<<<<<<<<<<
* cdef const char *cname = NULL
* _ = str2bytes(name, &cname)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_49viewFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2FE_48viewFromOptions[] = "FE.viewFromOptions(self, name, Object obj=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_49viewFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
struct PyPetscObjectObject *__pyx_v_obj = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_obj,0};
PyObject* values[2] = {0,0};
values[1] = (PyObject *)((struct PyPetscObjectObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "viewFromOptions") < 0)) __PYX_ERR(42, 143, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_name = values[0];
__pyx_v_obj = ((struct PyPetscObjectObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("viewFromOptions", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 143, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.FE.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "obj", 0))) __PYX_ERR(42, 143, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_48viewFromOptions(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_name, __pyx_v_obj);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_48viewFromOptions(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj) {
char const *__pyx_v_cname;
CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
PetscObject __pyx_v_cobj;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("viewFromOptions", 0);
/* "petsc4py/PETSc/FE.pyx":144
*
* def viewFromOptions(self, name, Object obj=None):
* cdef const char *cname = NULL # <<<<<<<<<<<<<<
* _ = str2bytes(name, &cname)
* cdef PetscObject cobj = NULL
*/
__pyx_v_cname = NULL;
/* "petsc4py/PETSc/FE.pyx":145
* def viewFromOptions(self, name, Object obj=None):
* cdef const char *cname = NULL
* _ = str2bytes(name, &cname) # <<<<<<<<<<<<<<
* cdef PetscObject cobj = NULL
* if obj is not None: cobj = obj.obj[0]
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 145, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v__ = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/FE.pyx":146
* cdef const char *cname = NULL
* _ = str2bytes(name, &cname)
* cdef PetscObject cobj = NULL # <<<<<<<<<<<<<<
* if obj is not None: cobj = obj.obj[0]
* CHKERR( PetscFEViewFromOptions(self.fe, cobj, cname) )
*/
__pyx_v_cobj = NULL;
/* "petsc4py/PETSc/FE.pyx":147
* _ = str2bytes(name, &cname)
* cdef PetscObject cobj = NULL
* if obj is not None: cobj = obj.obj[0] # <<<<<<<<<<<<<<
* CHKERR( PetscFEViewFromOptions(self.fe, cobj, cname) )
*
*/
__pyx_t_2 = (((PyObject *)__pyx_v_obj) != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_v_cobj = (__pyx_v_obj->obj[0]);
}
/* "petsc4py/PETSc/FE.pyx":148
* cdef PetscObject cobj = NULL
* if obj is not None: cobj = obj.obj[0]
* CHKERR( PetscFEViewFromOptions(self.fe, cobj, cname) ) # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEViewFromOptions(__pyx_v_self->fe, __pyx_v_cobj, __pyx_v_cname)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(42, 148, __pyx_L1_error)
/* "petsc4py/PETSc/FE.pyx":143
* CHKERR( PetscFESetDualSpace(self.fe, dspace.dualspace) )
*
* def viewFromOptions(self, name, Object obj=None): # <<<<<<<<<<<<<<
* cdef const char *cname = NULL
* _ = str2bytes(name, &cname)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.FE.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v__);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Scatter.pyx":22
* #
*
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter___cinit__(((struct PyPetscScatterObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_7Scatter___cinit__(struct PyPetscScatterObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/Scatter.pyx":23
*
* 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":24
* 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":22
* #
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.sct
* self.sct = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Scatter.pyx":26
* self.sct = NULL
*
* def __call__(self, x, y, addv=None, mode=None): # <<<<<<<<<<<<<<
* self.scatter(x, y, addv, mode)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_addv,&__pyx_n_s_mode,0};
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("__call__", 0, 2, 4, 1); __PYX_ERR(43, 26, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(43, 26, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_x = values[0];
__pyx_v_y = values[1];
__pyx_v_addv = values[2];
__pyx_v_mode = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__call__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 26, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_2__call__(struct PyPetscScatterObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__call__", 0);
/* "petsc4py/PETSc/Scatter.pyx":27
*
* def __call__(self, x, y, addv=None, mode=None):
* self.scatter(x, y, addv, mode) # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scatter); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 27, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
__pyx_t_4 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
__pyx_t_4 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_x, __pyx_v_y, __pyx_v_addv, __pyx_v_mode};
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 27, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_x, __pyx_v_y, __pyx_v_addv, __pyx_v_mode};
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 27, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else
#endif
{
__pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 27, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (__pyx_t_3) {
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
}
__Pyx_INCREF(__pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_x);
__Pyx_INCREF(__pyx_v_y);
__Pyx_GIVEREF(__pyx_v_y);
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_y);
__Pyx_INCREF(__pyx_v_addv);
__Pyx_GIVEREF(__pyx_v_addv);
PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_addv);
__Pyx_INCREF(__pyx_v_mode);
__Pyx_GIVEREF(__pyx_v_mode);
PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_mode);
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 27, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Scatter.pyx":26
* self.sct = NULL
*
* def __call__(self, x, y, addv=None, mode=None): # <<<<<<<<<<<<<<
* self.scatter(x, y, addv, mode)
*
*/
/* 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_5);
__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":31
* #
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Scatter_4view[] = "Scatter.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(43, 31, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 31, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Scatter.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(43, 31, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_4view(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/Scatter.pyx":32
*
* def view(self, Viewer viewer=None):
* 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":33
* def view(self, Viewer viewer=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
}
/* "petsc4py/PETSc/Scatter.pyx":34
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
* CHKERR( VecScatterView(self.sct, vwr) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterView(__pyx_v_self->sct, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 34, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":31
* #
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.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":36
* CHKERR( VecScatterView(self.sct, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( VecScatterDestroy(&self.sct) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Scatter_6destroy[] = "Scatter.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_6destroy(((struct PyPetscScatterObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_6destroy(struct PyPetscScatterObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/Scatter.pyx":37
*
* def destroy(self):
* 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(43, 37, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":38
* def destroy(self):
* CHKERR( VecScatterDestroy(&self.sct) )
* return self # <<<<<<<<<<<<<<
*
* def create(self, Vec vec_from, IS is_from or None,
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Scatter.pyx":36
* CHKERR( VecScatterView(self.sct, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( VecScatterDestroy(&self.sct) )
* return self
*/
/* 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":40
* return self
*
* def create(self, Vec vec_from, IS is_from or None, # <<<<<<<<<<<<<<
* Vec vec_to, IS is_to or None):
* cdef PetscIS cisfrom = NULL, cisto = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Scatter_8create[] = "Scatter.create(self, Vec vec_from, IS is_from, Vec vec_to, IS is_to)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("create (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_is_from,&__pyx_n_s_vec_to,&__pyx_n_s_is_to,0};
PyObject* values[4] = {0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_from)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_from)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("create", 1, 4, 4, 1); __PYX_ERR(43, 40, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_to)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("create", 1, 4, 4, 2); __PYX_ERR(43, 40, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_to)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("create", 1, 4, 4, 3); __PYX_ERR(43, 40, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(43, 40, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
}
__pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]);
__pyx_v_is_from = ((struct PyPetscISObject *)values[1]);
__pyx_v_vec_to = ((struct PyPetscVecObject *)values[2]);
__pyx_v_is_to = ((struct PyPetscISObject *)values[3]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 40, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Scatter.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(43, 40, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_is_from), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "is_from", 0))) __PYX_ERR(43, 40, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(43, 41, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_is_to), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "is_to", 0))) __PYX_ERR(43, 41, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_8create(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_vec_from, __pyx_v_is_from, __pyx_v_vec_to, __pyx_v_is_to);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
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("create", 0);
/* "petsc4py/PETSc/Scatter.pyx":42
* def create(self, Vec vec_from, IS is_from or None,
* Vec vec_to, IS is_to or None):
* 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":43
* Vec vec_to, IS is_to or None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_is_from->iset;
__pyx_v_cisfrom = __pyx_t_3;
}
/* "petsc4py/PETSc/Scatter.pyx":44
* 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_2 = (((PyObject *)__pyx_v_is_to) != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __pyx_v_is_to->iset;
__pyx_v_cisto = __pyx_t_3;
}
/* "petsc4py/PETSc/Scatter.pyx":45
* 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":46
* 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) )
* PetscCLEAR(self.obj); self.sct = newsct
*/
__pyx_t_4 = __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_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 46, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":48
* CHKERR( VecScatterCreate(
* vec_from.vec, cisfrom, vec_to.vec, cisto, &newsct) )
* PetscCLEAR(self.obj); self.sct = newsct # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->sct = __pyx_v_newsct;
/* "petsc4py/PETSc/Scatter.pyx":49
* vec_from.vec, cisfrom, vec_to.vec, cisto, &newsct) )
* PetscCLEAR(self.obj); self.sct = newsct
* return self # <<<<<<<<<<<<<<
*
* def setType(self, scatter_type):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Scatter.pyx":40
* return self
*
* def create(self, Vec vec_from, IS is_from or None, # <<<<<<<<<<<<<<
* Vec vec_to, IS is_to or None):
* cdef PetscIS cisfrom = NULL, cisto = NULL
*/
/* 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":51
* return self
*
* def setType(self, scatter_type): # <<<<<<<<<<<<<<
* cdef PetscScatterType cval = NULL
* vec_type = str2bytes(scatter_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Scatter_10setType[] = "Scatter.setType(self, scatter_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_scatter_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scatter_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scatter_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(43, 51, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_scatter_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 51, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_10setType(struct PyPetscScatterObject *__pyx_v_self, PyObject *__pyx_v_scatter_type) {
VecScatterType __pyx_v_cval;
CYTHON_UNUSED PyObject *__pyx_v_vec_type = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setType", 0);
/* "petsc4py/PETSc/Scatter.pyx":52
*
* def setType(self, scatter_type):
* cdef PetscScatterType cval = NULL # <<<<<<<<<<<<<<
* vec_type = str2bytes(scatter_type, &cval)
* CHKERR( VecScatterSetType(self.sct, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Scatter.pyx":53
* def setType(self, scatter_type):
* cdef PetscScatterType cval = NULL
* vec_type = str2bytes(scatter_type, &cval) # <<<<<<<<<<<<<<
* CHKERR( VecScatterSetType(self.sct, cval) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_scatter_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 53, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_vec_type = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Scatter.pyx":54
* cdef PetscScatterType cval = NULL
* vec_type = str2bytes(scatter_type, &cval)
* CHKERR( VecScatterSetType(self.sct, cval) ) # <<<<<<<<<<<<<<
*
* def getType(self):
*/
__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(43, 54, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":51
* return self
*
* def setType(self, scatter_type): # <<<<<<<<<<<<<<
* cdef PetscScatterType cval = NULL
* vec_type = str2bytes(scatter_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Scatter.setType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_vec_type);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Scatter.pyx":56
* CHKERR( VecScatterSetType(self.sct, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscScatterType cval = NULL
* CHKERR( VecScatterGetType(self.sct, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Scatter_12getType[] = "Scatter.getType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_12getType(((struct PyPetscScatterObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_12getType(struct PyPetscScatterObject *__pyx_v_self) {
VecScatterType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getType", 0);
/* "petsc4py/PETSc/Scatter.pyx":57
*
* def getType(self):
* cdef PetscScatterType cval = NULL # <<<<<<<<<<<<<<
* CHKERR( VecScatterGetType(self.sct, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Scatter.pyx":58
* def getType(self):
* 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(43, 58, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":59
* cdef PetscScatterType cval = NULL
* CHKERR( VecScatterGetType(self.sct, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def setFromOptions(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 59, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Scatter.pyx":56
* CHKERR( VecScatterSetType(self.sct, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscScatterType cval = NULL
* CHKERR( VecScatterGetType(self.sct, &cval) )
*/
/* 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":61
* return bytes2str(cval)
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( VecScatterSetFromOptions(self.sct) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_15setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Scatter_14setFromOptions[] = "Scatter.setFromOptions(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_15setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_14setFromOptions(((struct PyPetscScatterObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_14setFromOptions(struct PyPetscScatterObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFromOptions", 0);
/* "petsc4py/PETSc/Scatter.pyx":62
*
* def setFromOptions(self):
* CHKERR( VecScatterSetFromOptions(self.sct) ) # <<<<<<<<<<<<<<
*
* def setUp(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(43, 62, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":61
* return bytes2str(cval)
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( VecScatterSetFromOptions(self.sct) )
*
*/
/* 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":64
* CHKERR( VecScatterSetFromOptions(self.sct) )
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( VecScatterSetUp(self.sct) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_17setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Scatter_16setUp[] = "Scatter.setUp(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_17setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setUp (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_16setUp(((struct PyPetscScatterObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_16setUp(struct PyPetscScatterObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setUp", 0);
/* "petsc4py/PETSc/Scatter.pyx":65
*
* def setUp(self):
* 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(43, 65, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":66
* def setUp(self):
* CHKERR( VecScatterSetUp(self.sct) )
* return self # <<<<<<<<<<<<<<
*
* def copy(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Scatter.pyx":64
* CHKERR( VecScatterSetFromOptions(self.sct) )
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( VecScatterSetUp(self.sct) )
* return self
*/
/* 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":68
* return self
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef Scatter scatter = Scatter()
* CHKERR( VecScatterCopy(self.sct, &scatter.sct) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_19copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Scatter_18copy[] = "Scatter.copy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_19copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("copy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_18copy(((struct PyPetscScatterObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_18copy(struct PyPetscScatterObject *__pyx_v_self) {
struct PyPetscScatterObject *__pyx_v_scatter = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("copy", 0);
/* "petsc4py/PETSc/Scatter.pyx":69
*
* def copy(self):
* cdef Scatter scatter = Scatter() # <<<<<<<<<<<<<<
* CHKERR( VecScatterCopy(self.sct, &scatter.sct) )
* return scatter
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 69, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_scatter = ((struct PyPetscScatterObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Scatter.pyx":70
* def copy(self):
* cdef Scatter scatter = Scatter()
* CHKERR( VecScatterCopy(self.sct, &scatter.sct) ) # <<<<<<<<<<<<<<
* return scatter
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterCopy(__pyx_v_self->sct, (&__pyx_v_scatter->sct))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 70, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":71
* 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":68
* return self
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef Scatter scatter = Scatter()
* CHKERR( VecScatterCopy(self.sct, &scatter.sct) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Scatter.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_scatter);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Scatter.pyx":74
*
* @classmethod
* def toAll(cls, Vec vec): # <<<<<<<<<<<<<<
* cdef Scatter scatter = Scatter()
* cdef Vec ovec = Vec()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_21toAll(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Scatter_20toAll[] = "Scatter.toAll(type cls, Vec vec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_21toAll(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "toAll") < 0)) __PYX_ERR(43, 74, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("toAll", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 74, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Scatter.toAll", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(43, 74, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_20toAll(((PyTypeObject*)__pyx_v_cls), __pyx_v_vec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_20toAll(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscVecObject *__pyx_v_vec) {
struct PyPetscScatterObject *__pyx_v_scatter = 0;
struct PyPetscVecObject *__pyx_v_ovec = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("toAll", 0);
/* "petsc4py/PETSc/Scatter.pyx":75
* @classmethod
* def toAll(cls, Vec vec):
* cdef Scatter scatter = Scatter() # <<<<<<<<<<<<<<
* cdef Vec ovec = Vec()
* CHKERR( VecScatterCreateToAll(
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 75, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_scatter = ((struct PyPetscScatterObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Scatter.pyx":76
* def toAll(cls, Vec vec):
* cdef Scatter scatter = Scatter()
* cdef Vec ovec = Vec() # <<<<<<<<<<<<<<
* CHKERR( VecScatterCreateToAll(
* vec.vec, &scatter.sct, &ovec.vec) )
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 76, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ovec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Scatter.pyx":77
* cdef Scatter scatter = Scatter()
* cdef Vec ovec = Vec()
* CHKERR( VecScatterCreateToAll( # <<<<<<<<<<<<<<
* vec.vec, &scatter.sct, &ovec.vec) )
* return (scatter, ovec)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterCreateToAll(__pyx_v_vec->vec, (&__pyx_v_scatter->sct), (&__pyx_v_ovec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 77, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":79
* 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(43, 79, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_scatter));
__Pyx_GIVEREF(((PyObject *)__pyx_v_scatter));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_scatter));
__Pyx_INCREF(((PyObject *)__pyx_v_ovec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_ovec));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_ovec));
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Scatter.pyx":74
*
* @classmethod
* def toAll(cls, Vec vec): # <<<<<<<<<<<<<<
* cdef Scatter scatter = Scatter()
* cdef Vec ovec = Vec()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Scatter.toAll", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_scatter);
__Pyx_XDECREF((PyObject *)__pyx_v_ovec);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Scatter.pyx":82
*
* @classmethod
* def toZero(cls, Vec vec): # <<<<<<<<<<<<<<
* cdef Scatter scatter = Scatter()
* cdef Vec ovec = Vec()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_23toZero(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Scatter_22toZero[] = "Scatter.toZero(type cls, Vec vec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_23toZero(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "toZero") < 0)) __PYX_ERR(43, 82, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("toZero", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 82, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Scatter.toZero", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(43, 82, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_22toZero(((PyTypeObject*)__pyx_v_cls), __pyx_v_vec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_22toZero(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscVecObject *__pyx_v_vec) {
struct PyPetscScatterObject *__pyx_v_scatter = 0;
struct PyPetscVecObject *__pyx_v_ovec = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("toZero", 0);
/* "petsc4py/PETSc/Scatter.pyx":83
* @classmethod
* def toZero(cls, Vec vec):
* cdef Scatter scatter = Scatter() # <<<<<<<<<<<<<<
* cdef Vec ovec = Vec()
* CHKERR( VecScatterCreateToZero(
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_scatter = ((struct PyPetscScatterObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Scatter.pyx":84
* def toZero(cls, Vec vec):
* cdef Scatter scatter = Scatter()
* cdef Vec ovec = Vec() # <<<<<<<<<<<<<<
* CHKERR( VecScatterCreateToZero(
* vec.vec, &scatter.sct, &ovec.vec) )
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ovec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Scatter.pyx":85
* cdef Scatter scatter = Scatter()
* cdef Vec ovec = Vec()
* CHKERR( VecScatterCreateToZero( # <<<<<<<<<<<<<<
* vec.vec, &scatter.sct, &ovec.vec) )
* return (scatter, ovec)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterCreateToZero(__pyx_v_vec->vec, (&__pyx_v_scatter->sct), (&__pyx_v_ovec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 85, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":87
* 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(43, 87, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_scatter));
__Pyx_GIVEREF(((PyObject *)__pyx_v_scatter));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_scatter));
__Pyx_INCREF(((PyObject *)__pyx_v_ovec));
__Pyx_GIVEREF(((PyObject *)__pyx_v_ovec));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_ovec));
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Scatter.pyx":82
*
* @classmethod
* def toZero(cls, Vec vec): # <<<<<<<<<<<<<<
* cdef Scatter scatter = Scatter()
* cdef Vec ovec = Vec()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Scatter.toZero", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_scatter);
__Pyx_XDECREF((PyObject *)__pyx_v_ovec);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Scatter.pyx":90
* #
*
* def begin(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_25begin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Scatter_24begin[] = "Scatter.begin(self, Vec vec_from, Vec vec_to, addv=None, mode=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_25begin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec_from = 0;
struct PyPetscVecObject *__pyx_v_vec_to = 0;
PyObject *__pyx_v_addv = 0;
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_vec_to,&__pyx_n_s_addv,&__pyx_n_s_mode,0};
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_from)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_to)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("begin", 0, 2, 4, 1); __PYX_ERR(43, 90, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "begin") < 0)) __PYX_ERR(43, 90, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]);
__pyx_v_vec_to = ((struct PyPetscVecObject *)values[1]);
__pyx_v_addv = values[2];
__pyx_v_mode = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("begin", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 90, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Scatter.begin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(43, 90, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(43, 90, __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);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":91
*
* def begin(self, Vec vec_from, Vec vec_to, addv=None, mode=None):
* 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(43, 91, __pyx_L1_error)
__pyx_v_caddv = __pyx_t_1;
/* "petsc4py/PETSc/Scatter.pyx":92
* def begin(self, Vec vec_from, Vec vec_to, addv=None, mode=None):
* 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(43, 92, __pyx_L1_error)
__pyx_v_csctm = __pyx_t_2;
/* "petsc4py/PETSc/Scatter.pyx":93
* 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(43, 93, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":90
* #
*
* def begin(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* 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":96
* caddv, csctm) )
*
* def end(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_27end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Scatter_26end[] = "Scatter.end(self, Vec vec_from, Vec vec_to, addv=None, mode=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_27end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec_from = 0;
struct PyPetscVecObject *__pyx_v_vec_to = 0;
PyObject *__pyx_v_addv = 0;
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_vec_to,&__pyx_n_s_addv,&__pyx_n_s_mode,0};
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_from)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_to)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("end", 0, 2, 4, 1); __PYX_ERR(43, 96, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "end") < 0)) __PYX_ERR(43, 96, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]);
__pyx_v_vec_to = ((struct PyPetscVecObject *)values[1]);
__pyx_v_addv = values[2];
__pyx_v_mode = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("end", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 96, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Scatter.end", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(43, 96, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(43, 96, __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);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":97
*
* def end(self, Vec vec_from, Vec vec_to, addv=None, mode=None):
* 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(43, 97, __pyx_L1_error)
__pyx_v_caddv = __pyx_t_1;
/* "petsc4py/PETSc/Scatter.pyx":98
* def end(self, Vec vec_from, Vec vec_to, addv=None, mode=None):
* 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(43, 98, __pyx_L1_error)
__pyx_v_csctm = __pyx_t_2;
/* "petsc4py/PETSc/Scatter.pyx":99
* 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(43, 99, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":96
* caddv, csctm) )
*
* def end(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* 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":104
* #
*
* def scatterBegin(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_29scatterBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Scatter_28scatterBegin[] = "Scatter.scatterBegin(self, Vec vec_from, Vec vec_to, addv=None, mode=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_29scatterBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec_from = 0;
struct PyPetscVecObject *__pyx_v_vec_to = 0;
PyObject *__pyx_v_addv = 0;
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_vec_to,&__pyx_n_s_addv,&__pyx_n_s_mode,0};
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_from)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_to)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("scatterBegin", 0, 2, 4, 1); __PYX_ERR(43, 104, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scatterBegin") < 0)) __PYX_ERR(43, 104, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]);
__pyx_v_vec_to = ((struct PyPetscVecObject *)values[1]);
__pyx_v_addv = values[2];
__pyx_v_mode = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("scatterBegin", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 104, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Scatter.scatterBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(43, 104, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(43, 104, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_28scatterBegin(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_vec_from, __pyx_v_vec_to, __pyx_v_addv, __pyx_v_mode);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_28scatterBegin(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("scatterBegin", 0);
/* "petsc4py/PETSc/Scatter.pyx":105
*
* def scatterBegin(self, Vec vec_from, Vec vec_to, addv=None, mode=None):
* 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(43, 105, __pyx_L1_error)
__pyx_v_caddv = __pyx_t_1;
/* "petsc4py/PETSc/Scatter.pyx":106
* def scatterBegin(self, Vec vec_from, Vec vec_to, addv=None, mode=None):
* 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(43, 106, __pyx_L1_error)
__pyx_v_csctm = __pyx_t_2;
/* "petsc4py/PETSc/Scatter.pyx":107
* 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(43, 107, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":104
* #
*
* def scatterBegin(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Scatter.scatterBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Scatter.pyx":110
* caddv, csctm) )
*
* def scatterEnd(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_31scatterEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Scatter_30scatterEnd[] = "Scatter.scatterEnd(self, Vec vec_from, Vec vec_to, addv=None, mode=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_31scatterEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec_from = 0;
struct PyPetscVecObject *__pyx_v_vec_to = 0;
PyObject *__pyx_v_addv = 0;
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_vec_to,&__pyx_n_s_addv,&__pyx_n_s_mode,0};
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_from)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_to)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("scatterEnd", 0, 2, 4, 1); __PYX_ERR(43, 110, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scatterEnd") < 0)) __PYX_ERR(43, 110, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]);
__pyx_v_vec_to = ((struct PyPetscVecObject *)values[1]);
__pyx_v_addv = values[2];
__pyx_v_mode = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("scatterEnd", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 110, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Scatter.scatterEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(43, 110, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(43, 110, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_30scatterEnd(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_vec_from, __pyx_v_vec_to, __pyx_v_addv, __pyx_v_mode);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_30scatterEnd(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("scatterEnd", 0);
/* "petsc4py/PETSc/Scatter.pyx":111
*
* def scatterEnd(self, Vec vec_from, Vec vec_to, addv=None, mode=None):
* 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(43, 111, __pyx_L1_error)
__pyx_v_caddv = __pyx_t_1;
/* "petsc4py/PETSc/Scatter.pyx":112
* def scatterEnd(self, Vec vec_from, Vec vec_to, addv=None, mode=None):
* 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(43, 112, __pyx_L1_error)
__pyx_v_csctm = __pyx_t_2;
/* "petsc4py/PETSc/Scatter.pyx":113
* 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(43, 113, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":110
* caddv, csctm) )
*
* def scatterEnd(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Scatter.scatterEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Scatter.pyx":116
* caddv, csctm) )
*
* def scatter(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_33scatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Scatter_32scatter[] = "Scatter.scatter(self, Vec vec_from, Vec vec_to, addv=None, mode=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_33scatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec_from = 0;
struct PyPetscVecObject *__pyx_v_vec_to = 0;
PyObject *__pyx_v_addv = 0;
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_vec_to,&__pyx_n_s_addv,&__pyx_n_s_mode,0};
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_from)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_to)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("scatter", 0, 2, 4, 1); __PYX_ERR(43, 116, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scatter") < 0)) __PYX_ERR(43, 116, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]);
__pyx_v_vec_to = ((struct PyPetscVecObject *)values[1]);
__pyx_v_addv = values[2];
__pyx_v_mode = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("scatter", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 116, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Scatter.scatter", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(43, 116, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(43, 116, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_32scatter(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_vec_from, __pyx_v_vec_to, __pyx_v_addv, __pyx_v_mode);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_32scatter(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":117
*
* def scatter(self, Vec vec_from, Vec vec_to, addv=None, mode=None):
* 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(43, 117, __pyx_L1_error)
__pyx_v_caddv = __pyx_t_1;
/* "petsc4py/PETSc/Scatter.pyx":118
* def scatter(self, Vec vec_from, Vec vec_to, addv=None, mode=None):
* 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(43, 118, __pyx_L1_error)
__pyx_v_csctm = __pyx_t_2;
/* "petsc4py/PETSc/Scatter.pyx":119
* 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(43, 119, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":121
* 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(43, 121, __pyx_L1_error)
/* "petsc4py/PETSc/Scatter.pyx":116
* caddv, csctm) )
*
* def scatter(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* cdef PetscScatterMode csctm = scattermode(mode)
*/
/* 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":5
* cdef class Section(Object):
*
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section___cinit__(((struct PyPetscSectionObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_7Section___cinit__(struct PyPetscSectionObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/Section.pyx":6
*
* 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":7
* def __cinit__(self):
* self.obj = <PetscObject*> &self.sec
* self.sec = NULL # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
__pyx_v_self->sec = NULL;
/* "petsc4py/PETSc/Section.pyx":5
* cdef class Section(Object):
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.sec
* self.sec = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Section.pyx":9
* self.sec = NULL
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSectionDestroy(&self.sec) )
* self.sec = NULL
*/
/* Python wrapper */
static void __pyx_pw_8petsc4py_5PETSc_7Section_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8petsc4py_5PETSc_7Section_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
__pyx_pf_8petsc4py_5PETSc_7Section_2__dealloc__(((struct PyPetscSectionObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
static void __pyx_pf_8petsc4py_5PETSc_7Section_2__dealloc__(struct PyPetscSectionObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__dealloc__", 0);
/* "petsc4py/PETSc/Section.pyx":10
*
* def __dealloc__(self):
* CHKERR( PetscSectionDestroy(&self.sec) ) # <<<<<<<<<<<<<<
* self.sec = NULL
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionDestroy((&__pyx_v_self->sec))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 10, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":11
* def __dealloc__(self):
* CHKERR( PetscSectionDestroy(&self.sec) )
* self.sec = NULL # <<<<<<<<<<<<<<
*
* def view(self, Viewer viewer=None):
*/
__pyx_v_self->sec = NULL;
/* "petsc4py/PETSc/Section.pyx":9
* self.sec = NULL
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSectionDestroy(&self.sec) )
* self.sec = NULL
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_WriteUnraisable("petsc4py.PETSc.Section.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
/* "petsc4py/PETSc/Section.pyx":13
* self.sec = NULL
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_4view[] = "Section.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(44, 13, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 13, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(44, 13, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_4view(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_4view(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) {
PetscViewer __pyx_v_vwr;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/Section.pyx":14
*
* def view(self, Viewer viewer=None):
* 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":15
* def view(self, Viewer viewer=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
}
/* "petsc4py/PETSc/Section.pyx":16
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
* CHKERR( PetscSectionView(self.sec, vwr) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionView(__pyx_v_self->sec, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 16, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":13
* self.sec = NULL
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.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":18
* CHKERR( PetscSectionView(self.sec, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSectionDestroy(&self.sec) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_6destroy[] = "Section.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_6destroy(((struct PyPetscSectionObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_6destroy(struct PyPetscSectionObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/Section.pyx":19
*
* def destroy(self):
* 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(44, 19, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":20
* def destroy(self):
* CHKERR( PetscSectionDestroy(&self.sec) )
* return self # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":18
* CHKERR( PetscSectionView(self.sec, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSectionDestroy(&self.sec) )
* return self
*/
/* 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":22
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSection newsec = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_8create[] = "Section.create(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(44, 22, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 22, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_8create(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_8create(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_comm) {
MPI_Comm __pyx_v_ccomm;
PetscSection __pyx_v_newsec;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("create", 0);
/* "petsc4py/PETSc/Section.pyx":23
*
* def create(self, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(44, 23, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":24
* def create(self, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSection newsec = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscSectionCreate(ccomm, &newsec) )
* PetscCLEAR(self.obj); self.sec = newsec
*/
__pyx_v_newsec = NULL;
/* "petsc4py/PETSc/Section.pyx":25
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSection newsec = NULL
* CHKERR( PetscSectionCreate(ccomm, &newsec) ) # <<<<<<<<<<<<<<
* 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(44, 25, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":26
* cdef PetscSection newsec = NULL
* CHKERR( PetscSectionCreate(ccomm, &newsec) )
* PetscCLEAR(self.obj); self.sec = newsec # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->sec = __pyx_v_newsec;
/* "petsc4py/PETSc/Section.pyx":27
* CHKERR( PetscSectionCreate(ccomm, &newsec) )
* PetscCLEAR(self.obj); self.sec = newsec
* return self # <<<<<<<<<<<<<<
*
* def clone(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":22
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSection newsec = NULL
*/
/* 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":29
* return self
*
* def clone(self): # <<<<<<<<<<<<<<
* cdef Section sec = <Section>type(self)()
* CHKERR( PetscSectionClone(self.sec, &sec.sec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_11clone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_10clone[] = "Section.clone(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_11clone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("clone (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("clone", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clone", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_10clone(((struct PyPetscSectionObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_10clone(struct PyPetscSectionObject *__pyx_v_self) {
struct PyPetscSectionObject *__pyx_v_sec = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("clone", 0);
/* "petsc4py/PETSc/Section.pyx":30
*
* def clone(self):
* cdef Section sec = <Section>type(self)() # <<<<<<<<<<<<<<
* CHKERR( PetscSectionClone(self.sec, &sec.sec) )
* return sec
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 30, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Section.pyx":31
* def clone(self):
* cdef Section sec = <Section>type(self)()
* CHKERR( PetscSectionClone(self.sec, &sec.sec) ) # <<<<<<<<<<<<<<
* return sec
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionClone(__pyx_v_self->sec, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 31, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":32
* cdef Section sec = <Section>type(self)()
* CHKERR( PetscSectionClone(self.sec, &sec.sec) )
* return sec # <<<<<<<<<<<<<<
*
* def setUp(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_sec));
__pyx_r = ((PyObject *)__pyx_v_sec);
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":29
* return self
*
* def clone(self): # <<<<<<<<<<<<<<
* cdef Section sec = <Section>type(self)()
* CHKERR( PetscSectionClone(self.sec, &sec.sec) )
*/
/* 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":34
* return sec
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSectionSetUp(self.sec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_13setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_12setUp[] = "Section.setUp(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_13setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setUp (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_12setUp(((struct PyPetscSectionObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_12setUp(struct PyPetscSectionObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setUp", 0);
/* "petsc4py/PETSc/Section.pyx":35
*
* def setUp(self):
* CHKERR( PetscSectionSetUp(self.sec) ) # <<<<<<<<<<<<<<
*
* def reset(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetUp(__pyx_v_self->sec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 35, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":34
* return sec
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSectionSetUp(self.sec) )
*
*/
/* 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":37
* CHKERR( PetscSectionSetUp(self.sec) )
*
* def reset(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSectionReset(self.sec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_15reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_14reset[] = "Section.reset(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_15reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_14reset(((struct PyPetscSectionObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_14reset(struct PyPetscSectionObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reset", 0);
/* "petsc4py/PETSc/Section.pyx":38
*
* def reset(self):
* CHKERR( PetscSectionReset(self.sec) ) # <<<<<<<<<<<<<<
*
* def getNumFields(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionReset(__pyx_v_self->sec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 38, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":37
* CHKERR( PetscSectionSetUp(self.sec) )
*
* def reset(self): # <<<<<<<<<<<<<<
* CHKERR( PetscSectionReset(self.sec) )
*
*/
/* 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":40
* CHKERR( PetscSectionReset(self.sec) )
*
* def getNumFields(self): # <<<<<<<<<<<<<<
* cdef PetscInt numFields = 0
* CHKERR( PetscSectionGetNumFields(self.sec, &numFields) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_17getNumFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_16getNumFields[] = "Section.getNumFields(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_17getNumFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNumFields (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNumFields", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumFields", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_16getNumFields(((struct PyPetscSectionObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_16getNumFields(struct PyPetscSectionObject *__pyx_v_self) {
PetscInt __pyx_v_numFields;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNumFields", 0);
/* "petsc4py/PETSc/Section.pyx":41
*
* def getNumFields(self):
* cdef PetscInt numFields = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscSectionGetNumFields(self.sec, &numFields) )
* return toInt(numFields)
*/
__pyx_v_numFields = 0;
/* "petsc4py/PETSc/Section.pyx":42
* def getNumFields(self):
* 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(44, 42, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":43
* cdef PetscInt numFields = 0
* CHKERR( PetscSectionGetNumFields(self.sec, &numFields) )
* return toInt(numFields) # <<<<<<<<<<<<<<
*
* def setNumFields(self,numFields):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_numFields); if (unlikely(!__pyx_t_2)) __PYX_ERR(44, 43, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":40
* CHKERR( PetscSectionReset(self.sec) )
*
* def getNumFields(self): # <<<<<<<<<<<<<<
* cdef PetscInt numFields = 0
* CHKERR( PetscSectionGetNumFields(self.sec, &numFields) )
*/
/* 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":45
* return toInt(numFields)
*
* def setNumFields(self,numFields): # <<<<<<<<<<<<<<
* cdef PetscInt cnumFields = asInt(numFields)
* CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_19setNumFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_18setNumFields[] = "Section.setNumFields(self, numFields)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_19setNumFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_numFields = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_numFields,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numFields)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNumFields") < 0)) __PYX_ERR(44, 45, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_numFields = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setNumFields", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 45, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.setNumFields", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_18setNumFields(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_numFields);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_18setNumFields(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_numFields) {
PetscInt __pyx_v_cnumFields;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setNumFields", 0);
/* "petsc4py/PETSc/Section.pyx":46
*
* def setNumFields(self,numFields):
* 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(44, 46, __pyx_L1_error)
__pyx_v_cnumFields = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":47
* def setNumFields(self,numFields):
* cdef PetscInt cnumFields = asInt(numFields)
* CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) ) # <<<<<<<<<<<<<<
*
* def getFieldName(self,field):
*/
__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(44, 47, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":45
* return toInt(numFields)
*
* def setNumFields(self,numFields): # <<<<<<<<<<<<<<
* cdef PetscInt cnumFields = asInt(numFields)
* CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) )
*/
/* 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":49
* CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) )
*
* def getFieldName(self,field): # <<<<<<<<<<<<<<
* cdef PetscInt cfield = asInt(field)
* cdef const char *fieldName = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_21getFieldName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_20getFieldName[] = "Section.getFieldName(self, field)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_21getFieldName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_field = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFieldName") < 0)) __PYX_ERR(44, 49, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_field = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getFieldName", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 49, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_20getFieldName(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_20getFieldName(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field) {
PetscInt __pyx_v_cfield;
char const *__pyx_v_fieldName;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFieldName", 0);
/* "petsc4py/PETSc/Section.pyx":50
*
* def getFieldName(self,field):
* 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(44, 50, __pyx_L1_error)
__pyx_v_cfield = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":51
* def getFieldName(self,field):
* 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":52
* 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(44, 52, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":53
* cdef const char *fieldName = NULL
* CHKERR( PetscSectionGetFieldName(self.sec,cfield,&fieldName) )
* return bytes2str(fieldName) # <<<<<<<<<<<<<<
*
* def setFieldName(self,field,fieldName):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_fieldName); if (unlikely(!__pyx_t_3)) __PYX_ERR(44, 53, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":49
* CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) )
*
* def getFieldName(self,field): # <<<<<<<<<<<<<<
* cdef PetscInt cfield = asInt(field)
* cdef const char *fieldName = NULL
*/
/* 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":55
* return bytes2str(fieldName)
*
* def setFieldName(self,field,fieldName): # <<<<<<<<<<<<<<
* cdef PetscInt cfield = asInt(field)
* cdef const char *cname = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_23setFieldName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_22setFieldName[] = "Section.setFieldName(self, field, fieldName)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_23setFieldName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_field = 0;
PyObject *__pyx_v_fieldName = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_fieldName,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fieldName)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setFieldName", 1, 2, 2, 1); __PYX_ERR(44, 55, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldName") < 0)) __PYX_ERR(44, 55, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_field = values[0];
__pyx_v_fieldName = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFieldName", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 55, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_22setFieldName(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field, __pyx_v_fieldName);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_22setFieldName(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_fieldName) {
PetscInt __pyx_v_cfield;
char const *__pyx_v_cname;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFieldName", 0);
__Pyx_INCREF(__pyx_v_fieldName);
/* "petsc4py/PETSc/Section.pyx":56
*
* def setFieldName(self,field,fieldName):
* 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(44, 56, __pyx_L1_error)
__pyx_v_cfield = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":57
* def setFieldName(self,field,fieldName):
* 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":58
* 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(44, 58, __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":59
* cdef const char *cname = NULL
* fieldName = str2bytes(fieldName, &cname)
* CHKERR( PetscSectionSetFieldName(self.sec,cfield,cname) ) # <<<<<<<<<<<<<<
*
* def getFieldComponents(self,field):
*/
__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(44, 59, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":55
* return bytes2str(fieldName)
*
* def setFieldName(self,field,fieldName): # <<<<<<<<<<<<<<
* cdef PetscInt cfield = asInt(field)
* cdef const char *cname = NULL
*/
/* 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":61
* CHKERR( PetscSectionSetFieldName(self.sec,cfield,cname) )
*
* def getFieldComponents(self,field): # <<<<<<<<<<<<<<
* cdef PetscInt cfield = asInt(field), cnumComp = 0
* CHKERR( PetscSectionGetFieldComponents(self.sec,cfield,&cnumComp) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_25getFieldComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_24getFieldComponents[] = "Section.getFieldComponents(self, field)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_25getFieldComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_field = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFieldComponents") < 0)) __PYX_ERR(44, 61, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_field = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getFieldComponents", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 61, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldComponents", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_24getFieldComponents(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_24getFieldComponents(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field) {
PetscInt __pyx_v_cfield;
PetscInt __pyx_v_cnumComp;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFieldComponents", 0);
/* "petsc4py/PETSc/Section.pyx":62
*
* def getFieldComponents(self,field):
* 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(44, 62, __pyx_L1_error)
__pyx_v_cfield = __pyx_t_1;
__pyx_v_cnumComp = 0;
/* "petsc4py/PETSc/Section.pyx":63
* def getFieldComponents(self,field):
* 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(44, 63, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":64
* cdef PetscInt cfield = asInt(field), cnumComp = 0
* CHKERR( PetscSectionGetFieldComponents(self.sec,cfield,&cnumComp) )
* return toInt(cnumComp) # <<<<<<<<<<<<<<
*
* def setFieldComponents(self,field,numComp):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumComp); if (unlikely(!__pyx_t_3)) __PYX_ERR(44, 64, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":61
* CHKERR( PetscSectionSetFieldName(self.sec,cfield,cname) )
*
* def getFieldComponents(self,field): # <<<<<<<<<<<<<<
* cdef PetscInt cfield = asInt(field), cnumComp = 0
* CHKERR( PetscSectionGetFieldComponents(self.sec,cfield,&cnumComp) )
*/
/* 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":66
* return toInt(cnumComp)
*
* def setFieldComponents(self,field,numComp): # <<<<<<<<<<<<<<
* cdef PetscInt cfield = asInt(field)
* cdef PetscInt cnumComp = asInt(numComp)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_27setFieldComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_26setFieldComponents[] = "Section.setFieldComponents(self, field, numComp)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_27setFieldComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_field = 0;
PyObject *__pyx_v_numComp = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_numComp,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numComp)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setFieldComponents", 1, 2, 2, 1); __PYX_ERR(44, 66, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldComponents") < 0)) __PYX_ERR(44, 66, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_field = values[0];
__pyx_v_numComp = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFieldComponents", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 66, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldComponents", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_26setFieldComponents(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field, __pyx_v_numComp);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_26setFieldComponents(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_numComp) {
PetscInt __pyx_v_cfield;
PetscInt __pyx_v_cnumComp;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFieldComponents", 0);
/* "petsc4py/PETSc/Section.pyx":67
*
* def setFieldComponents(self,field,numComp):
* 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(44, 67, __pyx_L1_error)
__pyx_v_cfield = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":68
* def setFieldComponents(self,field,numComp):
* 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(44, 68, __pyx_L1_error)
__pyx_v_cnumComp = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":69
* cdef PetscInt cfield = asInt(field)
* cdef PetscInt cnumComp = asInt(numComp)
* CHKERR( PetscSectionSetFieldComponents(self.sec,cfield,cnumComp) ) # <<<<<<<<<<<<<<
*
* def getChart(self):
*/
__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(44, 69, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":66
* return toInt(cnumComp)
*
* def setFieldComponents(self,field,numComp): # <<<<<<<<<<<<<<
* cdef PetscInt cfield = asInt(field)
* cdef PetscInt cnumComp = asInt(numComp)
*/
/* 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":71
* CHKERR( PetscSectionSetFieldComponents(self.sec,cfield,cnumComp) )
*
* def getChart(self): # <<<<<<<<<<<<<<
* cdef PetscInt pStart = 0, pEnd = 0
* CHKERR( PetscSectionGetChart(self.sec, &pStart, &pEnd) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_29getChart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_28getChart[] = "Section.getChart(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_29getChart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getChart (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getChart", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getChart", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_28getChart(((struct PyPetscSectionObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_28getChart(struct PyPetscSectionObject *__pyx_v_self) {
PetscInt __pyx_v_pStart;
PetscInt __pyx_v_pEnd;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getChart", 0);
/* "petsc4py/PETSc/Section.pyx":72
*
* def getChart(self):
* 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":73
* def getChart(self):
* 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(44, 73, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":74
* cdef PetscInt pStart = 0, pEnd = 0
* CHKERR( PetscSectionGetChart(self.sec, &pStart, &pEnd) )
* return toInt(pStart), toInt(pEnd) # <<<<<<<<<<<<<<
*
* def setChart(self, pStart, pEnd):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_pStart); if (unlikely(!__pyx_t_2)) __PYX_ERR(44, 74, __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(44, 74, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(44, 74, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":71
* CHKERR( PetscSectionSetFieldComponents(self.sec,cfield,cnumComp) )
*
* def getChart(self): # <<<<<<<<<<<<<<
* cdef PetscInt pStart = 0, pEnd = 0
* CHKERR( PetscSectionGetChart(self.sec, &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.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":76
* return toInt(pStart), toInt(pEnd)
*
* def setChart(self, pStart, pEnd): # <<<<<<<<<<<<<<
* cdef PetscInt cStart = asInt(pStart)
* cdef PetscInt cEnd = asInt(pEnd)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_31setChart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_30setChart[] = "Section.setChart(self, pStart, pEnd)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_31setChart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_pStart = 0;
PyObject *__pyx_v_pEnd = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pStart,&__pyx_n_s_pEnd,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pStart)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pEnd)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setChart", 1, 2, 2, 1); __PYX_ERR(44, 76, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setChart") < 0)) __PYX_ERR(44, 76, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_pStart = values[0];
__pyx_v_pEnd = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setChart", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 76, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.setChart", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_30setChart(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_pStart, __pyx_v_pEnd);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_30setChart(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_pStart, PyObject *__pyx_v_pEnd) {
PetscInt __pyx_v_cStart;
PetscInt __pyx_v_cEnd;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setChart", 0);
/* "petsc4py/PETSc/Section.pyx":77
*
* def setChart(self, pStart, pEnd):
* 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(44, 77, __pyx_L1_error)
__pyx_v_cStart = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":78
* def setChart(self, pStart, pEnd):
* 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(44, 78, __pyx_L1_error)
__pyx_v_cEnd = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":79
* cdef PetscInt cStart = asInt(pStart)
* cdef PetscInt cEnd = asInt(pEnd)
* CHKERR( PetscSectionSetChart(self.sec, cStart, cEnd) ) # <<<<<<<<<<<<<<
*
* def getPermutation(self):
*/
__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(44, 79, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":76
* return toInt(pStart), toInt(pEnd)
*
* def setChart(self, pStart, pEnd): # <<<<<<<<<<<<<<
* cdef PetscInt cStart = asInt(pStart)
* cdef PetscInt cEnd = asInt(pEnd)
*/
/* 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":81
* CHKERR( PetscSectionSetChart(self.sec, cStart, cEnd) )
*
* def getPermutation(self): # <<<<<<<<<<<<<<
* cdef IS perm = IS()
* CHKERR( PetscSectionGetPermutation(self.sec, &perm.iset))
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_33getPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_32getPermutation[] = "Section.getPermutation(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_33getPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getPermutation (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getPermutation", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPermutation", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_32getPermutation(((struct PyPetscSectionObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_32getPermutation(struct PyPetscSectionObject *__pyx_v_self) {
struct PyPetscISObject *__pyx_v_perm = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getPermutation", 0);
/* "petsc4py/PETSc/Section.pyx":82
*
* def getPermutation(self):
* cdef IS perm = IS() # <<<<<<<<<<<<<<
* CHKERR( PetscSectionGetPermutation(self.sec, &perm.iset))
* PetscINCREF(perm.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 82, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_perm = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Section.pyx":83
* def getPermutation(self):
* cdef IS perm = IS()
* CHKERR( PetscSectionGetPermutation(self.sec, &perm.iset)) # <<<<<<<<<<<<<<
* PetscINCREF(perm.obj)
* return perm
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetPermutation(__pyx_v_self->sec, (&__pyx_v_perm->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 83, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":84
* cdef IS perm = IS()
* CHKERR( PetscSectionGetPermutation(self.sec, &perm.iset))
* PetscINCREF(perm.obj) # <<<<<<<<<<<<<<
* return perm
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_perm->__pyx_base.obj));
/* "petsc4py/PETSc/Section.pyx":85
* CHKERR( PetscSectionGetPermutation(self.sec, &perm.iset))
* PetscINCREF(perm.obj)
* return perm # <<<<<<<<<<<<<<
*
* def setPermutation(self, IS perm):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_perm));
__pyx_r = ((PyObject *)__pyx_v_perm);
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":81
* CHKERR( PetscSectionSetChart(self.sec, cStart, cEnd) )
*
* def getPermutation(self): # <<<<<<<<<<<<<<
* cdef IS perm = IS()
* CHKERR( PetscSectionGetPermutation(self.sec, &perm.iset))
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Section.getPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_perm);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Section.pyx":87
* return perm
*
* def setPermutation(self, IS perm): # <<<<<<<<<<<<<<
* CHKERR( PetscSectionSetPermutation(self.sec, perm.iset))
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_35setPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_34setPermutation[] = "Section.setPermutation(self, IS perm)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_35setPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_perm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_perm,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_perm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPermutation") < 0)) __PYX_ERR(44, 87, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_perm = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPermutation", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 87, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.setPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_perm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "perm", 0))) __PYX_ERR(44, 87, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_34setPermutation(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_perm);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_34setPermutation(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_perm) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setPermutation", 0);
/* "petsc4py/PETSc/Section.pyx":88
*
* def setPermutation(self, IS perm):
* CHKERR( PetscSectionSetPermutation(self.sec, perm.iset)) # <<<<<<<<<<<<<<
*
* def getDof(self,point):
*/
__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(44, 88, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":87
* return perm
*
* def setPermutation(self, IS perm): # <<<<<<<<<<<<<<
* CHKERR( PetscSectionSetPermutation(self.sec, perm.iset))
*
*/
/* 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":90
* CHKERR( PetscSectionSetPermutation(self.sec, perm.iset))
*
* def getDof(self,point): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point), cnumDof = 0
* CHKERR( PetscSectionGetDof(self.sec,cpoint,&cnumDof) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_37getDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_36getDof[] = "Section.getDof(self, point)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_37getDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getDof") < 0)) __PYX_ERR(44, 90, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_point = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getDof", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 90, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.getDof", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_36getDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_36getDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cnumDof;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDof", 0);
/* "petsc4py/PETSc/Section.pyx":91
*
* def getDof(self,point):
* 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(44, 91, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
__pyx_v_cnumDof = 0;
/* "petsc4py/PETSc/Section.pyx":92
* def getDof(self,point):
* 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(44, 92, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":93
* cdef PetscInt cpoint = asInt(point), cnumDof = 0
* CHKERR( PetscSectionGetDof(self.sec,cpoint,&cnumDof) )
* return toInt(cnumDof) # <<<<<<<<<<<<<<
*
* def setDof(self,point,numDof):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumDof); if (unlikely(!__pyx_t_3)) __PYX_ERR(44, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":90
* CHKERR( PetscSectionSetPermutation(self.sec, perm.iset))
*
* def getDof(self,point): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point), cnumDof = 0
* CHKERR( PetscSectionGetDof(self.sec,cpoint,&cnumDof) )
*/
/* 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":95
* return toInt(cnumDof)
*
* def setDof(self,point,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cnumDof = asInt(numDof)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_39setDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_38setDof[] = "Section.setDof(self, point, numDof)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_39setDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_numDof = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_numDof,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setDof", 1, 2, 2, 1); __PYX_ERR(44, 95, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDof") < 0)) __PYX_ERR(44, 95, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_point = values[0];
__pyx_v_numDof = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDof", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 95, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.setDof", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_38setDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_38setDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cnumDof;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setDof", 0);
/* "petsc4py/PETSc/Section.pyx":96
*
* def setDof(self,point,numDof):
* 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(44, 96, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":97
* def setDof(self,point,numDof):
* 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(44, 97, __pyx_L1_error)
__pyx_v_cnumDof = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":98
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cnumDof = asInt(numDof)
* CHKERR( PetscSectionSetDof(self.sec,cpoint,cnumDof) ) # <<<<<<<<<<<<<<
*
* def addDof(self,point,numDof):
*/
__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(44, 98, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":95
* return toInt(cnumDof)
*
* def setDof(self,point,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cnumDof = asInt(numDof)
*/
/* 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":100
* CHKERR( PetscSectionSetDof(self.sec,cpoint,cnumDof) )
*
* def addDof(self,point,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cnumDof = asInt(numDof)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_41addDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_40addDof[] = "Section.addDof(self, point, numDof)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_41addDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_numDof = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_numDof,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("addDof", 1, 2, 2, 1); __PYX_ERR(44, 100, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addDof") < 0)) __PYX_ERR(44, 100, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_point = values[0];
__pyx_v_numDof = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("addDof", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 100, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.addDof", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_40addDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_40addDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cnumDof;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("addDof", 0);
/* "petsc4py/PETSc/Section.pyx":101
*
* def addDof(self,point,numDof):
* 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(44, 101, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":102
* def addDof(self,point,numDof):
* 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(44, 102, __pyx_L1_error)
__pyx_v_cnumDof = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":103
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cnumDof = asInt(numDof)
* CHKERR( PetscSectionAddDof(self.sec,cpoint,cnumDof) ) # <<<<<<<<<<<<<<
*
* def getFieldDof(self,point,field):
*/
__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(44, 103, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":100
* CHKERR( PetscSectionSetDof(self.sec,cpoint,cnumDof) )
*
* def addDof(self,point,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cnumDof = asInt(numDof)
*/
/* 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":105
* CHKERR( PetscSectionAddDof(self.sec,cpoint,cnumDof) )
*
* def getFieldDof(self,point,field): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point), cnumDof = 0
* cdef PetscInt cfield = asInt(field)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_43getFieldDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_42getFieldDof[] = "Section.getFieldDof(self, point, field)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_43getFieldDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_field = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("getFieldDof", 1, 2, 2, 1); __PYX_ERR(44, 105, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFieldDof") < 0)) __PYX_ERR(44, 105, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_point = values[0];
__pyx_v_field = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getFieldDof", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 105, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldDof", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_42getFieldDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_42getFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cnumDof;
PetscInt __pyx_v_cfield;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFieldDof", 0);
/* "petsc4py/PETSc/Section.pyx":106
*
* def getFieldDof(self,point,field):
* 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(44, 106, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
__pyx_v_cnumDof = 0;
/* "petsc4py/PETSc/Section.pyx":107
* def getFieldDof(self,point,field):
* 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(44, 107, __pyx_L1_error)
__pyx_v_cfield = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":108
* 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(44, 108, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":109
* cdef PetscInt cfield = asInt(field)
* CHKERR( PetscSectionGetFieldDof(self.sec,cpoint,cfield,&cnumDof) )
* return toInt(cnumDof) # <<<<<<<<<<<<<<
*
* def setFieldDof(self,point,field,numDof):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumDof); if (unlikely(!__pyx_t_3)) __PYX_ERR(44, 109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":105
* CHKERR( PetscSectionAddDof(self.sec,cpoint,cnumDof) )
*
* def getFieldDof(self,point,field): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point), cnumDof = 0
* cdef PetscInt cfield = asInt(field)
*/
/* 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":111
* return toInt(cnumDof)
*
* def setFieldDof(self,point,field,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(field)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_45setFieldDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_44setFieldDof[] = "Section.setFieldDof(self, point, field, numDof)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_45setFieldDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_field = 0;
PyObject *__pyx_v_numDof = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_numDof,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setFieldDof", 1, 3, 3, 1); __PYX_ERR(44, 111, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setFieldDof", 1, 3, 3, 2); __PYX_ERR(44, 111, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldDof") < 0)) __PYX_ERR(44, 111, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_point = values[0];
__pyx_v_field = values[1];
__pyx_v_numDof = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFieldDof", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 111, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldDof", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_44setFieldDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_44setFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cfield;
PetscInt __pyx_v_cnumDof;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFieldDof", 0);
/* "petsc4py/PETSc/Section.pyx":112
*
* def setFieldDof(self,point,field,numDof):
* 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(44, 112, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":113
* def setFieldDof(self,point,field,numDof):
* 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(44, 113, __pyx_L1_error)
__pyx_v_cfield = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":114
* 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(44, 114, __pyx_L1_error)
__pyx_v_cnumDof = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":115
* cdef PetscInt cfield = asInt(field)
* cdef PetscInt cnumDof = asInt(numDof)
* CHKERR( PetscSectionSetFieldDof(self.sec,cpoint,cfield,cnumDof) ) # <<<<<<<<<<<<<<
*
* def addFieldDof(self,point,field,numDof):
*/
__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(44, 115, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":111
* return toInt(cnumDof)
*
* def setFieldDof(self,point,field,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(field)
*/
/* 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":117
* CHKERR( PetscSectionSetFieldDof(self.sec,cpoint,cfield,cnumDof) )
*
* def addFieldDof(self,point,field,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(field)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_47addFieldDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_46addFieldDof[] = "Section.addFieldDof(self, point, field, numDof)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_47addFieldDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_field = 0;
PyObject *__pyx_v_numDof = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_numDof,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("addFieldDof", 1, 3, 3, 1); __PYX_ERR(44, 117, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("addFieldDof", 1, 3, 3, 2); __PYX_ERR(44, 117, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addFieldDof") < 0)) __PYX_ERR(44, 117, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_point = values[0];
__pyx_v_field = values[1];
__pyx_v_numDof = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("addFieldDof", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 117, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.addFieldDof", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_46addFieldDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_46addFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cfield;
PetscInt __pyx_v_cnumDof;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("addFieldDof", 0);
/* "petsc4py/PETSc/Section.pyx":118
*
* def addFieldDof(self,point,field,numDof):
* 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(44, 118, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":119
* def addFieldDof(self,point,field,numDof):
* 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(44, 119, __pyx_L1_error)
__pyx_v_cfield = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":120
* 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(44, 120, __pyx_L1_error)
__pyx_v_cnumDof = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":121
* cdef PetscInt cfield = asInt(field)
* cdef PetscInt cnumDof = asInt(numDof)
* CHKERR( PetscSectionAddFieldDof(self.sec,cpoint,cfield,cnumDof) ) # <<<<<<<<<<<<<<
*
* def getConstraintDof(self,point):
*/
__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(44, 121, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":117
* CHKERR( PetscSectionSetFieldDof(self.sec,cpoint,cfield,cnumDof) )
*
* def addFieldDof(self,point,field,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(field)
*/
/* 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":123
* CHKERR( PetscSectionAddFieldDof(self.sec,cpoint,cfield,cnumDof) )
*
* def getConstraintDof(self,point): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point), cnumDof = 0
* CHKERR( PetscSectionGetConstraintDof(self.sec,cpoint,&cnumDof) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_49getConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_48getConstraintDof[] = "Section.getConstraintDof(self, point)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_49getConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getConstraintDof") < 0)) __PYX_ERR(44, 123, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_point = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getConstraintDof", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 123, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.getConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_48getConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_48getConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cnumDof;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getConstraintDof", 0);
/* "petsc4py/PETSc/Section.pyx":124
*
* def getConstraintDof(self,point):
* 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(44, 124, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
__pyx_v_cnumDof = 0;
/* "petsc4py/PETSc/Section.pyx":125
* def getConstraintDof(self,point):
* 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(44, 125, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":126
* cdef PetscInt cpoint = asInt(point), cnumDof = 0
* CHKERR( PetscSectionGetConstraintDof(self.sec,cpoint,&cnumDof) )
* return toInt(cnumDof) # <<<<<<<<<<<<<<
*
* def setConstraintDof(self,point,numDof):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumDof); if (unlikely(!__pyx_t_3)) __PYX_ERR(44, 126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":123
* CHKERR( PetscSectionAddFieldDof(self.sec,cpoint,cfield,cnumDof) )
*
* def getConstraintDof(self,point): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point), cnumDof = 0
* CHKERR( PetscSectionGetConstraintDof(self.sec,cpoint,&cnumDof) )
*/
/* 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":128
* return toInt(cnumDof)
*
* def setConstraintDof(self,point,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cnumDof = asInt(numDof)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_51setConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_50setConstraintDof[] = "Section.setConstraintDof(self, point, numDof)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_51setConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_numDof = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_numDof,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setConstraintDof", 1, 2, 2, 1); __PYX_ERR(44, 128, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConstraintDof") < 0)) __PYX_ERR(44, 128, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_point = values[0];
__pyx_v_numDof = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setConstraintDof", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 128, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.setConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_50setConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_50setConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cnumDof;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setConstraintDof", 0);
/* "petsc4py/PETSc/Section.pyx":129
*
* def setConstraintDof(self,point,numDof):
* 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(44, 129, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":130
* def setConstraintDof(self,point,numDof):
* 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(44, 130, __pyx_L1_error)
__pyx_v_cnumDof = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":131
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cnumDof = asInt(numDof)
* CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,cnumDof) ) # <<<<<<<<<<<<<<
*
* def addConstraintDof(self,point,numDof):
*/
__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(44, 131, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":128
* return toInt(cnumDof)
*
* def setConstraintDof(self,point,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cnumDof = asInt(numDof)
*/
/* 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":133
* CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,cnumDof) )
*
* def addConstraintDof(self,point,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cnumDof = asInt(numDof)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_53addConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_52addConstraintDof[] = "Section.addConstraintDof(self, point, numDof)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_53addConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_numDof = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_numDof,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("addConstraintDof", 1, 2, 2, 1); __PYX_ERR(44, 133, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addConstraintDof") < 0)) __PYX_ERR(44, 133, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_point = values[0];
__pyx_v_numDof = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("addConstraintDof", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 133, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.addConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_52addConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_52addConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cnumDof;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("addConstraintDof", 0);
/* "petsc4py/PETSc/Section.pyx":134
*
* def addConstraintDof(self,point,numDof):
* 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(44, 134, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":135
* def addConstraintDof(self,point,numDof):
* 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(44, 135, __pyx_L1_error)
__pyx_v_cnumDof = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":136
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cnumDof = asInt(numDof)
* CHKERR( PetscSectionAddConstraintDof(self.sec,cpoint,cnumDof) ) # <<<<<<<<<<<<<<
*
* def getFieldConstraintDof(self,point,field):
*/
__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(44, 136, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":133
* CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,cnumDof) )
*
* def addConstraintDof(self,point,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cnumDof = asInt(numDof)
*/
/* 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":138
* CHKERR( PetscSectionAddConstraintDof(self.sec,cpoint,cnumDof) )
*
* def getFieldConstraintDof(self,point,field): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point), cnumDof = 0
* cdef PetscInt cfield = asInt(field)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_55getFieldConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_54getFieldConstraintDof[] = "Section.getFieldConstraintDof(self, point, field)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_55getFieldConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_field = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("getFieldConstraintDof", 1, 2, 2, 1); __PYX_ERR(44, 138, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFieldConstraintDof") < 0)) __PYX_ERR(44, 138, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_point = values[0];
__pyx_v_field = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getFieldConstraintDof", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 138, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_54getFieldConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_54getFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cnumDof;
PetscInt __pyx_v_cfield;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFieldConstraintDof", 0);
/* "petsc4py/PETSc/Section.pyx":139
*
* def getFieldConstraintDof(self,point,field):
* 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(44, 139, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
__pyx_v_cnumDof = 0;
/* "petsc4py/PETSc/Section.pyx":140
* def getFieldConstraintDof(self,point,field):
* 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(44, 140, __pyx_L1_error)
__pyx_v_cfield = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":141
* 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(44, 141, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":142
* cdef PetscInt cfield = asInt(field)
* CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&cnumDof) )
* return toInt(cnumDof) # <<<<<<<<<<<<<<
*
* def setFieldConstraintDof(self,point,field,numDof):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumDof); if (unlikely(!__pyx_t_3)) __PYX_ERR(44, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":138
* CHKERR( PetscSectionAddConstraintDof(self.sec,cpoint,cnumDof) )
*
* def getFieldConstraintDof(self,point,field): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point), cnumDof = 0
* cdef PetscInt cfield = asInt(field)
*/
/* 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":144
* return toInt(cnumDof)
*
* def setFieldConstraintDof(self,point,field,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(field)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_57setFieldConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_56setFieldConstraintDof[] = "Section.setFieldConstraintDof(self, point, field, numDof)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_57setFieldConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_field = 0;
PyObject *__pyx_v_numDof = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_numDof,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setFieldConstraintDof", 1, 3, 3, 1); __PYX_ERR(44, 144, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setFieldConstraintDof", 1, 3, 3, 2); __PYX_ERR(44, 144, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldConstraintDof") < 0)) __PYX_ERR(44, 144, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_point = values[0];
__pyx_v_field = values[1];
__pyx_v_numDof = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFieldConstraintDof", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 144, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_56setFieldConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_56setFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cfield;
PetscInt __pyx_v_cnumDof;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFieldConstraintDof", 0);
/* "petsc4py/PETSc/Section.pyx":145
*
* def setFieldConstraintDof(self,point,field,numDof):
* 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(44, 145, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":146
* def setFieldConstraintDof(self,point,field,numDof):
* 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(44, 146, __pyx_L1_error)
__pyx_v_cfield = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":147
* 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(44, 147, __pyx_L1_error)
__pyx_v_cnumDof = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":148
* cdef PetscInt cfield = asInt(field)
* cdef PetscInt cnumDof = asInt(numDof)
* CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) # <<<<<<<<<<<<<<
*
* def addFieldConstraintDof(self,point,field,numDof):
*/
__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(44, 148, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":144
* return toInt(cnumDof)
*
* def setFieldConstraintDof(self,point,field,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(field)
*/
/* 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":150
* CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) )
*
* def addFieldConstraintDof(self,point,field,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(field)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_59addFieldConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_58addFieldConstraintDof[] = "Section.addFieldConstraintDof(self, point, field, numDof)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_59addFieldConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_field = 0;
PyObject *__pyx_v_numDof = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_numDof,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("addFieldConstraintDof", 1, 3, 3, 1); __PYX_ERR(44, 150, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("addFieldConstraintDof", 1, 3, 3, 2); __PYX_ERR(44, 150, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addFieldConstraintDof") < 0)) __PYX_ERR(44, 150, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_point = values[0];
__pyx_v_field = values[1];
__pyx_v_numDof = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("addFieldConstraintDof", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 150, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.addFieldConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_58addFieldConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_58addFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cfield;
PetscInt __pyx_v_cnumDof;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("addFieldConstraintDof", 0);
/* "petsc4py/PETSc/Section.pyx":151
*
* def addFieldConstraintDof(self,point,field,numDof):
* 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(44, 151, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":152
* def addFieldConstraintDof(self,point,field,numDof):
* 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(44, 152, __pyx_L1_error)
__pyx_v_cfield = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":153
* 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(44, 153, __pyx_L1_error)
__pyx_v_cnumDof = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":154
* cdef PetscInt cfield = asInt(field)
* cdef PetscInt cnumDof = asInt(numDof)
* CHKERR( PetscSectionAddFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) # <<<<<<<<<<<<<<
*
* def getConstraintIndices(self,point):
*/
__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(44, 154, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":150
* CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) )
*
* def addFieldConstraintDof(self,point,field,numDof): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(field)
*/
/* 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":156
* CHKERR( PetscSectionAddFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) )
*
* def getConstraintIndices(self,point): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt nindex = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_61getConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_60getConstraintIndices[] = "Section.getConstraintIndices(self, point)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_61getConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getConstraintIndices") < 0)) __PYX_ERR(44, 156, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_point = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getConstraintIndices", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 156, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.getConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_60getConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_60getConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_nindex;
PetscInt const *__pyx_v_indices;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getConstraintIndices", 0);
/* "petsc4py/PETSc/Section.pyx":157
*
* def getConstraintIndices(self,point):
* 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(44, 157, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":158
* def getConstraintIndices(self,point):
* 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":159
* 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":160
* 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(44, 160, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":161
* 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(44, 161, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":162
* CHKERR( PetscSectionGetConstraintDof(self.sec, cpoint, &nindex) )
* CHKERR( PetscSectionGetConstraintIndices(self.sec, cpoint, &indices) )
* return array_i(nindex, indices) # <<<<<<<<<<<<<<
*
* def setConstraintIndices(self,point,indices):
*/
__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(44, 162, __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( PetscSectionAddFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) )
*
* def getConstraintIndices(self,point): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt nindex = 0
*/
/* 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":164
* return array_i(nindex, indices)
*
* def setConstraintIndices(self,point,indices): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt nindex = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_63setConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_62setConstraintIndices[] = "Section.setConstraintIndices(self, point, indices)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_63setConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_indices = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_indices,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setConstraintIndices", 1, 2, 2, 1); __PYX_ERR(44, 164, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConstraintIndices") < 0)) __PYX_ERR(44, 164, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_point = values[0];
__pyx_v_indices = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setConstraintIndices", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 164, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.setConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_62setConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_indices);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_62setConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_indices) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_nindex;
PetscInt *__pyx_v_cindices;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setConstraintIndices", 0);
__Pyx_INCREF(__pyx_v_indices);
/* "petsc4py/PETSc/Section.pyx":165
*
* def setConstraintIndices(self,point,indices):
* 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(44, 165, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":166
* def setConstraintIndices(self,point,indices):
* 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":167
* 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":168
* 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(44, 168, __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":169
* 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(44, 169, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":170
* indices = iarray_i(indices, &nindex, &cindices)
* CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,nindex) )
* CHKERR( PetscSectionSetConstraintIndices(self.sec,cpoint,cindices) ) # <<<<<<<<<<<<<<
*
* def getFieldConstraintIndices(self,point,field):
*/
__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(44, 170, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":164
* return array_i(nindex, indices)
*
* def setConstraintIndices(self,point,indices): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt nindex = 0
*/
/* 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":172
* CHKERR( PetscSectionSetConstraintIndices(self.sec,cpoint,cindices) )
*
* def getFieldConstraintIndices(self,point,field): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(field)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_65getFieldConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_64getFieldConstraintIndices[] = "Section.getFieldConstraintIndices(self, point, field)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_65getFieldConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_field = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("getFieldConstraintIndices", 1, 2, 2, 1); __PYX_ERR(44, 172, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFieldConstraintIndices") < 0)) __PYX_ERR(44, 172, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_point = values[0];
__pyx_v_field = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getFieldConstraintIndices", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 172, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_64getFieldConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_64getFieldConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cfield;
PetscInt __pyx_v_nindex;
PetscInt const *__pyx_v_indices;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFieldConstraintIndices", 0);
/* "petsc4py/PETSc/Section.pyx":173
*
* def getFieldConstraintIndices(self,point,field):
* 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(44, 173, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":174
* def getFieldConstraintIndices(self,point,field):
* 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(44, 174, __pyx_L1_error)
__pyx_v_cfield = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":175
* 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":176
* 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":177
* 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(44, 177, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":178
* 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(44, 178, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":179
* CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&nindex) )
* CHKERR( PetscSectionGetFieldConstraintIndices(self.sec,cpoint,cfield,&indices) )
* return array_i(nindex, indices) # <<<<<<<<<<<<<<
*
* def setFieldConstraintIndices(self,point,field,indices):
*/
__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(44, 179, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":172
* CHKERR( PetscSectionSetConstraintIndices(self.sec,cpoint,cindices) )
*
* def getFieldConstraintIndices(self,point,field): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(field)
*/
/* 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":181
* return array_i(nindex, indices)
*
* def setFieldConstraintIndices(self,point,field,indices): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(field)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_67setFieldConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_66setFieldConstraintIndices[] = "Section.setFieldConstraintIndices(self, point, field, indices)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_67setFieldConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_field = 0;
PyObject *__pyx_v_indices = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_indices,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setFieldConstraintIndices", 1, 3, 3, 1); __PYX_ERR(44, 181, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setFieldConstraintIndices", 1, 3, 3, 2); __PYX_ERR(44, 181, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldConstraintIndices") < 0)) __PYX_ERR(44, 181, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_point = values[0];
__pyx_v_field = values[1];
__pyx_v_indices = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFieldConstraintIndices", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 181, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_66setFieldConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_indices);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_66setFieldConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_indices) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cfield;
PetscInt __pyx_v_nindex;
PetscInt *__pyx_v_cindices;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFieldConstraintIndices", 0);
__Pyx_INCREF(__pyx_v_indices);
/* "petsc4py/PETSc/Section.pyx":182
*
* def setFieldConstraintIndices(self,point,field,indices):
* 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(44, 182, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":183
* def setFieldConstraintIndices(self,point,field,indices):
* 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(44, 183, __pyx_L1_error)
__pyx_v_cfield = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":184
* 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":185
* 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":186
* 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(44, 186, __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":187
* 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(44, 187, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":188
* indices = iarray_i(indices, &nindex, &cindices)
* CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,nindex) )
* CHKERR( PetscSectionSetFieldConstraintIndices(self.sec,cpoint,cfield,cindices) ) # <<<<<<<<<<<<<<
*
* def getMaxDof(self):
*/
__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(44, 188, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":181
* return array_i(nindex, indices)
*
* def setFieldConstraintIndices(self,point,field,indices): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(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.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":190
* CHKERR( PetscSectionSetFieldConstraintIndices(self.sec,cpoint,cfield,cindices) )
*
* def getMaxDof(self): # <<<<<<<<<<<<<<
* cdef PetscInt maxDof = 0
* CHKERR( PetscSectionGetMaxDof(self.sec,&maxDof) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_69getMaxDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_68getMaxDof[] = "Section.getMaxDof(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_69getMaxDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getMaxDof (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getMaxDof", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxDof", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_68getMaxDof(((struct PyPetscSectionObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_68getMaxDof(struct PyPetscSectionObject *__pyx_v_self) {
PetscInt __pyx_v_maxDof;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getMaxDof", 0);
/* "petsc4py/PETSc/Section.pyx":191
*
* def getMaxDof(self):
* cdef PetscInt maxDof = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscSectionGetMaxDof(self.sec,&maxDof) )
* return toInt(maxDof)
*/
__pyx_v_maxDof = 0;
/* "petsc4py/PETSc/Section.pyx":192
* def getMaxDof(self):
* 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(44, 192, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":193
* cdef PetscInt maxDof = 0
* CHKERR( PetscSectionGetMaxDof(self.sec,&maxDof) )
* return toInt(maxDof) # <<<<<<<<<<<<<<
*
* def getStorageSize(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_maxDof); if (unlikely(!__pyx_t_2)) __PYX_ERR(44, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":190
* CHKERR( PetscSectionSetFieldConstraintIndices(self.sec,cpoint,cfield,cindices) )
*
* def getMaxDof(self): # <<<<<<<<<<<<<<
* cdef PetscInt maxDof = 0
* CHKERR( PetscSectionGetMaxDof(self.sec,&maxDof) )
*/
/* 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":195
* return toInt(maxDof)
*
* def getStorageSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt size = 0
* CHKERR( PetscSectionGetStorageSize(self.sec,&size) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_71getStorageSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_70getStorageSize[] = "Section.getStorageSize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_71getStorageSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getStorageSize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getStorageSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStorageSize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_70getStorageSize(((struct PyPetscSectionObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_70getStorageSize(struct PyPetscSectionObject *__pyx_v_self) {
PetscInt __pyx_v_size;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getStorageSize", 0);
/* "petsc4py/PETSc/Section.pyx":196
*
* def getStorageSize(self):
* cdef PetscInt size = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscSectionGetStorageSize(self.sec,&size) )
* return toInt(size)
*/
__pyx_v_size = 0;
/* "petsc4py/PETSc/Section.pyx":197
* def getStorageSize(self):
* 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(44, 197, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":198
* cdef PetscInt size = 0
* CHKERR( PetscSectionGetStorageSize(self.sec,&size) )
* return toInt(size) # <<<<<<<<<<<<<<
*
* def getConstrainedStorageSize(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(44, 198, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":195
* return toInt(maxDof)
*
* def getStorageSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt size = 0
* CHKERR( PetscSectionGetStorageSize(self.sec,&size) )
*/
/* 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":200
* return toInt(size)
*
* def getConstrainedStorageSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt size = 0
* CHKERR( PetscSectionGetConstrainedStorageSize(self.sec,&size) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_73getConstrainedStorageSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_72getConstrainedStorageSize[] = "Section.getConstrainedStorageSize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_73getConstrainedStorageSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getConstrainedStorageSize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getConstrainedStorageSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConstrainedStorageSize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_72getConstrainedStorageSize(((struct PyPetscSectionObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_72getConstrainedStorageSize(struct PyPetscSectionObject *__pyx_v_self) {
PetscInt __pyx_v_size;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getConstrainedStorageSize", 0);
/* "petsc4py/PETSc/Section.pyx":201
*
* def getConstrainedStorageSize(self):
* cdef PetscInt size = 0 # <<<<<<<<<<<<<<
* CHKERR( PetscSectionGetConstrainedStorageSize(self.sec,&size) )
* return toInt(size)
*/
__pyx_v_size = 0;
/* "petsc4py/PETSc/Section.pyx":202
* def getConstrainedStorageSize(self):
* 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(44, 202, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":203
* cdef PetscInt size = 0
* CHKERR( PetscSectionGetConstrainedStorageSize(self.sec,&size) )
* return toInt(size) # <<<<<<<<<<<<<<
*
* def getOffset(self,point):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(44, 203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":200
* return toInt(size)
*
* def getConstrainedStorageSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt size = 0
* CHKERR( PetscSectionGetConstrainedStorageSize(self.sec,&size) )
*/
/* 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":205
* return toInt(size)
*
* def getOffset(self,point): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point), offset = 0
* CHKERR( PetscSectionGetOffset(self.sec,cpoint,&offset) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_75getOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_74getOffset[] = "Section.getOffset(self, point)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_75getOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getOffset") < 0)) __PYX_ERR(44, 205, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_point = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getOffset", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 205, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.getOffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_74getOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_74getOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_offset;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getOffset", 0);
/* "petsc4py/PETSc/Section.pyx":206
*
* def getOffset(self,point):
* 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(44, 206, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
__pyx_v_offset = 0;
/* "petsc4py/PETSc/Section.pyx":207
* def getOffset(self,point):
* 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(44, 207, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":208
* cdef PetscInt cpoint = asInt(point), offset = 0
* CHKERR( PetscSectionGetOffset(self.sec,cpoint,&offset) )
* return toInt(offset) # <<<<<<<<<<<<<<
*
* def setOffset(self,point,offset):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(44, 208, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":205
* return toInt(size)
*
* def getOffset(self,point): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point), offset = 0
* CHKERR( PetscSectionGetOffset(self.sec,cpoint,&offset) )
*/
/* 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":210
* return toInt(offset)
*
* def setOffset(self,point,offset): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt coffset = asInt(offset)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_77setOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_76setOffset[] = "Section.setOffset(self, point, offset)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_77setOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_offset = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_offset,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setOffset", 1, 2, 2, 1); __PYX_ERR(44, 210, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOffset") < 0)) __PYX_ERR(44, 210, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_point = values[0];
__pyx_v_offset = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setOffset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 210, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.setOffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_76setOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_offset);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_76setOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_offset) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_coffset;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setOffset", 0);
/* "petsc4py/PETSc/Section.pyx":211
*
* def setOffset(self,point,offset):
* 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(44, 211, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":212
* def setOffset(self,point,offset):
* 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(44, 212, __pyx_L1_error)
__pyx_v_coffset = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":213
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt coffset = asInt(offset)
* CHKERR( PetscSectionSetOffset(self.sec,cpoint,coffset) ) # <<<<<<<<<<<<<<
*
* def getFieldOffset(self,point,field):
*/
__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(44, 213, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":210
* return toInt(offset)
*
* def setOffset(self,point,offset): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt coffset = asInt(offset)
*/
/* 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":215
* CHKERR( PetscSectionSetOffset(self.sec,cpoint,coffset) )
*
* def getFieldOffset(self,point,field): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(field)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_79getFieldOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_78getFieldOffset[] = "Section.getFieldOffset(self, point, field)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_79getFieldOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_field = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("getFieldOffset", 1, 2, 2, 1); __PYX_ERR(44, 215, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFieldOffset") < 0)) __PYX_ERR(44, 215, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_point = values[0];
__pyx_v_field = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getFieldOffset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 215, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldOffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_78getFieldOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_78getFieldOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cfield;
PetscInt __pyx_v_offset;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFieldOffset", 0);
/* "petsc4py/PETSc/Section.pyx":216
*
* def getFieldOffset(self,point,field):
* 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(44, 216, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":217
* def getFieldOffset(self,point,field):
* 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(44, 217, __pyx_L1_error)
__pyx_v_cfield = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":218
* 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":219
* 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(44, 219, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":220
* cdef PetscInt offset = 0
* CHKERR( PetscSectionGetFieldOffset(self.sec,cpoint,cfield,&offset) )
* return toInt(offset) # <<<<<<<<<<<<<<
*
* def setFieldOffset(self,point,field,offset):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(44, 220, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":215
* CHKERR( PetscSectionSetOffset(self.sec,cpoint,coffset) )
*
* def getFieldOffset(self,point,field): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(field)
*/
/* 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":222
* return toInt(offset)
*
* def setFieldOffset(self,point,field,offset): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(field)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_81setFieldOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_80setFieldOffset[] = "Section.setFieldOffset(self, point, field, offset)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_81setFieldOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_point = 0;
PyObject *__pyx_v_field = 0;
PyObject *__pyx_v_offset = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_offset,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setFieldOffset", 1, 3, 3, 1); __PYX_ERR(44, 222, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setFieldOffset", 1, 3, 3, 2); __PYX_ERR(44, 222, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldOffset") < 0)) __PYX_ERR(44, 222, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_point = values[0];
__pyx_v_field = values[1];
__pyx_v_offset = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFieldOffset", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 222, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldOffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_80setFieldOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_offset);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_80setFieldOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_offset) {
PetscInt __pyx_v_cpoint;
PetscInt __pyx_v_cfield;
PetscInt __pyx_v_coffset;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFieldOffset", 0);
/* "petsc4py/PETSc/Section.pyx":223
*
* def setFieldOffset(self,point,field,offset):
* 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(44, 223, __pyx_L1_error)
__pyx_v_cpoint = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":224
* def setFieldOffset(self,point,field,offset):
* 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(44, 224, __pyx_L1_error)
__pyx_v_cfield = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":225
* 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(44, 225, __pyx_L1_error)
__pyx_v_coffset = __pyx_t_1;
/* "petsc4py/PETSc/Section.pyx":226
* cdef PetscInt cfield = asInt(field)
* cdef PetscInt coffset = asInt(offset)
* CHKERR( PetscSectionSetFieldOffset(self.sec,cpoint,cfield,coffset) ) # <<<<<<<<<<<<<<
*
* def getOffsetRange(self):
*/
__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(44, 226, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":222
* return toInt(offset)
*
* def setFieldOffset(self,point,field,offset): # <<<<<<<<<<<<<<
* cdef PetscInt cpoint = asInt(point)
* cdef PetscInt cfield = asInt(field)
*/
/* 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":228
* CHKERR( PetscSectionSetFieldOffset(self.sec,cpoint,cfield,coffset) )
*
* def getOffsetRange(self): # <<<<<<<<<<<<<<
* cdef PetscInt oStart = 0, oEnd = 0
* CHKERR( PetscSectionGetOffsetRange(self.sec,&oStart,&oEnd) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_83getOffsetRange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_82getOffsetRange[] = "Section.getOffsetRange(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_83getOffsetRange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOffsetRange (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOffsetRange", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOffsetRange", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_82getOffsetRange(((struct PyPetscSectionObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_82getOffsetRange(struct PyPetscSectionObject *__pyx_v_self) {
PetscInt __pyx_v_oStart;
PetscInt __pyx_v_oEnd;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getOffsetRange", 0);
/* "petsc4py/PETSc/Section.pyx":229
*
* def getOffsetRange(self):
* 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":230
* def getOffsetRange(self):
* 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(44, 230, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":231
* cdef PetscInt oStart = 0, oEnd = 0
* CHKERR( PetscSectionGetOffsetRange(self.sec,&oStart,&oEnd) )
* return toInt(oStart),toInt(oEnd) # <<<<<<<<<<<<<<
*
* def createGlobalSection(self, SF sf):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_oStart); if (unlikely(!__pyx_t_2)) __PYX_ERR(44, 231, __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(44, 231, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(44, 231, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":228
* CHKERR( PetscSectionSetFieldOffset(self.sec,cpoint,cfield,coffset) )
*
* def getOffsetRange(self): # <<<<<<<<<<<<<<
* cdef PetscInt oStart = 0, oEnd = 0
* CHKERR( PetscSectionGetOffsetRange(self.sec,&oStart,&oEnd) )
*/
/* 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":233
* return toInt(oStart),toInt(oEnd)
*
* def createGlobalSection(self, SF sf): # <<<<<<<<<<<<<<
* cdef Section gsec = Section()
* CHKERR( PetscSectionCreateGlobalSection(self.sec,sf.sf,PETSC_FALSE,PETSC_FALSE,&gsec.sec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_85createGlobalSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_7Section_84createGlobalSection[] = "Section.createGlobalSection(self, SF sf)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_85createGlobalSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscSFObject *__pyx_v_sf = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sf)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createGlobalSection") < 0)) __PYX_ERR(44, 233, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_sf = ((struct PyPetscSFObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createGlobalSection", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 233, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Section.createGlobalSection", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(44, 233, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_84createGlobalSection(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_sf);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_84createGlobalSection(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf) {
struct PyPetscSectionObject *__pyx_v_gsec = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createGlobalSection", 0);
/* "petsc4py/PETSc/Section.pyx":234
*
* def createGlobalSection(self, SF sf):
* cdef Section gsec = Section() # <<<<<<<<<<<<<<
* CHKERR( PetscSectionCreateGlobalSection(self.sec,sf.sf,PETSC_FALSE,PETSC_FALSE,&gsec.sec) )
* return gsec
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 234, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_gsec = ((struct PyPetscSectionObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Section.pyx":235
* def createGlobalSection(self, SF sf):
* cdef Section gsec = Section()
* CHKERR( PetscSectionCreateGlobalSection(self.sec,sf.sf,PETSC_FALSE,PETSC_FALSE,&gsec.sec) ) # <<<<<<<<<<<<<<
* return gsec
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionCreateGlobalSection(__pyx_v_self->sec, __pyx_v_sf->sf, PETSC_FALSE, PETSC_FALSE, (&__pyx_v_gsec->sec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 235, __pyx_L1_error)
/* "petsc4py/PETSc/Section.pyx":236
* cdef Section gsec = Section()
* CHKERR( PetscSectionCreateGlobalSection(self.sec,sf.sf,PETSC_FALSE,PETSC_FALSE,&gsec.sec) )
* return gsec # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_gsec));
__pyx_r = ((PyObject *)__pyx_v_gsec);
goto __pyx_L0;
/* "petsc4py/PETSc/Section.pyx":233
* return toInt(oStart),toInt(oEnd)
*
* def createGlobalSection(self, SF sf): # <<<<<<<<<<<<<<
* cdef Section gsec = Section()
* CHKERR( PetscSectionCreateGlobalSection(self.sec,sf.sf,PETSC_FALSE,PETSC_FALSE,&gsec.sec) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Section.createGlobalSection", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_gsec);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":220
* #
*
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat___cinit__(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3Mat___cinit__(struct PyPetscMatObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/Mat.pyx":221
*
* 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":222
* def __cinit__(self):
* self.obj = <PetscObject*> &self.mat
* self.mat = NULL # <<<<<<<<<<<<<<
*
* # unary operations
*/
__pyx_v_self->mat = NULL;
/* "petsc4py/PETSc/Mat.pyx":220
* #
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.mat
* self.mat = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":226
* # 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__pos__ (wrapper)", 0);
__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":227
*
* 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(45, 227, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":226
* # 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":229
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__neg__ (wrapper)", 0);
__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":230
*
* 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(45, 230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":229
* 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":234
* # 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0);
__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":235
*
* 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(45, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":234
* # 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":237
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__isub__ (wrapper)", 0);
__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":238
*
* 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(45, 238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":237
* 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":240
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__imul__ (wrapper)", 0);
__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":241
*
* 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(45, 241, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":240
* 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":243
* return mat_imul(self, other)
*
* def __idiv__(self, other): # <<<<<<<<<<<<<<
* return mat_idiv(self, other)
*
*/
/* Python wrapper */
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_13__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_13__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__idiv__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_12__idiv__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_12__idiv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__idiv__", 0);
/* "petsc4py/PETSc/Mat.pyx":244
*
* 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(45, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":243
* return mat_imul(self, other)
*
* def __idiv__(self, other): # <<<<<<<<<<<<<<
* return mat_idiv(self, other)
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
/* "petsc4py/PETSc/Mat.pyx":246
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__itruediv__ (wrapper)", 0);
__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":247
*
* 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(45, 247, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":246
* 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":251
* # binary operations
*
* def __add__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Mat):
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_16__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_16__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
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("__add__", 0);
/* "petsc4py/PETSc/Mat.pyx":252
*
* def __add__(self, other):
* if isinstance(self, Mat): # <<<<<<<<<<<<<<
* return mat_add(self, other)
* else:
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":253
* def __add__(self, other):
* if isinstance(self, Mat):
* return mat_add(self, other) # <<<<<<<<<<<<<<
* else:
* return mat_radd(other, self)
*/
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(45, 253, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_add(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":252
*
* def __add__(self, other):
* if isinstance(self, Mat): # <<<<<<<<<<<<<<
* return mat_add(self, other)
* else:
*/
}
/* "petsc4py/PETSc/Mat.pyx":255
* return mat_add(self, other)
* else:
* return mat_radd(other, self) # <<<<<<<<<<<<<<
*
* def __sub__(self, other):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(45, 255, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_radd(((struct PyPetscMatObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Mat.pyx":251
* # binary operations
*
* def __add__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Mat):
* return mat_add(self, other)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":257
* return mat_radd(other, self)
*
* def __sub__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Mat):
* return mat_sub(self, other)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_19__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_19__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__sub__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_18__sub__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_18__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
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("__sub__", 0);
/* "petsc4py/PETSc/Mat.pyx":258
*
* def __sub__(self, other):
* if isinstance(self, Mat): # <<<<<<<<<<<<<<
* return mat_sub(self, other)
* else:
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":259
* def __sub__(self, other):
* if isinstance(self, Mat):
* return mat_sub(self, other) # <<<<<<<<<<<<<<
* else:
* return mat_rsub(other, self)
*/
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(45, 259, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_sub(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 259, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":258
*
* def __sub__(self, other):
* if isinstance(self, Mat): # <<<<<<<<<<<<<<
* return mat_sub(self, other)
* else:
*/
}
/* "petsc4py/PETSc/Mat.pyx":261
* return mat_sub(self, other)
* else:
* return mat_rsub(other, self) # <<<<<<<<<<<<<<
*
* def __mul__(self, other):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(45, 261, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_rsub(((struct PyPetscMatObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Mat.pyx":257
* return mat_radd(other, self)
*
* def __sub__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Mat):
* return mat_sub(self, other)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":263
* return mat_rsub(other, self)
*
* def __mul__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Mat):
* if isinstance(other, Vec):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_21__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_21__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__mul__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_20__mul__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_20__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
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("__mul__", 0);
/* "petsc4py/PETSc/Mat.pyx":264
*
* def __mul__(self, other):
* if isinstance(self, Mat): # <<<<<<<<<<<<<<
* if isinstance(other, Vec):
* return mat_mul_vec(self, other)
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":265
* def __mul__(self, other):
* if isinstance(self, Mat):
* if isinstance(other, Vec): # <<<<<<<<<<<<<<
* return mat_mul_vec(self, other)
* else:
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Mat.pyx":266
* if isinstance(self, Mat):
* if isinstance(other, Vec):
* return mat_mul_vec(self, other) # <<<<<<<<<<<<<<
* else:
* return mat_mul(self, other)
*/
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(45, 266, __pyx_L1_error)
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(45, 266, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_mul_vec(((struct PyPetscMatObject *)__pyx_v_self), ((struct PyPetscVecObject *)__pyx_v_other))); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":265
* def __mul__(self, other):
* if isinstance(self, Mat):
* if isinstance(other, Vec): # <<<<<<<<<<<<<<
* return mat_mul_vec(self, other)
* else:
*/
}
/* "petsc4py/PETSc/Mat.pyx":268
* return mat_mul_vec(self, other)
* else:
* return mat_mul(self, other) # <<<<<<<<<<<<<<
* else:
* return mat_rmul(other, self)
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(45, 268, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_mul(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Mat.pyx":264
*
* def __mul__(self, other):
* if isinstance(self, Mat): # <<<<<<<<<<<<<<
* if isinstance(other, Vec):
* return mat_mul_vec(self, other)
*/
}
/* "petsc4py/PETSc/Mat.pyx":270
* return mat_mul(self, other)
* else:
* return mat_rmul(other, self) # <<<<<<<<<<<<<<
*
* def __div__(self, other):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(45, 270, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_rmul(((struct PyPetscMatObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 270, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Mat.pyx":263
* return mat_rsub(other, self)
*
* def __mul__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Mat):
* if isinstance(other, Vec):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":272
* return mat_rmul(other, self)
*
* def __div__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Mat):
* return mat_div(self, other)
*/
/* Python wrapper */
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_23__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_23__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__div__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_22__div__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_22__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
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("__div__", 0);
/* "petsc4py/PETSc/Mat.pyx":273
*
* def __div__(self, other):
* if isinstance(self, Mat): # <<<<<<<<<<<<<<
* return mat_div(self, other)
* else:
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":274
* def __div__(self, other):
* if isinstance(self, Mat):
* return mat_div(self, other) # <<<<<<<<<<<<<<
* else:
* return mat_rdiv(other, self)
*/
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(45, 274, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_div(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 274, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":273
*
* def __div__(self, other):
* if isinstance(self, Mat): # <<<<<<<<<<<<<<
* return mat_div(self, other)
* else:
*/
}
/* "petsc4py/PETSc/Mat.pyx":276
* return mat_div(self, other)
* else:
* return mat_rdiv(other, self) # <<<<<<<<<<<<<<
*
* def __truediv__(self, other):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(45, 276, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_rdiv(((struct PyPetscMatObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Mat.pyx":272
* return mat_rmul(other, self)
*
* def __div__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Mat):
* return mat_div(self, other)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
/* "petsc4py/PETSc/Mat.pyx":278
* return mat_rdiv(other, self)
*
* def __truediv__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Mat):
* return mat_div(self, other)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_25__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_25__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__truediv__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_24__truediv__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_24__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
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("__truediv__", 0);
/* "petsc4py/PETSc/Mat.pyx":279
*
* def __truediv__(self, other):
* if isinstance(self, Mat): # <<<<<<<<<<<<<<
* return mat_div(self, other)
* else:
*/
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":280
* def __truediv__(self, other):
* if isinstance(self, Mat):
* return mat_div(self, other) # <<<<<<<<<<<<<<
* else:
* return mat_rdiv(other, self)
*/
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(45, 280, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_div(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":279
*
* def __truediv__(self, other):
* if isinstance(self, Mat): # <<<<<<<<<<<<<<
* return mat_div(self, other)
* else:
*/
}
/* "petsc4py/PETSc/Mat.pyx":282
* return mat_div(self, other)
* else:
* return mat_rdiv(other, self) # <<<<<<<<<<<<<<
*
* #
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(45, 282, __pyx_L1_error)
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_rdiv(((struct PyPetscMatObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Mat.pyx":278
* return mat_rdiv(other, self)
*
* def __truediv__(self, other): # <<<<<<<<<<<<<<
* if isinstance(self, Mat):
* return mat_div(self, other)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":286
* #
*
* def __getitem__(self, ij): # <<<<<<<<<<<<<<
* return mat_getitem(self, ij)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_27__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_27__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_26__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_26__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":287
*
* 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(45, 287, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":286
* #
*
* 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":289
* return mat_getitem(self, ij)
*
* def __setitem__(self, ij, v): # <<<<<<<<<<<<<<
* mat_setitem(self, ij, v)
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_3Mat_29__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_v); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_3Mat_29__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_v) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_28__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_28__setitem__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_v) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
/* "petsc4py/PETSc/Mat.pyx":290
*
* 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(45, 290, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":289
* 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:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":292
* 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_31__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_31__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(45, 292, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_x = values[0];
__pyx_v_y = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 292, __pyx_L3_error)
__pyx_L3_error:;
__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_30__call__(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_30__call__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
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":293
*
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":294
* def __call__(self, x, y=None):
* if y is None:
* y = self.createVecLeft() # <<<<<<<<<<<<<<
* self.mult(x, y)
* return y
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_createVecLeft); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_y, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":293
*
* def __call__(self, x, y=None):
* if y is None: # <<<<<<<<<<<<<<
* y = self.createVecLeft()
* self.mult(x, y)
*/
}
/* "petsc4py/PETSc/Mat.pyx":295
* if y is None:
* y = self.createVecLeft()
* self.mult(x, y) # <<<<<<<<<<<<<<
* return y
* #
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mult); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
__pyx_t_6 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_6 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_x, __pyx_v_y};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 295, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_x, __pyx_v_y};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 295, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
{
__pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_INCREF(__pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_x);
__Pyx_INCREF(__pyx_v_y);
__Pyx_GIVEREF(__pyx_v_y);
PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_y);
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":296
* 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":292
* 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_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
__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":299
* #
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_33view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_32view[] = "Mat.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_33view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(45, 299, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 299, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(45, 299, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_32view(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_32view(struct PyPetscMatObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) {
PetscViewer __pyx_v_vwr;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/Mat.pyx":300
*
* def view(self, Viewer viewer=None):
* 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":301
* def view(self, Viewer viewer=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
}
/* "petsc4py/PETSc/Mat.pyx":302
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
* CHKERR( MatView(self.mat, vwr) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatView(__pyx_v_self->mat, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 302, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":299
* #
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.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":304
* CHKERR( MatView(self.mat, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( MatDestroy(&self.mat) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_35destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_34destroy[] = "Mat.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_35destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_34destroy(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_34destroy(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":305
*
* def destroy(self):
* 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(45, 305, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":306
* def destroy(self):
* CHKERR( MatDestroy(&self.mat) )
* return self # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":304
* CHKERR( MatView(self.mat, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( MatDestroy(&self.mat) )
* return self
*/
/* 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":308
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscMat newmat = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_37create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_36create[] = "Mat.create(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_37create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(45, 308, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 308, __pyx_L3_error)
__pyx_L3_error:;
__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_36create(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_36create(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":309
*
* def create(self, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(45, 309, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":310
* def create(self, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscMat newmat = NULL # <<<<<<<<<<<<<<
* CHKERR( MatCreate(ccomm, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_v_newmat = NULL;
/* "petsc4py/PETSc/Mat.pyx":311
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscMat newmat = NULL
* CHKERR( MatCreate(ccomm, &newmat) ) # <<<<<<<<<<<<<<
* 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(45, 311, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":312
* cdef PetscMat newmat = NULL
* CHKERR( MatCreate(ccomm, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":313
* CHKERR( MatCreate(ccomm, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
* return self # <<<<<<<<<<<<<<
*
* def setType(self, mat_type):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":308
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscMat newmat = NULL
*/
/* 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":315
* return self
*
* def setType(self, mat_type): # <<<<<<<<<<<<<<
* cdef PetscMatType cval = NULL
* mat_type = str2bytes(mat_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_39setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_38setType[] = "Mat.setType(self, mat_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_39setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_mat_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(45, 315, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_mat_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 315, __pyx_L3_error)
__pyx_L3_error:;
__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_38setType(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_38setType(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":316
*
* def setType(self, mat_type):
* cdef PetscMatType cval = NULL # <<<<<<<<<<<<<<
* mat_type = str2bytes(mat_type, &cval)
* CHKERR( MatSetType(self.mat, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Mat.pyx":317
* def setType(self, mat_type):
* 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(45, 317, __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":318
* cdef PetscMatType cval = NULL
* mat_type = str2bytes(mat_type, &cval)
* CHKERR( MatSetType(self.mat, cval) ) # <<<<<<<<<<<<<<
*
* def setSizes(self, size, bsize=None):
*/
__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(45, 318, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":315
* return self
*
* def setType(self, mat_type): # <<<<<<<<<<<<<<
* cdef PetscMatType cval = NULL
* mat_type = str2bytes(mat_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":320
* CHKERR( MatSetType(self.mat, cval) )
*
* def setSizes(self, size, bsize=None): # <<<<<<<<<<<<<<
* cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0
* Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_41setSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_40setSizes[] = "Mat.setSizes(self, size, bsize=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_41setSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_size = 0;
PyObject *__pyx_v_bsize = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSizes") < 0)) __PYX_ERR(45, 320, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_bsize = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setSizes", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 320, __pyx_L3_error)
__pyx_L3_error:;
__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_40setSizes(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_40setSizes(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":321
*
* def setSizes(self, size, bsize=None):
* 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":322
* def setSizes(self, size, bsize=None):
* 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(45, 322, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":323
* 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(45, 323, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":324
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":325
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":326
* 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(45, 326, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":325
* 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":328
* CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) )
* else:
* CHKERR( MatSetBlockSize(self.mat, rbs) ) # <<<<<<<<<<<<<<
*
* def setBlockSize(self, bsize):
*/
/*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(45, 328, __pyx_L1_error)
}
__pyx_L4:;
/* "petsc4py/PETSc/Mat.pyx":324
* 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":320
* CHKERR( MatSetType(self.mat, cval) )
*
* def setSizes(self, size, bsize=None): # <<<<<<<<<<<<<<
* cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0
* Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N)
*/
/* 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":330
* CHKERR( MatSetBlockSize(self.mat, rbs) )
*
* def setBlockSize(self, bsize): # <<<<<<<<<<<<<<
* cdef PetscInt bs = asInt(bsize)
* CHKERR( MatSetBlockSize(self.mat, bs) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_43setBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_42setBlockSize[] = "Mat.setBlockSize(self, bsize)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_43setBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_bsize = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bsize,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBlockSize") < 0)) __PYX_ERR(45, 330, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_bsize = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBlockSize", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 330, __pyx_L3_error)
__pyx_L3_error:;
__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_42setBlockSize(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_bsize);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_42setBlockSize(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":331
*
* def setBlockSize(self, bsize):
* 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(45, 331, __pyx_L1_error)
__pyx_v_bs = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":332
* def setBlockSize(self, bsize):
* cdef PetscInt bs = asInt(bsize)
* CHKERR( MatSetBlockSize(self.mat, bs) ) # <<<<<<<<<<<<<<
*
* def setBlockSizes(self, row_bsize, col_bsize):
*/
__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(45, 332, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":330
* CHKERR( MatSetBlockSize(self.mat, rbs) )
*
* def setBlockSize(self, bsize): # <<<<<<<<<<<<<<
* cdef PetscInt bs = asInt(bsize)
* CHKERR( MatSetBlockSize(self.mat, bs) )
*/
/* 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":334
* CHKERR( MatSetBlockSize(self.mat, bs) )
*
* def setBlockSizes(self, row_bsize, col_bsize): # <<<<<<<<<<<<<<
* cdef PetscInt rbs = asInt(row_bsize)
* cdef PetscInt cbs = asInt(col_bsize)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_45setBlockSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_44setBlockSizes[] = "Mat.setBlockSizes(self, row_bsize, col_bsize)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_45setBlockSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_row_bsize = 0;
PyObject *__pyx_v_col_bsize = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row_bsize,&__pyx_n_s_col_bsize,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row_bsize)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col_bsize)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setBlockSizes", 1, 2, 2, 1); __PYX_ERR(45, 334, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBlockSizes") < 0)) __PYX_ERR(45, 334, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_row_bsize = values[0];
__pyx_v_col_bsize = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBlockSizes", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 334, __pyx_L3_error)
__pyx_L3_error:;
__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_44setBlockSizes(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row_bsize, __pyx_v_col_bsize);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_44setBlockSizes(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":335
*
* def setBlockSizes(self, row_bsize, col_bsize):
* 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(45, 335, __pyx_L1_error)
__pyx_v_rbs = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":336
* def setBlockSizes(self, row_bsize, col_bsize):
* 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(45, 336, __pyx_L1_error)
__pyx_v_cbs = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":337
* cdef PetscInt rbs = asInt(row_bsize)
* cdef PetscInt cbs = asInt(col_bsize)
* CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) # <<<<<<<<<<<<<<
*
* def setVecType(self, vec_type):
*/
__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(45, 337, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":334
* CHKERR( MatSetBlockSize(self.mat, bs) )
*
* def setBlockSizes(self, row_bsize, col_bsize): # <<<<<<<<<<<<<<
* cdef PetscInt rbs = asInt(row_bsize)
* cdef PetscInt cbs = asInt(col_bsize)
*/
/* 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":339
* CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) )
*
* def setVecType(self, vec_type): # <<<<<<<<<<<<<<
* cdef PetscVecType cval = NULL
* vec_type = str2bytes(vec_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_47setVecType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_46setVecType[] = "Mat.setVecType(self, vec_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_47setVecType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vec_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setVecType") < 0)) __PYX_ERR(45, 339, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setVecType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 339, __pyx_L3_error)
__pyx_L3_error:;
__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_46setVecType(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_vec_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_46setVecType(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":340
*
* def setVecType(self, vec_type):
* cdef PetscVecType cval = NULL # <<<<<<<<<<<<<<
* vec_type = str2bytes(vec_type, &cval)
* CHKERR( MatSetVecType(self.mat, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Mat.pyx":341
* def setVecType(self, vec_type):
* 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(45, 341, __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":342
* cdef PetscVecType cval = NULL
* vec_type = str2bytes(vec_type, &cval)
* CHKERR( MatSetVecType(self.mat, cval) ) # <<<<<<<<<<<<<<
*
* def getVecType(self):
*/
__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(45, 342, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":339
* CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) )
*
* def setVecType(self, vec_type): # <<<<<<<<<<<<<<
* cdef PetscVecType cval = NULL
* vec_type = str2bytes(vec_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":344
* CHKERR( MatSetVecType(self.mat, cval) )
*
* def getVecType(self): # <<<<<<<<<<<<<<
* cdef PetscVecType cval = NULL
* CHKERR( MatGetVecType(self.mat, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_49getVecType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_48getVecType[] = "Mat.getVecType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_49getVecType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getVecType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getVecType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVecType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_48getVecType(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_48getVecType(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":345
*
* def getVecType(self):
* cdef PetscVecType cval = NULL # <<<<<<<<<<<<<<
* CHKERR( MatGetVecType(self.mat, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Mat.pyx":346
* def getVecType(self):
* 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(45, 346, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":347
* cdef PetscVecType cval = NULL
* CHKERR( MatGetVecType(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(45, 347, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":344
* CHKERR( MatSetVecType(self.mat, cval) )
*
* def getVecType(self): # <<<<<<<<<<<<<<
* cdef PetscVecType cval = NULL
* CHKERR( MatGetVecType(self.mat, &cval) )
*/
/* 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":351
* #
*
* def createAIJ(self, size, bsize=None, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<<
* # create matrix
* cdef PetscMat newmat = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_51createAIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_50createAIJ[] = "Mat.createAIJ(self, size, bsize=None, nnz=None, csr=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_51createAIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createAIJ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_nnz,&__pyx_n_s_csr,&__pyx_n_s_comm,0};
PyObject* values[5] = {0,0,0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csr);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createAIJ") < 0)) __PYX_ERR(45, 351, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_bsize = values[1];
__pyx_v_nnz = values[2];
__pyx_v_csr = values[3];
__pyx_v_comm = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createAIJ", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 351, __pyx_L3_error)
__pyx_L3_error:;
__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_50createAIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_50createAIJ(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":353
* def createAIJ(self, size, bsize=None, nnz=None, csr=None, comm=None):
* # create matrix
* cdef PetscMat newmat = NULL # <<<<<<<<<<<<<<
* Mat_Create(MATAIJ, comm, size, bsize, &newmat)
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_v_newmat = NULL;
/* "petsc4py/PETSc/Mat.pyx":354
* # create matrix
* cdef PetscMat newmat = NULL
* Mat_Create(MATAIJ, comm, size, bsize, &newmat) # <<<<<<<<<<<<<<
* 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(45, 354, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":355
* cdef PetscMat newmat = NULL
* Mat_Create(MATAIJ, comm, size, bsize, &newmat)
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* # preallocate matrix
* Mat_AllocAIJ(self.mat, nnz, csr)
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":357
* 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(45, 357, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":358
* # preallocate matrix
* Mat_AllocAIJ(self.mat, nnz, csr)
* return self # <<<<<<<<<<<<<<
*
* def createBAIJ(self, size, bsize, nnz=None, csr=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":351
* #
*
* def createAIJ(self, size, bsize=None, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<<
* # create matrix
* cdef PetscMat newmat = NULL
*/
/* 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":360
* return self
*
* def createBAIJ(self, size, bsize, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<<
* # create matrix
* cdef PetscMat newmat = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_53createBAIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_52createBAIJ[] = "Mat.createBAIJ(self, size, bsize, nnz=None, csr=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_53createBAIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createBAIJ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_nnz,&__pyx_n_s_csr,&__pyx_n_s_comm,0};
PyObject* values[5] = {0,0,0,0,0};
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createBAIJ", 0, 2, 5, 1); __PYX_ERR(45, 360, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csr);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createBAIJ") < 0)) __PYX_ERR(45, 360, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_bsize = values[1];
__pyx_v_nnz = values[2];
__pyx_v_csr = values[3];
__pyx_v_comm = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createBAIJ", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 360, __pyx_L3_error)
__pyx_L3_error:;
__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_52createBAIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_52createBAIJ(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":362
* def createBAIJ(self, size, bsize, nnz=None, csr=None, comm=None):
* # create matrix
* cdef PetscMat newmat = NULL # <<<<<<<<<<<<<<
* Mat_Create(MATBAIJ, comm, size, bsize, &newmat)
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_v_newmat = NULL;
/* "petsc4py/PETSc/Mat.pyx":363
* # create matrix
* cdef PetscMat newmat = NULL
* Mat_Create(MATBAIJ, comm, size, bsize, &newmat) # <<<<<<<<<<<<<<
* 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(45, 363, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":364
* cdef PetscMat newmat = NULL
* Mat_Create(MATBAIJ, comm, size, bsize, &newmat)
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* # preallocate matrix
* Mat_AllocAIJ(self.mat, nnz, csr)
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":366
* 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(45, 366, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":367
* # preallocate matrix
* Mat_AllocAIJ(self.mat, nnz, csr)
* return self # <<<<<<<<<<<<<<
*
* def createSBAIJ(self, size, bsize, nnz=None, csr=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":360
* return self
*
* def createBAIJ(self, size, bsize, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<<
* # create matrix
* cdef PetscMat newmat = NULL
*/
/* 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":369
* return self
*
* def createSBAIJ(self, size, bsize, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<<
* # create matrix
* cdef PetscMat newmat = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_55createSBAIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_54createSBAIJ[] = "Mat.createSBAIJ(self, size, bsize, nnz=None, csr=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_55createSBAIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createSBAIJ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_nnz,&__pyx_n_s_csr,&__pyx_n_s_comm,0};
PyObject* values[5] = {0,0,0,0,0};
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createSBAIJ", 0, 2, 5, 1); __PYX_ERR(45, 369, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csr);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSBAIJ") < 0)) __PYX_ERR(45, 369, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_bsize = values[1];
__pyx_v_nnz = values[2];
__pyx_v_csr = values[3];
__pyx_v_comm = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createSBAIJ", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 369, __pyx_L3_error)
__pyx_L3_error:;
__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_54createSBAIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_54createSBAIJ(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":371
* def createSBAIJ(self, size, bsize, nnz=None, csr=None, comm=None):
* # create matrix
* cdef PetscMat newmat = NULL # <<<<<<<<<<<<<<
* Mat_Create(MATSBAIJ, comm, size, bsize, &newmat)
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_v_newmat = NULL;
/* "petsc4py/PETSc/Mat.pyx":372
* # create matrix
* cdef PetscMat newmat = NULL
* Mat_Create(MATSBAIJ, comm, size, bsize, &newmat) # <<<<<<<<<<<<<<
* 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(45, 372, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":373
* cdef PetscMat newmat = NULL
* Mat_Create(MATSBAIJ, comm, size, bsize, &newmat)
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* # preallocate matrix
* Mat_AllocAIJ(self.mat, nnz, csr)
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":375
* 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(45, 375, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":376
* # preallocate matrix
* Mat_AllocAIJ(self.mat, nnz, csr)
* return self # <<<<<<<<<<<<<<
*
* def createAIJCRL(self, size, bsize=None, nnz=None, csr=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":369
* return self
*
* def createSBAIJ(self, size, bsize, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<<
* # create matrix
* cdef PetscMat newmat = NULL
*/
/* 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":378
* return self
*
* def createAIJCRL(self, size, bsize=None, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<<
* # create matrix
* cdef PetscMat newmat = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_57createAIJCRL(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_56createAIJCRL[] = "Mat.createAIJCRL(self, size, bsize=None, nnz=None, csr=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_57createAIJCRL(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createAIJCRL (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_nnz,&__pyx_n_s_csr,&__pyx_n_s_comm,0};
PyObject* values[5] = {0,0,0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csr);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createAIJCRL") < 0)) __PYX_ERR(45, 378, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_bsize = values[1];
__pyx_v_nnz = values[2];
__pyx_v_csr = values[3];
__pyx_v_comm = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createAIJCRL", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 378, __pyx_L3_error)
__pyx_L3_error:;
__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_56createAIJCRL(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_56createAIJCRL(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":380
* def createAIJCRL(self, size, bsize=None, nnz=None, csr=None, comm=None):
* # create matrix
* cdef PetscMat newmat = NULL # <<<<<<<<<<<<<<
* Mat_Create(MATAIJCRL, comm, size, bsize, &newmat)
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_v_newmat = NULL;
/* "petsc4py/PETSc/Mat.pyx":381
* # create matrix
* cdef PetscMat newmat = NULL
* Mat_Create(MATAIJCRL, comm, size, bsize, &newmat) # <<<<<<<<<<<<<<
* 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(45, 381, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":382
* cdef PetscMat newmat = NULL
* Mat_Create(MATAIJCRL, comm, size, bsize, &newmat)
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* # preallocate matrix
* Mat_AllocAIJ(self.mat, nnz, csr)
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":384
* 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(45, 384, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":385
* # preallocate matrix
* Mat_AllocAIJ(self.mat, nnz, csr)
* return self # <<<<<<<<<<<<<<
*
* def setPreallocationNNZ(self, nnz):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":378
* return self
*
* def createAIJCRL(self, size, bsize=None, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<<
* # create matrix
* cdef PetscMat newmat = NULL
*/
/* 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":387
* return self
*
* def setPreallocationNNZ(self, nnz): # <<<<<<<<<<<<<<
* cdef PetscBool done = PETSC_FALSE
* CHKERR( MatIsPreallocated(self.mat, &done) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_59setPreallocationNNZ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_58setPreallocationNNZ[] = "Mat.setPreallocationNNZ(self, nnz)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_59setPreallocationNNZ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_nnz = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nnz,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPreallocationNNZ") < 0)) __PYX_ERR(45, 387, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_nnz = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPreallocationNNZ", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 387, __pyx_L3_error)
__pyx_L3_error:;
__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_58setPreallocationNNZ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nnz);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_58setPreallocationNNZ(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":388
*
* def setPreallocationNNZ(self, nnz):
* 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":389
* def setPreallocationNNZ(self, nnz):
* 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(45, 389, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":391
* 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(45, 391, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":392
* # if done: raise Error(PETSC_ERR_ORDER)
* Mat_AllocAIJ_NNZ(self.mat, nnz)
* return self # <<<<<<<<<<<<<<
*
* def setPreallocationCSR(self, csr):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":387
* return self
*
* def setPreallocationNNZ(self, nnz): # <<<<<<<<<<<<<<
* cdef PetscBool done = PETSC_FALSE
* CHKERR( MatIsPreallocated(self.mat, &done) )
*/
/* 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":394
* return self
*
* def setPreallocationCSR(self, csr): # <<<<<<<<<<<<<<
* cdef PetscBool done = PETSC_FALSE
* CHKERR( MatIsPreallocated(self.mat, &done) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_61setPreallocationCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_60setPreallocationCSR[] = "Mat.setPreallocationCSR(self, csr)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_61setPreallocationCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_csr = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_csr,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csr)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPreallocationCSR") < 0)) __PYX_ERR(45, 394, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_csr = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPreallocationCSR", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 394, __pyx_L3_error)
__pyx_L3_error:;
__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_60setPreallocationCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_csr);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_60setPreallocationCSR(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":395
*
* def setPreallocationCSR(self, csr):
* 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":396
* def setPreallocationCSR(self, csr):
* 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(45, 396, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":398
* 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(45, 398, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":399
* # if done: raise Error(PETSC_ERR_ORDER)
* Mat_AllocAIJ_CSR(self.mat, csr)
* return self # <<<<<<<<<<<<<<
*
* def createAIJWithArrays(self, size, csr, bsize=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":394
* return self
*
* def setPreallocationCSR(self, csr): # <<<<<<<<<<<<<<
* cdef PetscBool done = PETSC_FALSE
* CHKERR( MatIsPreallocated(self.mat, &done) )
*/
/* 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":401
* return self
*
* def createAIJWithArrays(self, size, csr, bsize=None, comm=None): # <<<<<<<<<<<<<<
* # communicator
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_63createAIJWithArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_62createAIJWithArrays[] = "Mat.createAIJWithArrays(self, size, csr, bsize=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_63createAIJWithArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_size = 0;
PyObject *__pyx_v_csr = 0;
PyObject *__pyx_v_bsize = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_csr,&__pyx_n_s_bsize,&__pyx_n_s_comm,0};
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csr)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createAIJWithArrays", 0, 2, 4, 1); __PYX_ERR(45, 401, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createAIJWithArrays") < 0)) __PYX_ERR(45, 401, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_csr = values[1];
__pyx_v_bsize = values[2];
__pyx_v_comm = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createAIJWithArrays", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 401, __pyx_L3_error)
__pyx_L3_error:;
__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_62createAIJWithArrays(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_csr, __pyx_v_bsize, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_62createAIJWithArrays(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_csr, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) {
MPI_Comm __pyx_v_ccomm;
PetscInt __pyx_v_rbs;
PetscInt __pyx_v_cbs;
PetscInt __pyx_v_m;
PetscInt __pyx_v_n;
PetscInt __pyx_v_M;
PetscInt __pyx_v_N;
PyObject *__pyx_v_pi = 0;
PyObject *__pyx_v_pj = 0;
PyObject *__pyx_v_pv = 0;
PyObject *__pyx_v_poi = 0;
PyObject *__pyx_v_poj = 0;
PyObject *__pyx_v_pov = 0;
PetscInt __pyx_v_ni;
PetscInt __pyx_v_noi;
PetscInt *__pyx_v_i;
PetscInt *__pyx_v_oi;
PetscInt __pyx_v_nj;
PetscInt __pyx_v_noj;
PetscInt *__pyx_v_j;
PetscInt *__pyx_v_oj;
PetscInt __pyx_v_nv;
PetscInt __pyx_v_nov;
PetscScalar *__pyx_v_v;
PetscScalar *__pyx_v_ov;
Mat __pyx_v_newmat;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *(*__pyx_t_10)(PyObject *);
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
int __pyx_t_14;
PyObject *__pyx_t_15 = NULL;
int __pyx_t_16;
int __pyx_t_17;
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":403
* def createAIJWithArrays(self, size, csr, bsize=None, comm=None):
* # 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(PyErr_Occurred())) __PYX_ERR(45, 403, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":405
* 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":406
* # 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(45, 406, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":407
* 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) != 0);
if (__pyx_t_3) {
__pyx_v_rbs = 1;
}
/* "petsc4py/PETSc/Mat.pyx":408
* 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) != 0);
if (__pyx_t_3) {
__pyx_v_cbs = __pyx_v_rbs;
}
/* "petsc4py/PETSc/Mat.pyx":409
* 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(45, 409, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":410
* 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(45, 410, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":413
* # 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":414
* 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(45, 414, __pyx_L5_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
#else
__pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 414, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(45, 414, __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(45, 414, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
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(45, 414, __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(45, 414, __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(45, 414, __pyx_L5_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_12 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_9 = PyList_GET_ITEM(sequence, 0);
__pyx_t_11 = PyList_GET_ITEM(sequence, 1);
__pyx_t_12 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(__pyx_t_12);
#else
__pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(45, 414, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(45, 414, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_11);
__pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(45, 414, __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(45, 414, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_10 = Py_TYPE(__pyx_t_13)->tp_iternext;
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(45, 414, __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(45, 414, __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(45, 414, __pyx_L5_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_12 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_12 = PyList_GET_ITEM(sequence, 0);
__pyx_t_11 = PyList_GET_ITEM(sequence, 1);
__pyx_t_9 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_12);
__Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(__pyx_t_9);
#else
__pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(45, 414, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(45, 414, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_11);
__pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(45, 414, __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(45, 414, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_10 = Py_TYPE(__pyx_t_13)->tp_iternext;
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(45, 414, __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(45, 414, __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":413
* # 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":415
* try:
* (pi, pj, pv), (poi, poj, pov) = csr
* except (TypeError, ValueError): # <<<<<<<<<<<<<<
* pi, pj, pv = csr
* poi = poj = pov = None
*/
__pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
if (__pyx_t_14) {
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createAIJWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(45, 415, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_9);
/* "petsc4py/PETSc/Mat.pyx":416
* (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(45, 416, __pyx_L7_except_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_11 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_12 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_13 = PyTuple_GET_ITEM(sequence, 2);
} else {
__pyx_t_11 = PyList_GET_ITEM(sequence, 0);
__pyx_t_12 = PyList_GET_ITEM(sequence, 1);
__pyx_t_13 = PyList_GET_ITEM(sequence, 2);
}
__Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(__pyx_t_12);
__Pyx_INCREF(__pyx_t_13);
#else
__pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(45, 416, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_11);
__pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(45, 416, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_13 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 416, __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(45, 416, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_15);
__pyx_t_10 = Py_TYPE(__pyx_t_15)->tp_iternext;
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(45, 416, __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(45, 416, __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":417
* 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;
__pyx_L7_except_error:;
/* "petsc4py/PETSc/Mat.pyx":413
* # unpack CSR argument
* cdef object pi, pj, pv, poi, poj, pov
* try: # <<<<<<<<<<<<<<
* (pi, pj, pv), (poi, poj, pov) = csr
* except (TypeError, ValueError):
*/
__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":419
* 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":420
* # 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":421
* 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(45, 421, __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":422
* 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(45, 422, __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":423
* 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)) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/Mat.pyx":425
* if ni != m+1: raise ValueError(
* "A matrix with %d rows requires a row pointer of length %d (given: %d)" %
* (toInt(m), toInt(m+1), toInt(ni))) # <<<<<<<<<<<<<<
* if poi is not None and poj is not None:
* poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal)
*/
__pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_9)) __PYX_ERR(45, 425, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m + 1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 425, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_8)) __PYX_ERR(45, 425, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 425, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_GIVEREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8);
__pyx_t_9 = 0;
__pyx_t_7 = 0;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/Mat.pyx":424
* pj = iarray_i(pj, &nj, &j) # Column indices (diagonal)
* if ni != m+1: raise ValueError(
* "A matrix with %d rows requires a row pointer of length %d (given: %d)" % # <<<<<<<<<<<<<<
* (toInt(m), toInt(m+1), toInt(ni)))
* if poi is not None and poj is not None:
*/
__pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_A_matrix_with_d_rows_requires_a, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(45, 424, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
/* "petsc4py/PETSc/Mat.pyx":423
* pi = iarray_i(pi, &ni, &i) # Row pointers (diagonal)
* pj = iarray_i(pj, &nj, &j) # Column indices (diagonal)
* if ni != m+1: raise ValueError( # <<<<<<<<<<<<<<
* "A matrix with %d rows requires a row pointer of length %d (given: %d)" %
* (toInt(m), toInt(m+1), toInt(ni)))
*/
__pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 423, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_Raise(__pyx_t_13, 0, 0, 0);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__PYX_ERR(45, 423, __pyx_L1_error)
}
/* "petsc4py/PETSc/Mat.pyx":426
* "A matrix with %d rows requires a row pointer of length %d (given: %d)" %
* (toInt(m), toInt(m+1), toInt(ni)))
* if poi is not None and poj is not None: # <<<<<<<<<<<<<<
* poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal)
* poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal)
*/
__pyx_t_16 = (__pyx_v_poi != Py_None);
__pyx_t_17 = (__pyx_t_16 != 0);
if (__pyx_t_17) {
} else {
__pyx_t_3 = __pyx_t_17;
goto __pyx_L23_bool_binop_done;
}
__pyx_t_17 = (__pyx_v_poj != Py_None);
__pyx_t_16 = (__pyx_t_17 != 0);
__pyx_t_3 = __pyx_t_16;
__pyx_L23_bool_binop_done:;
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":427
* (toInt(m), toInt(m+1), toInt(ni)))
* if poi is not None and poj is not None:
* poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal) # <<<<<<<<<<<<<<
* poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal)
* cdef PetscInt nv=0, nov=0
*/
__pyx_t_13 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_poi, (&__pyx_v_noi), (&__pyx_v_oi))); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 427, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF_SET(__pyx_v_poi, __pyx_t_13);
__pyx_t_13 = 0;
/* "petsc4py/PETSc/Mat.pyx":428
* if poi is not None and poj is not None:
* poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal)
* poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal) # <<<<<<<<<<<<<<
* cdef PetscInt nv=0, nov=0
* cdef PetscScalar *v=NULL, *ov=NULL
*/
__pyx_t_13 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_poj, (&__pyx_v_noj), (&__pyx_v_oj))); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 428, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF_SET(__pyx_v_poj, __pyx_t_13);
__pyx_t_13 = 0;
/* "petsc4py/PETSc/Mat.pyx":426
* "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":429
* 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":430
* 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":431
* cdef PetscInt nv=0, nov=0
* cdef PetscScalar *v=NULL, *ov=NULL
* pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal) # <<<<<<<<<<<<<<
* if nj != nv: raise ValueError(
* "Given %d column indices but %d non-zero values" %
*/
__pyx_t_13 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_pv, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 431, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF_SET(__pyx_v_pv, __pyx_t_13);
__pyx_t_13 = 0;
/* "petsc4py/PETSc/Mat.pyx":432
* 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) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/Mat.pyx":434
* if nj != nv: raise ValueError(
* "Given %d column indices but %d non-zero values" %
* (toInt(nj), toInt(nv))) # <<<<<<<<<<<<<<
* if pov is not None:
* pov = iarray_s(pov, &nov, &ov) # Non-zero values (off-diagonal)
*/
__pyx_t_13 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_8)) __PYX_ERR(45, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_13);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
__pyx_t_13 = 0;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/Mat.pyx":433
* pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal)
* if nj != nv: raise ValueError(
* "Given %d column indices but %d non-zero values" % # <<<<<<<<<<<<<<
* (toInt(nj), toInt(nv)))
* if pov is not None:
*/
__pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Given_d_column_indices_but_d_non, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(45, 433, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
/* "petsc4py/PETSc/Mat.pyx":432
* cdef PetscScalar *v=NULL, *ov=NULL
* pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal)
* if nj != nv: raise ValueError( # <<<<<<<<<<<<<<
* "Given %d column indices but %d non-zero values" %
* (toInt(nj), toInt(nv)))
*/
__pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 432, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_Raise(__pyx_t_7, 0, 0, 0);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__PYX_ERR(45, 432, __pyx_L1_error)
}
/* "petsc4py/PETSc/Mat.pyx":435
* "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);
__pyx_t_16 = (__pyx_t_3 != 0);
if (__pyx_t_16) {
/* "petsc4py/PETSc/Mat.pyx":436
* (toInt(nj), toInt(nv)))
* if pov is not None:
* pov = iarray_s(pov, &nov, &ov) # Non-zero values (off-diagonal) # <<<<<<<<<<<<<<
* # create matrix
* cdef PetscMat newmat = NULL
*/
__pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_pov, (&__pyx_v_nov), (&__pyx_v_ov))); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF_SET(__pyx_v_pov, __pyx_t_7);
__pyx_t_7 = 0;
/* "petsc4py/PETSc/Mat.pyx":435
* "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":438
* 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":439
* # 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(45, 439, __pyx_L1_error)
__pyx_t_16 = ((__pyx_t_14 == 1) != 0);
if (__pyx_t_16) {
/* "petsc4py/PETSc/Mat.pyx":440
* 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(45, 440, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":442
* CHKERR( MatCreateSeqAIJWithArrays(
* ccomm, m, n, i, j, v, &newmat) )
* csr = (pi, pj, pv) # <<<<<<<<<<<<<<
* else:
* if oi != NULL and oj != NULL and ov != NULL:
*/
__pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 442, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_pi);
__Pyx_GIVEREF(__pyx_v_pi);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_pi);
__Pyx_INCREF(__pyx_v_pj);
__Pyx_GIVEREF(__pyx_v_pj);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_pj);
__Pyx_INCREF(__pyx_v_pv);
__Pyx_GIVEREF(__pyx_v_pv);
PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_pv);
__Pyx_DECREF_SET(__pyx_v_csr, __pyx_t_7);
__pyx_t_7 = 0;
/* "petsc4py/PETSc/Mat.pyx":439
* # 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":444
* csr = (pi, pj, pv)
* else:
* 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_3 = ((__pyx_v_oi != NULL) != 0);
if (__pyx_t_3) {
} else {
__pyx_t_16 = __pyx_t_3;
goto __pyx_L29_bool_binop_done;
}
__pyx_t_3 = ((__pyx_v_oj != NULL) != 0);
if (__pyx_t_3) {
} else {
__pyx_t_16 = __pyx_t_3;
goto __pyx_L29_bool_binop_done;
}
__pyx_t_3 = ((__pyx_v_ov != NULL) != 0);
__pyx_t_16 = __pyx_t_3;
__pyx_L29_bool_binop_done:;
if (__pyx_t_16) {
/* "petsc4py/PETSc/Mat.pyx":445
* else:
* 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(45, 445, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":447
* CHKERR( MatCreateMPIAIJWithSplitArrays(
* ccomm, m, n, M, N, i, j, v, oi, oj, ov, &newmat) )
* csr = ((pi, pj, pv), (poi, poj, pov)) # <<<<<<<<<<<<<<
* else:
* CHKERR( MatCreateMPIAIJWithArrays(
*/
__pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_pi);
__Pyx_GIVEREF(__pyx_v_pi);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_pi);
__Pyx_INCREF(__pyx_v_pj);
__Pyx_GIVEREF(__pyx_v_pj);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_pj);
__Pyx_INCREF(__pyx_v_pv);
__Pyx_GIVEREF(__pyx_v_pv);
PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_pv);
__pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(45, 447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_v_poi);
__Pyx_GIVEREF(__pyx_v_poi);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_poi);
__Pyx_INCREF(__pyx_v_poj);
__Pyx_GIVEREF(__pyx_v_poj);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_poj);
__Pyx_INCREF(__pyx_v_pov);
__Pyx_GIVEREF(__pyx_v_pov);
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_pov);
__pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 447, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_GIVEREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_8);
__pyx_t_7 = 0;
__pyx_t_8 = 0;
__Pyx_DECREF_SET(__pyx_v_csr, __pyx_t_13);
__pyx_t_13 = 0;
/* "petsc4py/PETSc/Mat.pyx":444
* csr = (pi, pj, pv)
* else:
* 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":449
* 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":450
* else:
* CHKERR( MatCreateMPIAIJWithArrays(
* ccomm, m, n, M, N, i, j, v, &newmat) ) # <<<<<<<<<<<<<<
* csr = None
* 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(45, 449, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":451
* CHKERR( MatCreateMPIAIJWithArrays(
* ccomm, m, n, M, N, i, j, v, &newmat) )
* csr = None # <<<<<<<<<<<<<<
* 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":452
* ccomm, m, n, M, N, i, j, v, &newmat) )
* csr = None
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* self.set_attr('__csr__', csr)
* return self
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":453
* csr = None
* PetscCLEAR(self.obj); self.mat = newmat
* self.set_attr('__csr__', csr) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_13 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__csr__"), __pyx_v_csr); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
/* "petsc4py/PETSc/Mat.pyx":454
* 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":401
* return self
*
* def createAIJWithArrays(self, size, csr, bsize=None, comm=None): # <<<<<<<<<<<<<<
* # communicator
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* 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":458
* #
*
* def createDense(self, size, bsize=None, array=None, comm=None): # <<<<<<<<<<<<<<
* # create matrix
* cdef PetscMat newmat = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_65createDense(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_64createDense[] = "Mat.createDense(self, size, bsize=None, array=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_65createDense(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_size = 0;
PyObject *__pyx_v_bsize = 0;
PyObject *__pyx_v_array = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_array,&__pyx_n_s_comm,0};
PyObject* values[4] = {0,0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createDense") < 0)) __PYX_ERR(45, 458, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_bsize = values[1];
__pyx_v_array = values[2];
__pyx_v_comm = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createDense", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 458, __pyx_L3_error)
__pyx_L3_error:;
__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_64createDense(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_array, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_64createDense(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;
int __pyx_t_3;
PyObject *__pyx_t_4 = 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":460
* def createDense(self, size, bsize=None, array=None, comm=None):
* # create matrix
* cdef PetscMat newmat = NULL # <<<<<<<<<<<<<<
* Mat_Create(MATDENSE, comm, size, bsize, &newmat)
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_v_newmat = NULL;
/* "petsc4py/PETSc/Mat.pyx":461
* # create matrix
* cdef PetscMat newmat = NULL
* Mat_Create(MATDENSE, comm, size, bsize, &newmat) # <<<<<<<<<<<<<<
* 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(45, 461, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":462
* cdef PetscMat newmat = NULL
* Mat_Create(MATDENSE, comm, size, bsize, &newmat)
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* # preallocate matrix
* if array is not None:
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":464
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":465
* # preallocate matrix
* if array is not None:
* array = Mat_AllocDense(self.mat, array) # <<<<<<<<<<<<<<
* self.set_attr('__array__', array)
* return self
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_Mat_AllocDense(__pyx_v_self->mat, __pyx_v_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 465, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_array, __pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Mat.pyx":466
* if array is not None:
* array = Mat_AllocDense(self.mat, array)
* self.set_attr('__array__', array) # <<<<<<<<<<<<<<
* 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 *)"__array__"), __pyx_v_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 466, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/Mat.pyx":464
* 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":467
* array = Mat_AllocDense(self.mat, array)
* self.set_attr('__array__', array)
* return self # <<<<<<<<<<<<<<
*
* def createDenseCUDA(self, size, bsize=None, array=None, cudahandle=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":458
* #
*
* def createDense(self, size, bsize=None, array=None, comm=None): # <<<<<<<<<<<<<<
* # create matrix
* cdef PetscMat newmat = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__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":469
* return self
*
* def createDenseCUDA(self, size, bsize=None, array=None, cudahandle=None, comm=None): # <<<<<<<<<<<<<<
* """
* Returns an instance of :class:`Mat`, a MATDENSECUDA with user provided
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_67createDenseCUDA(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_66createDenseCUDA[] = "Mat.createDenseCUDA(self, size, bsize=None, array=None, cudahandle=None, comm=None)\n\n Returns an instance of :class:`Mat`, a MATDENSECUDA with user provided\n memory spaces for CPU and GPU arrays.\n\n :arg size: A list denoting the size of the Mat.\n :arg bsize: A :class:`int` denoting the block size.\n :arg array: A :class:`numpy.ndarray`. Will be lazily allocated if\n *None*.\n :arg cudahandle: Address of the array on the GPU. Will be lazily\n allocated if *None*. If cudahandle is provided, array will be\n ignored.\n :arg comm: MPI communicator\n ";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_67createDenseCUDA(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createDenseCUDA (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_array,&__pyx_n_s_cudahandle,&__pyx_n_s_comm,0};
PyObject* values[5] = {0,0,0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cudahandle);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createDenseCUDA") < 0)) __PYX_ERR(45, 469, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_bsize = values[1];
__pyx_v_array = values[2];
__pyx_v_cudahandle = values[3];
__pyx_v_comm = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createDenseCUDA", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 469, __pyx_L3_error)
__pyx_L3_error:;
__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_66createDenseCUDA(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_array, __pyx_v_cudahandle, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_66createDenseCUDA(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;
int __pyx_t_3;
PetscErrorCode __pyx_t_4;
Py_uintptr_t __pyx_t_5;
PyObject *__pyx_t_6 = 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":484
* """
* # 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":486
* 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(PyErr_Occurred())) __PYX_ERR(45, 486, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":488
* 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 # <<<<<<<<<<<<<<
*
* if cudahandle is 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":490
* cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0
*
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":491
*
* 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_4 = __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_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 491, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":492
* 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_3 = ((__pyx_v_rbs == PETSC_DECIDE) != 0);
if (__pyx_t_3) {
__pyx_v_rbs = 1;
}
/* "petsc4py/PETSc/Mat.pyx":493
* 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_3 = ((__pyx_v_cbs == PETSC_DECIDE) != 0);
if (__pyx_t_3) {
__pyx_v_cbs = __pyx_v_rbs;
}
/* "petsc4py/PETSc/Mat.pyx":494
* 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_4 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_rbs, (&__pyx_v_m), (&__pyx_v_M)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 494, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":495
* 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_4 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_cbs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 495, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":497
* 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_5 = __Pyx_PyInt_As_size_t(__pyx_v_cudahandle); if (unlikely((__pyx_t_5 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(45, 497, __pyx_L1_error)
__pyx_t_4 = __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_5)), (&__pyx_v_newmat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 497, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":499
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetBlockSizes(__pyx_v_newmat, __pyx_v_rbs, __pyx_v_cbs)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 499, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":490
* cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0
*
* 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":501
* 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_4 = __pyx_f_8petsc4py_5PETSc_Mat_Create(MATDENSECUDA, __pyx_v_comm, __pyx_v_size, __pyx_v_bsize, (&__pyx_v_newmat)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 501, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":502
* 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_3 = (__pyx_v_array != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":503
* Mat_Create(MATDENSECUDA, comm, size, bsize, &newmat)
* if array is not None:
* array = Mat_AllocDense(self.mat, array) # <<<<<<<<<<<<<<
* self.set_attr('__array__', array)
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_Mat_AllocDense(__pyx_v_self->mat, __pyx_v_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 503, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF_SET(__pyx_v_array, __pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/Mat.pyx":504
* if array is not None:
* array = Mat_AllocDense(self.mat, array)
* self.set_attr('__array__', array) # <<<<<<<<<<<<<<
* PetscCLEAR(self.obj); self.mat = newmat
* return self
*/
__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 *)"__array__"), __pyx_v_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 504, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/Mat.pyx":502
* 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":505
* array = Mat_AllocDense(self.mat, array)
* self.set_attr('__array__', array)
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":506
* self.set_attr('__array__', array)
* PetscCLEAR(self.obj); self.mat = newmat
* return self # <<<<<<<<<<<<<<
*
* def setPreallocationDense(self, array):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":469
* return self
*
* def createDenseCUDA(self, size, bsize=None, array=None, cudahandle=None, comm=None): # <<<<<<<<<<<<<<
* """
* Returns an instance of :class:`Mat`, a MATDENSECUDA with user provided
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_6);
__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":508
* return self
*
* def setPreallocationDense(self, array): # <<<<<<<<<<<<<<
* cdef PetscBool done = PETSC_FALSE
* CHKERR( MatIsPreallocated(self.mat, &done) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_69setPreallocationDense(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_68setPreallocationDense[] = "Mat.setPreallocationDense(self, array)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_69setPreallocationDense(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_array = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPreallocationDense") < 0)) __PYX_ERR(45, 508, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_array = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPreallocationDense", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 508, __pyx_L3_error)
__pyx_L3_error:;
__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_68setPreallocationDense(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_array);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_68setPreallocationDense(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":509
*
* def setPreallocationDense(self, array):
* 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":510
* def setPreallocationDense(self, array):
* 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(45, 510, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":512
* 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(45, 512, __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":513
* # 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(45, 513, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/Mat.pyx":514
* 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":508
* return self
*
* def setPreallocationDense(self, array): # <<<<<<<<<<<<<<
* cdef PetscBool done = PETSC_FALSE
* CHKERR( MatIsPreallocated(self.mat, &done) )
*/
/* 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":518
* #
*
* def createScatter(self, Scatter scatter, comm=None): # <<<<<<<<<<<<<<
* if comm is None: comm = scatter.getComm()
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_71createScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_70createScatter[] = "Mat.createScatter(self, Scatter scatter, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_71createScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscScatterObject *__pyx_v_scatter = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scatter,&__pyx_n_s_comm,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scatter)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createScatter") < 0)) __PYX_ERR(45, 518, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_scatter = ((struct PyPetscScatterObject *)values[0]);
__pyx_v_comm = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createScatter", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 518, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createScatter", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scatter), __pyx_ptype_8petsc4py_5PETSc_Scatter, 0, "scatter", 0))) __PYX_ERR(45, 518, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_70createScatter(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_scatter, __pyx_v_comm);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_70createScatter(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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
MPI_Comm __pyx_t_6;
PetscErrorCode __pyx_t_7;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createScatter", 0);
__Pyx_INCREF(__pyx_v_comm);
/* "petsc4py/PETSc/Mat.pyx":519
*
* def createScatter(self, Scatter scatter, comm=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_scatter), __pyx_n_s_getComm); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 519, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 519, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_comm, __pyx_t_3);
__pyx_t_3 = 0;
}
/* "petsc4py/PETSc/Mat.pyx":520
* def createScatter(self, Scatter scatter, comm=None):
* if comm is None: comm = scatter.getComm()
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<<
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateScatter(ccomm, scatter.sct, &newmat) )
*/
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 520, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_6;
/* "petsc4py/PETSc/Mat.pyx":521
* 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) )
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_v_newmat = NULL;
/* "petsc4py/PETSc/Mat.pyx":522
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateScatter(ccomm, scatter.sct, &newmat) ) # <<<<<<<<<<<<<<
* PetscCLEAR(self.obj); self.mat = newmat
* return self
*/
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateScatter(__pyx_v_ccomm, __pyx_v_scatter->sct, (&__pyx_v_newmat))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 522, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":523
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateScatter(ccomm, scatter.sct, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":524
* CHKERR( MatCreateScatter(ccomm, scatter.sct, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
* return self # <<<<<<<<<<<<<<
*
* def createNormal(self, Mat mat):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":518
* #
*
* def createScatter(self, Scatter scatter, comm=None): # <<<<<<<<<<<<<<
* if comm is None: comm = scatter.getComm()
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* 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.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":526
* return self
*
* def createNormal(self, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateNormal(mat.mat, &newmat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_73createNormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_72createNormal[] = "Mat.createNormal(self, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_73createNormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createNormal") < 0)) __PYX_ERR(45, 526, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createNormal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 526, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createNormal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(45, 526, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_72createNormal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_72createNormal(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":527
*
* def createNormal(self, Mat mat):
* cdef PetscMat newmat = NULL # <<<<<<<<<<<<<<
* CHKERR( MatCreateNormal(mat.mat, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_v_newmat = NULL;
/* "petsc4py/PETSc/Mat.pyx":528
* def createNormal(self, Mat mat):
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateNormal(mat.mat, &newmat) ) # <<<<<<<<<<<<<<
* 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(45, 528, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":529
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateNormal(mat.mat, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":530
* CHKERR( MatCreateNormal(mat.mat, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
* return self # <<<<<<<<<<<<<<
*
* def createTranspose(self, Mat mat):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":526
* return self
*
* def createNormal(self, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateNormal(mat.mat, &newmat) )
*/
/* 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":532
* return self
*
* def createTranspose(self, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateTranspose(mat.mat, &newmat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_75createTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_74createTranspose[] = "Mat.createTranspose(self, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_75createTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createTranspose") < 0)) __PYX_ERR(45, 532, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createTranspose", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 532, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(45, 532, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_74createTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_74createTranspose(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":533
*
* def createTranspose(self, Mat mat):
* cdef PetscMat newmat = NULL # <<<<<<<<<<<<<<
* CHKERR( MatCreateTranspose(mat.mat, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_v_newmat = NULL;
/* "petsc4py/PETSc/Mat.pyx":534
* def createTranspose(self, Mat mat):
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateTranspose(mat.mat, &newmat) ) # <<<<<<<<<<<<<<
* 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(45, 534, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":535
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateTranspose(mat.mat, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":536
* CHKERR( MatCreateTranspose(mat.mat, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
* return self # <<<<<<<<<<<<<<
*
* def createNormalHermitian(self, Mat mat):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":532
* return self
*
* def createTranspose(self, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateTranspose(mat.mat, &newmat) )
*/
/* 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":538
* return self
*
* def createNormalHermitian(self, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateNormalHermitian(mat.mat, &newmat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_77createNormalHermitian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_76createNormalHermitian[] = "Mat.createNormalHermitian(self, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_77createNormalHermitian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createNormalHermitian") < 0)) __PYX_ERR(45, 538, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createNormalHermitian", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 538, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createNormalHermitian", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(45, 538, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_76createNormalHermitian(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_76createNormalHermitian(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":539
*
* def createNormalHermitian(self, Mat mat):
* cdef PetscMat newmat = NULL # <<<<<<<<<<<<<<
* CHKERR( MatCreateNormalHermitian(mat.mat, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_v_newmat = NULL;
/* "petsc4py/PETSc/Mat.pyx":540
* def createNormalHermitian(self, Mat mat):
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateNormalHermitian(mat.mat, &newmat) ) # <<<<<<<<<<<<<<
* 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(45, 540, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":541
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateNormalHermitian(mat.mat, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":542
* CHKERR( MatCreateNormalHermitian(mat.mat, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
* return self # <<<<<<<<<<<<<<
*
* def createHermitianTranspose(self, Mat mat):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":538
* return self
*
* def createNormalHermitian(self, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateNormalHermitian(mat.mat, &newmat) )
*/
/* 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":544
* return self
*
* def createHermitianTranspose(self, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateHermitianTranspose(mat.mat, &newmat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_79createHermitianTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_78createHermitianTranspose[] = "Mat.createHermitianTranspose(self, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_79createHermitianTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createHermitianTranspose") < 0)) __PYX_ERR(45, 544, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createHermitianTranspose", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 544, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createHermitianTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(45, 544, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_78createHermitianTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_78createHermitianTranspose(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":545
*
* def createHermitianTranspose(self, Mat mat):
* cdef PetscMat newmat = NULL # <<<<<<<<<<<<<<
* CHKERR( MatCreateHermitianTranspose(mat.mat, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_v_newmat = NULL;
/* "petsc4py/PETSc/Mat.pyx":546
* def createHermitianTranspose(self, Mat mat):
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateHermitianTranspose(mat.mat, &newmat) ) # <<<<<<<<<<<<<<
* 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(45, 546, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":547
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateHermitianTranspose(mat.mat, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":548
* CHKERR( MatCreateHermitianTranspose(mat.mat, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
* return self # <<<<<<<<<<<<<<
*
* def createLRC(self, Mat A or None, Mat U, Vec c or None, Mat V or None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":544
* return self
*
* def createHermitianTranspose(self, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateHermitianTranspose(mat.mat, &newmat) )
*/
/* 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":550
* return self
*
* def createLRC(self, Mat A or None, Mat U, Vec c or None, Mat V or None): # <<<<<<<<<<<<<<
* cdef PetscMat Amat = NULL
* cdef PetscMat Umat = U.mat
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_81createLRC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_80createLRC[] = "Mat.createLRC(self, Mat A, Mat U, Vec c, Mat V)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_81createLRC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_A = 0;
struct PyPetscMatObject *__pyx_v_U = 0;
struct PyPetscVecObject *__pyx_v_c = 0;
struct PyPetscMatObject *__pyx_v_V = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_U,&__pyx_n_s_c,&__pyx_n_s_V,0};
PyObject* values[4] = {0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createLRC", 1, 4, 4, 1); __PYX_ERR(45, 550, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createLRC", 1, 4, 4, 2); __PYX_ERR(45, 550, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createLRC", 1, 4, 4, 3); __PYX_ERR(45, 550, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createLRC") < 0)) __PYX_ERR(45, 550, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
}
__pyx_v_A = ((struct PyPetscMatObject *)values[0]);
__pyx_v_U = ((struct PyPetscMatObject *)values[1]);
__pyx_v_c = ((struct PyPetscVecObject *)values[2]);
__pyx_v_V = ((struct PyPetscMatObject *)values[3]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createLRC", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 550, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createLRC", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(45, 550, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_U), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "U", 0))) __PYX_ERR(45, 550, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "c", 0))) __PYX_ERR(45, 550, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_V), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "V", 0))) __PYX_ERR(45, 550, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_80createLRC(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_A, __pyx_v_U, __pyx_v_c, __pyx_v_V);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_80createLRC(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;
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("createLRC", 0);
/* "petsc4py/PETSc/Mat.pyx":551
*
* def createLRC(self, Mat A or None, Mat U, Vec c or None, Mat V or None):
* cdef PetscMat Amat = NULL # <<<<<<<<<<<<<<
* cdef PetscMat Umat = U.mat
* cdef PetscVec cvec = NULL
*/
__pyx_v_Amat = NULL;
/* "petsc4py/PETSc/Mat.pyx":552
* def createLRC(self, Mat A or None, Mat U, Vec c or None, Mat V or None):
* 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":553
* 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":554
* 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":555
* 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":556
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_1 = __pyx_v_A->mat;
__pyx_v_Amat = __pyx_t_1;
}
/* "petsc4py/PETSc/Mat.pyx":557
* 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_3 = (((PyObject *)__pyx_v_c) != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
__pyx_t_4 = __pyx_v_c->vec;
__pyx_v_cvec = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":558
* 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) )
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_t_2 = (((PyObject *)__pyx_v_V) != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_1 = __pyx_v_V->mat;
__pyx_v_Vmat = __pyx_t_1;
}
/* "petsc4py/PETSc/Mat.pyx":559
* if c is not None: cvec = c.vec
* if V is not None: Vmat = V.mat
* CHKERR( MatCreateLRC(Amat, Umat, cvec, Vmat, &newmat) ) # <<<<<<<<<<<<<<
* PetscCLEAR(self.obj); self.mat = newmat
* return self
*/
__pyx_t_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 559, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":560
* if V is not None: Vmat = V.mat
* CHKERR( MatCreateLRC(Amat, Umat, cvec, Vmat, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":561
* CHKERR( MatCreateLRC(Amat, Umat, cvec, Vmat, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
* return self # <<<<<<<<<<<<<<
*
* def createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":550
* return self
*
* def createLRC(self, Mat A or None, Mat U, Vec c or None, Mat V or None): # <<<<<<<<<<<<<<
* cdef PetscMat Amat = NULL
* cdef PetscMat Umat = U.mat
*/
/* 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":563
* return self
*
* def createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None): # <<<<<<<<<<<<<<
* if iscol is None: iscol = isrow
* cdef PetscMat newmat = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_83createSubMatrixVirtual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_82createSubMatrixVirtual[] = "Mat.createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_83createSubMatrixVirtual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_A = 0;
struct PyPetscISObject *__pyx_v_isrow = 0;
struct PyPetscISObject *__pyx_v_iscol = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_isrow,&__pyx_n_s_iscol,0};
PyObject* values[3] = {0,0,0};
values[2] = (PyObject *)((struct PyPetscISObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("createSubMatrixVirtual", 0, 2, 3, 1); __PYX_ERR(45, 563, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSubMatrixVirtual") < 0)) __PYX_ERR(45, 563, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_A = ((struct PyPetscMatObject *)values[0]);
__pyx_v_isrow = ((struct PyPetscISObject *)values[1]);
__pyx_v_iscol = ((struct PyPetscISObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createSubMatrixVirtual", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 563, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createSubMatrixVirtual", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "A", 0))) __PYX_ERR(45, 563, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(45, 563, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "iscol", 0))) __PYX_ERR(45, 563, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_82createSubMatrixVirtual(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_A, __pyx_v_isrow, __pyx_v_iscol);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_82createSubMatrixVirtual(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;
int __pyx_t_2;
PetscErrorCode __pyx_t_3;
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":564
*
* def createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(((PyObject *)__pyx_v_isrow));
__Pyx_DECREF_SET(__pyx_v_iscol, __pyx_v_isrow);
}
/* "petsc4py/PETSc/Mat.pyx":565
* def createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None):
* if iscol is None: iscol = isrow
* cdef PetscMat newmat = NULL # <<<<<<<<<<<<<<
* CHKERR( MatCreateSubMatrixVirtual(A.mat, isrow.iset, iscol.iset, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_v_newmat = NULL;
/* "petsc4py/PETSc/Mat.pyx":566
* if iscol is None: iscol = isrow
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateSubMatrixVirtual(A.mat, isrow.iset, iscol.iset, &newmat) ) # <<<<<<<<<<<<<<
* PetscCLEAR(self.obj); self.mat = newmat
* return self
*/
__pyx_t_3 = __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_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 566, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":567
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateSubMatrixVirtual(A.mat, isrow.iset, iscol.iset, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":568
* CHKERR( MatCreateSubMatrixVirtual(A.mat, isrow.iset, iscol.iset, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
* return self # <<<<<<<<<<<<<<
*
* def createNest(self, mats, isrows=None, iscols=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":563
* return self
*
* def createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None): # <<<<<<<<<<<<<<
* if iscol is None: iscol = isrow
* cdef PetscMat newmat = NULL
*/
/* 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":570
* return self
*
* def createNest(self, mats, isrows=None, iscols=None, comm=None): # <<<<<<<<<<<<<<
* cdef object mat
* mats = [list(mat) for mat in mats]
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_85createNest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_84createNest[] = "Mat.createNest(self, mats, isrows=None, iscols=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_85createNest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_mats = 0;
PyObject *__pyx_v_isrows = 0;
PyObject *__pyx_v_iscols = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mats,&__pyx_n_s_isrows,&__pyx_n_s_iscols,&__pyx_n_s_comm,0};
PyObject* values[4] = {0,0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mats)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrows);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscols);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createNest") < 0)) __PYX_ERR(45, 570, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mats = values[0];
__pyx_v_isrows = values[1];
__pyx_v_iscols = values[2];
__pyx_v_comm = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createNest", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 570, __pyx_L3_error)
__pyx_L3_error:;
__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_84createNest(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mats, __pyx_v_isrows, __pyx_v_iscols, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_84createNest(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mats, PyObject *__pyx_v_isrows, PyObject *__pyx_v_iscols, PyObject *__pyx_v_comm) {
PyObject *__pyx_v_mat = 0;
MPI_Comm __pyx_v_ccomm;
Py_ssize_t __pyx_v_i;
Py_ssize_t __pyx_v_mr;
Py_ssize_t __pyx_v_j;
Py_ssize_t __pyx_v_mc;
PetscInt __pyx_v_nr;
PetscInt __pyx_v_nc;
Mat *__pyx_v_cmats;
IS *__pyx_v_cisrows;
IS *__pyx_v_ciscols;
CYTHON_UNUSED PyObject *__pyx_v_tmp1 = 0;
CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0;
CYTHON_UNUSED PyObject *__pyx_v_tmp3 = 0;
Mat __pyx_v_newmat;
PyObject *__pyx_8genexpr3__pyx_v_mat = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
PyObject *(*__pyx_t_4)(PyObject *);
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
Py_ssize_t __pyx_t_7;
MPI_Comm __pyx_t_8;
Mat __pyx_t_9;
int __pyx_t_10;
IS __pyx_t_11;
PetscErrorCode __pyx_t_12;
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":572
* def createNest(self, mats, isrows=None, iscols=None, comm=None):
* 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(45, 572, __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(45, 572, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 572, __pyx_L5_error)
}
for (;;) {
if (likely(!__pyx_t_4)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(45, 572, __pyx_L5_error)
#else
__pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 572, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
} else {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(45, 572, __pyx_L5_error)
#else
__pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 572, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
}
} else {
__pyx_t_5 = __pyx_t_4(__pyx_t_2);
if (unlikely(!__pyx_t_5)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(45, 572, __pyx_L5_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_5);
}
__Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_mat, __pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_5 = PySequence_List(__pyx_8genexpr3__pyx_v_mat); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 572, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_5);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(45, 572, __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_L8_exit_scope;
__pyx_L5_error:;
__Pyx_XDECREF(__pyx_8genexpr3__pyx_v_mat); __pyx_8genexpr3__pyx_v_mat = 0;
goto __pyx_L1_error;
__pyx_L8_exit_scope:;
} /* exit inner scope */
__Pyx_DECREF_SET(__pyx_v_mats, __pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":573
* 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(45, 573, __pyx_L1_error)
if (__pyx_t_6) {
/* "petsc4py/PETSc/Mat.pyx":574
* 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(45, 574, __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":575
* 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(45, 575, __pyx_L1_error)
__pyx_t_7 = PyObject_Length(__pyx_v_mats); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(45, 575, __pyx_L1_error)
if (unlikely(!((__pyx_t_3 == __pyx_t_7) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(45, 575, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/Mat.pyx":573
* cdef object mat
* mats = [list(mat) for mat in mats]
* if isrows: # <<<<<<<<<<<<<<
* isrows = list(isrows)
* assert len(isrows) == len(mats)
*/
goto __pyx_L9;
}
/* "petsc4py/PETSc/Mat.pyx":577
* 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_L9:;
/* "petsc4py/PETSc/Mat.pyx":578
* 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(45, 578, __pyx_L1_error)
if (__pyx_t_6) {
/* "petsc4py/PETSc/Mat.pyx":579
* 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(45, 579, __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":580
* 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(45, 580, __pyx_L1_error)
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_mats, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 580, __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(45, 580, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!((__pyx_t_7 == __pyx_t_3) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(45, 580, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/Mat.pyx":578
* else:
* isrows = None
* if iscols: # <<<<<<<<<<<<<<
* iscols = list(iscols)
* assert len(iscols) == len(mats[0])
*/
goto __pyx_L10;
}
/* "petsc4py/PETSc/Mat.pyx":582
* 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_L10:;
/* "petsc4py/PETSc/Mat.pyx":583
* 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(PyErr_Occurred())) __PYX_ERR(45, 583, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_8;
/* "petsc4py/PETSc/Mat.pyx":584
* 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(45, 584, __pyx_L1_error)
__pyx_v_mr = __pyx_t_3;
/* "petsc4py/PETSc/Mat.pyx":585
* 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_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 585, __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(45, 585, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_mc = __pyx_t_3;
/* "petsc4py/PETSc/Mat.pyx":586
* 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":587
* 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":588
* 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":589
* cdef PetscInt nc = <PetscInt>mc
* cdef PetscMat *cmats = NULL
* cdef PetscIS *cisrows = NULL # <<<<<<<<<<<<<<
* cdef PetscIS *ciscols = NULL
* cdef object tmp1, tmp2, tmp3
*/
__pyx_v_cisrows = NULL;
/* "petsc4py/PETSc/Mat.pyx":590
* cdef PetscMat *cmats = NULL
* cdef PetscIS *cisrows = NULL
* cdef PetscIS *ciscols = NULL # <<<<<<<<<<<<<<
* cdef object tmp1, tmp2, tmp3
* tmp1 = oarray_p(empty_p(nr*nc), NULL, <void**>&cmats)
*/
__pyx_v_ciscols = NULL;
/* "petsc4py/PETSc/Mat.pyx":592
* cdef PetscIS *ciscols = NULL
* cdef object tmp1, tmp2, tmp3
* tmp1 = 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(45, 592, __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(45, 592, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_tmp1 = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Mat.pyx":593
* cdef object tmp1, tmp2, tmp3
* tmp1 = 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":594
* tmp1 = 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":595
* 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, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 595, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 595, __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":596
* 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:
* tmp2 = oarray_p(empty_p(nr), NULL, <void**>&cisrows)
*/
__pyx_t_6 = (__pyx_v_mat != Py_None);
if ((__pyx_t_6 != 0)) {
if (!(likely(__Pyx_TypeTest(__pyx_v_mat, __pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(45, 596, __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":597
* mat = mats[i][j]
* cmats[i*mc+j] = (<Mat?>mat).mat if mat is not None else NULL
* if isrows is not None: # <<<<<<<<<<<<<<
* tmp2 = 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);
__pyx_t_10 = (__pyx_t_6 != 0);
if (__pyx_t_10) {
/* "petsc4py/PETSc/Mat.pyx":598
* cmats[i*mc+j] = (<Mat?>mat).mat if mat is not None else NULL
* if isrows is not None:
* tmp2 = 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(45, 598, __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(45, 598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_tmp2 = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Mat.pyx":599
* if isrows is not None:
* tmp2 = 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:
* tmp3 = 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, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(45, 599, __pyx_L1_error)
__pyx_t_11 = ((struct PyPetscISObject *)__pyx_t_2)->iset;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
(__pyx_v_cisrows[__pyx_v_i]) = __pyx_t_11;
}
/* "petsc4py/PETSc/Mat.pyx":597
* mat = mats[i][j]
* cmats[i*mc+j] = (<Mat?>mat).mat if mat is not None else NULL
* if isrows is not None: # <<<<<<<<<<<<<<
* tmp2 = oarray_p(empty_p(nr), NULL, <void**>&cisrows)
* for i from 0 <= i < mr: cisrows[i] = (<IS?>isrows[i]).iset
*/
}
/* "petsc4py/PETSc/Mat.pyx":600
* tmp2 = 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: # <<<<<<<<<<<<<<
* tmp3 = oarray_p(empty_p(nc), NULL, <void**>&ciscols)
* for j from 0 <= j < mc: ciscols[j] = (<IS?>iscols[j]).iset
*/
__pyx_t_10 = (__pyx_v_iscols != Py_None);
__pyx_t_6 = (__pyx_t_10 != 0);
if (__pyx_t_6) {
/* "petsc4py/PETSc/Mat.pyx":601
* for i from 0 <= i < mr: cisrows[i] = (<IS?>isrows[i]).iset
* if iscols is not None:
* tmp3 = 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(45, 601, __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(45, 601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_tmp3 = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":602
* if iscols is not None:
* tmp3 = 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, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(45, 602, __pyx_L1_error)
__pyx_t_11 = ((struct PyPetscISObject *)__pyx_t_1)->iset;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
(__pyx_v_ciscols[__pyx_v_j]) = __pyx_t_11;
}
/* "petsc4py/PETSc/Mat.pyx":600
* tmp2 = 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: # <<<<<<<<<<<<<<
* tmp3 = oarray_p(empty_p(nc), NULL, <void**>&ciscols)
* for j from 0 <= j < mc: ciscols[j] = (<IS?>iscols[j]).iset
*/
}
/* "petsc4py/PETSc/Mat.pyx":603
* tmp3 = 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) )
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_v_newmat = NULL;
/* "petsc4py/PETSc/Mat.pyx":604
* 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) ) # <<<<<<<<<<<<<<
* PetscCLEAR(self.obj); self.mat = newmat
* return self
*/
__pyx_t_12 = __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_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 604, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":605
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateNest(ccomm, nr, cisrows, nc, ciscols, cmats, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":606
* CHKERR( MatCreateNest(ccomm, nr, cisrows, nc, ciscols, cmats, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
* return self # <<<<<<<<<<<<<<
*
* def createH2OpusFromMat(self, Mat A, coordinates=None, dist=None, eta=None, leafsize=None, maxrank=None, bs=None, rtol=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":570
* return self
*
* def createNest(self, mats, isrows=None, iscols=None, comm=None): # <<<<<<<<<<<<<<
* cdef object mat
* mats = [list(mat) for mat in mats]
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createNest", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_mat);
__Pyx_XDECREF(__pyx_v_tmp1);
__Pyx_XDECREF(__pyx_v_tmp2);
__Pyx_XDECREF(__pyx_v_tmp3);
__Pyx_XDECREF(__pyx_8genexpr3__pyx_v_mat);
__Pyx_XDECREF(__pyx_v_mats);
__Pyx_XDECREF(__pyx_v_isrows);
__Pyx_XDECREF(__pyx_v_iscols);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":608
* return self
*
* def createH2OpusFromMat(self, Mat A, coordinates=None, dist=None, eta=None, leafsize=None, maxrank=None, bs=None, rtol=None): # <<<<<<<<<<<<<<
* cdef PetscInt cdim = 1
* cdef PetscReal *coords = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_87createH2OpusFromMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_86createH2OpusFromMat[] = "Mat.createH2OpusFromMat(self, Mat A, coordinates=None, dist=None, eta=None, leafsize=None, maxrank=None, bs=None, rtol=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_87createH2OpusFromMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createH2OpusFromMat (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_coordinates,&__pyx_n_s_dist,&__pyx_n_s_eta,&__pyx_n_s_leafsize,&__pyx_n_s_maxrank,&__pyx_n_s_bs,&__pyx_n_s_rtol,0};
PyObject* values[8] = {0,0,0,0,0,0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
values[5] = ((PyObject *)Py_None);
values[6] = ((PyObject *)Py_None);
values[7] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
CYTHON_FALLTHROUGH;
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
CYTHON_FALLTHROUGH;
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
CYTHON_FALLTHROUGH;
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coordinates);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dist);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eta);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafsize);
if (value) { values[4] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 5:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxrank);
if (value) { values[5] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 6:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs);
if (value) { values[6] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 7:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rtol);
if (value) { values[7] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createH2OpusFromMat") < 0)) __PYX_ERR(45, 608, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
CYTHON_FALLTHROUGH;
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
CYTHON_FALLTHROUGH;
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
CYTHON_FALLTHROUGH;
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_A = ((struct PyPetscMatObject *)values[0]);
__pyx_v_coordinates = values[1];
__pyx_v_dist = values[2];
__pyx_v_eta = values[3];
__pyx_v_leafsize = values[4];
__pyx_v_maxrank = values[5];
__pyx_v_bs = values[6];
__pyx_v_rtol = values[7];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createH2OpusFromMat", 0, 1, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 608, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createH2OpusFromMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "A", 0))) __PYX_ERR(45, 608, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_86createH2OpusFromMat(((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);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_86createH2OpusFromMat(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;
int __pyx_t_2;
PetscBool __pyx_t_3;
PetscReal __pyx_t_4;
PetscInt __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("createH2OpusFromMat", 0);
/* "petsc4py/PETSc/Mat.pyx":609
*
* def createH2OpusFromMat(self, Mat A, coordinates=None, dist=None, eta=None, leafsize=None, maxrank=None, bs=None, rtol=None):
* cdef PetscInt cdim = 1 # <<<<<<<<<<<<<<
* cdef PetscReal *coords = NULL
* cdef PetscBool cdist = PETSC_FALSE
*/
__pyx_v_cdim = 1;
/* "petsc4py/PETSc/Mat.pyx":610
* def createH2OpusFromMat(self, Mat A, coordinates=None, dist=None, eta=None, leafsize=None, maxrank=None, bs=None, rtol=None):
* 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":611
* 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":612
* 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":613
* 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":614
* 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":615
* 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":616
* 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":619
* 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":620
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_dist); if (unlikely(__pyx_t_3 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(45, 620, __pyx_L1_error)
__pyx_v_cdist = __pyx_t_3;
}
/* "petsc4py/PETSc/Mat.pyx":621
* 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_2 = (__pyx_v_eta != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_eta); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(45, 621, __pyx_L1_error)
__pyx_v_peta = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":622
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_leafsize); if (unlikely(__pyx_t_5 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 622, __pyx_L1_error)
__pyx_v_lsize = __pyx_t_5;
}
/* "petsc4py/PETSc/Mat.pyx":623
* 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_2 = (__pyx_v_maxrank != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_maxrank); if (unlikely(__pyx_t_5 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 623, __pyx_L1_error)
__pyx_v_maxr = __pyx_t_5;
}
/* "petsc4py/PETSc/Mat.pyx":624
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bs); if (unlikely(__pyx_t_5 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 624, __pyx_L1_error)
__pyx_v_pbs = __pyx_t_5;
}
/* "petsc4py/PETSc/Mat.pyx":625
* 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_2 = (__pyx_v_rtol != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(45, 625, __pyx_L1_error)
__pyx_v_tol = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":627
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":628
*
* 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_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_coordinates, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 628, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_v_xyz = ((PyArrayObject *)__pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/Mat.pyx":629
* 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_2 = (PyArray_ISFORTRAN(__pyx_v_xyz) != 0);
if (__pyx_t_2) {
__pyx_t_6 = ((PyObject *)PyArray_Copy(__pyx_v_xyz)); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 629, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF_SET(__pyx_v_xyz, ((PyArrayObject *)__pyx_t_6));
__pyx_t_6 = 0;
}
/* "petsc4py/PETSc/Mat.pyx":630
* 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) != 0);
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/Mat.pyx":632
* 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_6 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_xyz)); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 632, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_coordinates_must_have_two_dimens, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 632, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/Mat.pyx":630
* 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_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 630, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__PYX_ERR(45, 630, __pyx_L1_error)
}
/* "petsc4py/PETSc/Mat.pyx":633
* ("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":634
* "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_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_A->mat, (&__pyx_v_rl), (&__pyx_v_cl))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 634, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":635
* 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_2 = ((__pyx_v_cl != __pyx_v_rl) != 0);
if (unlikely(__pyx_t_2)) {
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 635, __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(45, 635, __pyx_L1_error)
}
/* "petsc4py/PETSc/Mat.pyx":636
* 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_2 = ((__pyx_v_nvtx < __pyx_v_rl) != 0);
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/Mat.pyx":637
* 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_PyInt_From_PetscInt(__pyx_v_rl); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 637, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_coordinates_size_must_be_at_leas, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 637, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
/* "petsc4py/PETSc/Mat.pyx":636
* 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_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 636, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__PYX_ERR(45, 636, __pyx_L1_error)
}
/* "petsc4py/PETSc/Mat.pyx":638
* 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":639
* ("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":627
* 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":641
* coords = <PetscReal*> PyArray_DATA(xyz)
*
* cdef PetscMat newmat = NULL # <<<<<<<<<<<<<<
* CHKERR( MatCreateH2OpusFromMat(A.mat, cdim, coords, cdist, peta, lsize, maxr, pbs, tol, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_v_newmat = NULL;
/* "petsc4py/PETSc/Mat.pyx":642
*
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateH2OpusFromMat(A.mat, cdim, coords, cdist, peta, lsize, maxr, pbs, tol, &newmat) ) # <<<<<<<<<<<<<<
* PetscCLEAR(self.obj); self.mat = newmat
* return self
*/
__pyx_t_8 = __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_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 642, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":643
* cdef PetscMat newmat = NULL
* CHKERR( MatCreateH2OpusFromMat(A.mat, cdim, coords, cdist, peta, lsize, maxr, pbs, tol, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":644
* CHKERR( MatCreateH2OpusFromMat(A.mat, cdim, coords, cdist, peta, lsize, maxr, pbs, tol, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
* return self # <<<<<<<<<<<<<<
*
* def createIS(self, size, LGMap lgmapr=None, LGMap lgmapc=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":608
* return self
*
* def createH2OpusFromMat(self, Mat A, coordinates=None, dist=None, eta=None, leafsize=None, maxrank=None, bs=None, rtol=None): # <<<<<<<<<<<<<<
* cdef PetscInt cdim = 1
* cdef PetscReal *coords = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__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":646
* return self
*
* def createIS(self, size, LGMap lgmapr=None, LGMap lgmapc=None, comm=None): # <<<<<<<<<<<<<<
* # communicator and sizes
* if comm is None and lgmapr is not None: comm = lgmapr.getComm()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_89createIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_88createIS[] = "Mat.createIS(self, size, LGMap lgmapr=None, LGMap lgmapc=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_89createIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_size = 0;
struct PyPetscLGMapObject *__pyx_v_lgmapr = 0;
struct PyPetscLGMapObject *__pyx_v_lgmapc = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_lgmapr,&__pyx_n_s_lgmapc,&__pyx_n_s_comm,0};
PyObject* values[4] = {0,0,0,0};
values[1] = (PyObject *)((struct PyPetscLGMapObject *)Py_None);
values[2] = (PyObject *)((struct PyPetscLGMapObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lgmapr);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lgmapc);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createIS") < 0)) __PYX_ERR(45, 646, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_lgmapr = ((struct PyPetscLGMapObject *)values[1]);
__pyx_v_lgmapc = ((struct PyPetscLGMapObject *)values[2]);
__pyx_v_comm = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createIS", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 646, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createIS", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lgmapr), __pyx_ptype_8petsc4py_5PETSc_LGMap, 1, "lgmapr", 0))) __PYX_ERR(45, 646, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lgmapc), __pyx_ptype_8petsc4py_5PETSc_LGMap, 1, "lgmapc", 0))) __PYX_ERR(45, 646, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_88createIS(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_lgmapr, __pyx_v_lgmapc, __pyx_v_comm);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_88createIS(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, struct PyPetscLGMapObject *__pyx_v_lgmapr, struct PyPetscLGMapObject *__pyx_v_lgmapc, PyObject *__pyx_v_comm) {
ISLocalToGlobalMapping __pyx_v_lgmr;
ISLocalToGlobalMapping __pyx_v_lgmc;
MPI_Comm __pyx_v_ccomm;
PetscInt __pyx_v_rbs;
PetscInt __pyx_v_cbs;
PetscInt __pyx_v_m;
PetscInt __pyx_v_n;
PetscInt __pyx_v_M;
PetscInt __pyx_v_N;
Mat __pyx_v_newmat;
PetscInt __pyx_v_bs;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
MPI_Comm __pyx_t_7;
PetscErrorCode __pyx_t_8;
ISLocalToGlobalMapping __pyx_t_9;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createIS", 0);
__Pyx_INCREF(__pyx_v_comm);
/* "petsc4py/PETSc/Mat.pyx":648
* def createIS(self, size, LGMap lgmapr=None, LGMap lgmapc=None, comm=None):
* # 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
} else {
__pyx_t_1 = __pyx_t_3;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_3 = (((PyObject *)__pyx_v_lgmapr) != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_lgmapr), __pyx_n_s_getComm); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 648, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 648, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_comm, __pyx_t_4);
__pyx_t_4 = 0;
}
/* "petsc4py/PETSc/Mat.pyx":649
* # 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
} else {
__pyx_t_1 = __pyx_t_3;
goto __pyx_L7_bool_binop_done;
}
__pyx_t_3 = (((PyObject *)__pyx_v_lgmapc) != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L7_bool_binop_done:;
if (__pyx_t_1) {
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_lgmapc), __pyx_n_s_getComm); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 649, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 649, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_comm, __pyx_t_4);
__pyx_t_4 = 0;
}
/* "petsc4py/PETSc/Mat.pyx":650
* 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":651
* 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":652
* cdef PetscLGMap lgmr = NULL
* cdef PetscLGMap lgmc = NULL
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<<
* cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0
* Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N)
*/
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 652, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_7;
/* "petsc4py/PETSc/Mat.pyx":653
* cdef PetscLGMap lgmc = NULL
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 # <<<<<<<<<<<<<<
* Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N)
* Sys_Layout(ccomm, rbs, &m, &M)
*/
__pyx_v_rbs = 0;
__pyx_v_cbs = 0;
__pyx_v_m = 0;
__pyx_v_n = 0;
__pyx_v_M = 0;
__pyx_v_N = 0;
/* "petsc4py/PETSc/Mat.pyx":654
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0
* Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) # <<<<<<<<<<<<<<
* Sys_Layout(ccomm, rbs, &m, &M)
* Sys_Layout(ccomm, cbs, &n, &N)
*/
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Mat_Sizes(__pyx_v_size, Py_None, (&__pyx_v_rbs), (&__pyx_v_cbs), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_M), (&__pyx_v_N)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 654, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":655
* cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0
* Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N)
* Sys_Layout(ccomm, rbs, &m, &M) # <<<<<<<<<<<<<<
* Sys_Layout(ccomm, cbs, &n, &N)
* # create matrix
*/
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_rbs, (&__pyx_v_m), (&__pyx_v_M)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 655, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":656
* Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N)
* Sys_Layout(ccomm, rbs, &m, &M)
* Sys_Layout(ccomm, cbs, &n, &N) # <<<<<<<<<<<<<<
* # create matrix
* cdef PetscMat newmat = NULL
*/
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_cbs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 656, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":658
* 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":659
* # 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":660
* 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) != 0);
if (__pyx_t_1) {
__pyx_v_bs = __pyx_v_rbs;
}
/* "petsc4py/PETSc/Mat.pyx":661
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":662
* if rbs == cbs: bs = rbs
* if lgmapr is not None:
* lgmr = lgmapr.lgm # <<<<<<<<<<<<<<
* if lgmapc is not None:
* lgmc = lgmapc.lgm
*/
__pyx_t_9 = __pyx_v_lgmapr->lgm;
__pyx_v_lgmr = __pyx_t_9;
/* "petsc4py/PETSc/Mat.pyx":661
* 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":663
* 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_2 = (((PyObject *)__pyx_v_lgmapc) != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Mat.pyx":664
* lgmr = lgmapr.lgm
* if lgmapc is not None:
* lgmc = lgmapc.lgm # <<<<<<<<<<<<<<
* CHKERR( MatCreateIS(ccomm, bs, m, n, M, N, lgmr, lgmc, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_t_9 = __pyx_v_lgmapc->lgm;
__pyx_v_lgmc = __pyx_t_9;
/* "petsc4py/PETSc/Mat.pyx":663
* 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":665
* if lgmapc is not None:
* lgmc = lgmapc.lgm
* CHKERR( MatCreateIS(ccomm, bs, m, n, M, N, lgmr, lgmc, &newmat) ) # <<<<<<<<<<<<<<
* PetscCLEAR(self.obj); self.mat = newmat
* return self
*/
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateIS(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_m, __pyx_v_n, __pyx_v_M, __pyx_v_N, __pyx_v_lgmr, __pyx_v_lgmc, (&__pyx_v_newmat))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 665, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":666
* lgmc = lgmapc.lgm
* CHKERR( MatCreateIS(ccomm, bs, m, n, M, N, lgmr, lgmc, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":667
* CHKERR( MatCreateIS(ccomm, bs, m, n, M, N, lgmr, lgmc, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
* return self # <<<<<<<<<<<<<<
*
* def createPython(self, size, context=None, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":646
* return self
*
* def createIS(self, size, LGMap lgmapr=None, LGMap lgmapc=None, comm=None): # <<<<<<<<<<<<<<
* # communicator and sizes
* if comm is None and lgmapr is not None: comm = lgmapr.getComm()
*/
/* 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.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":669
* return self
*
* def createPython(self, size, context=None, comm=None): # <<<<<<<<<<<<<<
* # communicator and sizes
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_91createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_90createPython[] = "Mat.createPython(self, size, context=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_91createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_size = 0;
PyObject *__pyx_v_context = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_context,&__pyx_n_s_comm,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createPython") < 0)) __PYX_ERR(45, 669, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_size = values[0];
__pyx_v_context = values[1];
__pyx_v_comm = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createPython", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 669, __pyx_L3_error)
__pyx_L3_error:;
__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_90createPython(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_context, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_90createPython(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_context, PyObject *__pyx_v_comm) {
MPI_Comm __pyx_v_ccomm;
PetscInt __pyx_v_rbs;
PetscInt __pyx_v_cbs;
PetscInt __pyx_v_m;
PetscInt __pyx_v_n;
PetscInt __pyx_v_M;
PetscInt __pyx_v_N;
Mat __pyx_v_newmat;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
PetscErrorCode __pyx_t_2;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createPython", 0);
/* "petsc4py/PETSc/Mat.pyx":671
* def createPython(self, size, context=None, comm=None):
* # 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(PyErr_Occurred())) __PYX_ERR(45, 671, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":672
* # 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":673
* 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(45, 673, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":674
* 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(45, 674, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":675
* Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N)
* Sys_Layout(ccomm, rbs, &m, &M)
* Sys_Layout(ccomm, cbs, &n, &N) # <<<<<<<<<<<<<<
* # create matrix
* cdef PetscMat newmat = NULL
*/
__pyx_t_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(45, 675, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":677
* Sys_Layout(ccomm, cbs, &n, &N)
* # create matrix
* cdef PetscMat newmat = NULL # <<<<<<<<<<<<<<
* CHKERR( MatCreate(ccomm, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat
*/
__pyx_v_newmat = NULL;
/* "petsc4py/PETSc/Mat.pyx":678
* # create matrix
* cdef PetscMat newmat = NULL
* CHKERR( MatCreate(ccomm, &newmat) ) # <<<<<<<<<<<<<<
* 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(45, 678, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":679
* cdef PetscMat newmat = NULL
* CHKERR( MatCreate(ccomm, &newmat) )
* PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<<
* CHKERR( MatSetSizes(self.mat, m, n, M, N) )
* CHKERR( MatSetType(self.mat, MATPYTHON) )
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->mat = __pyx_v_newmat;
/* "petsc4py/PETSc/Mat.pyx":680
* CHKERR( MatCreate(ccomm, &newmat) )
* 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(45, 680, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":681
* 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) )
* return self
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetType(__pyx_v_self->mat, MATPYTHON)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 681, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":682
* CHKERR( MatSetSizes(self.mat, m, n, M, N) )
* CHKERR( MatSetType(self.mat, MATPYTHON) )
* CHKERR( MatPythonSetContext(self.mat, <void*>context) ) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_2 = MatPythonSetContext(__pyx_v_self->mat, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 682, __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(45, 682, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":683
* CHKERR( MatSetType(self.mat, MATPYTHON) )
* CHKERR( MatPythonSetContext(self.mat, <void*>context) )
* return self # <<<<<<<<<<<<<<
*
* def setPythonContext(self, context):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":669
* return self
*
* def createPython(self, size, context=None, comm=None): # <<<<<<<<<<<<<<
* # communicator and sizes
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
/* 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":685
* return self
*
* def setPythonContext(self, context): # <<<<<<<<<<<<<<
* CHKERR( MatPythonSetContext(self.mat, <void*>context) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_93setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_92setPythonContext[] = "Mat.setPythonContext(self, context)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_93setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_context = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonContext") < 0)) __PYX_ERR(45, 685, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_context = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 685, __pyx_L3_error)
__pyx_L3_error:;
__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_92setPythonContext(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_context);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_92setPythonContext(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":686
*
* def setPythonContext(self, context):
* CHKERR( MatPythonSetContext(self.mat, <void*>context) ) # <<<<<<<<<<<<<<
*
* def getPythonContext(self):
*/
__pyx_t_1 = MatPythonSetContext(__pyx_v_self->mat, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 686, __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(45, 686, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":685
* return self
*
* def setPythonContext(self, context): # <<<<<<<<<<<<<<
* CHKERR( MatPythonSetContext(self.mat, <void*>context) )
*
*/
/* 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":688
* CHKERR( MatPythonSetContext(self.mat, <void*>context) )
*
* def getPythonContext(self): # <<<<<<<<<<<<<<
* cdef void *context = NULL
* CHKERR( MatPythonGetContext(self.mat, &context) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_95getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_94getPythonContext[] = "Mat.getPythonContext(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_95getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getPythonContext (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getPythonContext", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonContext", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_94getPythonContext(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_94getPythonContext(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":689
*
* def getPythonContext(self):
* cdef void *context = NULL # <<<<<<<<<<<<<<
* CHKERR( MatPythonGetContext(self.mat, &context) )
* if context == NULL: return None
*/
__pyx_v_context = NULL;
/* "petsc4py/PETSc/Mat.pyx":690
* def getPythonContext(self):
* 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(45, 690, __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(45, 690, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":691
* 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) != 0);
if (__pyx_t_3) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/Mat.pyx":692
* CHKERR( MatPythonGetContext(self.mat, &context) )
* if context == NULL: return None
* else: return <object> context # <<<<<<<<<<<<<<
*
* def setPythonType(self, py_type):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_context));
__pyx_r = ((PyObject *)__pyx_v_context);
goto __pyx_L0;
}
/* "petsc4py/PETSc/Mat.pyx":688
* CHKERR( MatPythonSetContext(self.mat, <void*>context) )
*
* def getPythonContext(self): # <<<<<<<<<<<<<<
* cdef void *context = NULL
* CHKERR( MatPythonGetContext(self.mat, &context) )
*/
/* 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":694
* else: return <object> context
*
* def setPythonType(self, py_type): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* py_type = str2bytes(py_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_97setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_96setPythonType[] = "Mat.setPythonType(self, py_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_97setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_py_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_py_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonType") < 0)) __PYX_ERR(45, 694, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_py_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 694, __pyx_L3_error)
__pyx_L3_error:;
__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_96setPythonType(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_py_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_96setPythonType(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":695
*
* def setPythonType(self, py_type):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* py_type = str2bytes(py_type, &cval)
* CHKERR( MatPythonSetType(self.mat, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Mat.pyx":696
* def setPythonType(self, py_type):
* 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(45, 696, __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":697
* cdef const char *cval = NULL
* py_type = str2bytes(py_type, &cval)
* CHKERR( MatPythonSetType(self.mat, cval) ) # <<<<<<<<<<<<<<
*
* def getPythonType(self):
*/
__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(45, 697, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":694
* else: return <object> context
*
* def setPythonType(self, py_type): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* py_type = str2bytes(py_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":699
* CHKERR( MatPythonSetType(self.mat, cval) )
*
* def getPythonType(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( MatPythonGetType(self.mat, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_99getPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_98getPythonType[] = "Mat.getPythonType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_99getPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getPythonType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getPythonType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_98getPythonType(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_98getPythonType(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":700
*
* def getPythonType(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( MatPythonGetType(self.mat, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Mat.pyx":701
* def getPythonType(self):
* 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(45, 701, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":702
* 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(45, 702, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":699
* CHKERR( MatPythonSetType(self.mat, cval) )
*
* def getPythonType(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( MatPythonGetType(self.mat, &cval) )
*/
/* 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":706
* #
*
* def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_101setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_100setOptionsPrefix[] = "Mat.setOptionsPrefix(self, prefix)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_101setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(45, 706, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_prefix = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 706, __pyx_L3_error)
__pyx_L3_error:;
__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_100setOptionsPrefix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_prefix);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_100setOptionsPrefix(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":707
*
* def setOptionsPrefix(self, prefix):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* prefix = str2bytes(prefix, &cval)
* CHKERR( MatSetOptionsPrefix(self.mat, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Mat.pyx":708
* def setOptionsPrefix(self, prefix):
* 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(45, 708, __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":709
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
* CHKERR( MatSetOptionsPrefix(self.mat, cval) ) # <<<<<<<<<<<<<<
*
* def getOptionsPrefix(self):
*/
__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(45, 709, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":706
* #
*
* def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":711
* CHKERR( MatSetOptionsPrefix(self.mat, cval) )
*
* def getOptionsPrefix(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( MatGetOptionsPrefix(self.mat, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_103getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_102getOptionsPrefix[] = "Mat.getOptionsPrefix(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_103getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_102getOptionsPrefix(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_102getOptionsPrefix(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":712
*
* def getOptionsPrefix(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( MatGetOptionsPrefix(self.mat, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Mat.pyx":713
* def getOptionsPrefix(self):
* 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(45, 713, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":714
* cdef const char *cval = NULL
* CHKERR( MatGetOptionsPrefix(self.mat, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def appendOptionsPrefix(self, prefix):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 714, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":711
* CHKERR( MatSetOptionsPrefix(self.mat, cval) )
*
* def getOptionsPrefix(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( MatGetOptionsPrefix(self.mat, &cval) )
*/
/* 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":716
* return bytes2str(cval)
*
* def appendOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_105appendOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_104appendOptionsPrefix[] = "Mat.appendOptionsPrefix(self, prefix)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_105appendOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "appendOptionsPrefix") < 0)) __PYX_ERR(45, 716, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_prefix = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 716, __pyx_L3_error)
__pyx_L3_error:;
__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_104appendOptionsPrefix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_prefix);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_104appendOptionsPrefix(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":717
*
* def appendOptionsPrefix(self, prefix):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* prefix = str2bytes(prefix, &cval)
* CHKERR( MatAppendOptionsPrefix(self.mat, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Mat.pyx":718
* def appendOptionsPrefix(self, prefix):
* 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(45, 718, __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":719
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
* CHKERR( MatAppendOptionsPrefix(self.mat, cval) ) # <<<<<<<<<<<<<<
*
* def setFromOptions(self):
*/
__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(45, 719, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":716
* return bytes2str(cval)
*
* def appendOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":721
* CHKERR( MatAppendOptionsPrefix(self.mat, cval) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( MatSetFromOptions(self.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_107setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_106setFromOptions[] = "Mat.setFromOptions(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_107setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_106setFromOptions(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_106setFromOptions(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":722
*
* def setFromOptions(self):
* CHKERR( MatSetFromOptions(self.mat) ) # <<<<<<<<<<<<<<
*
* def setUp(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(45, 722, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":721
* CHKERR( MatAppendOptionsPrefix(self.mat, cval) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( MatSetFromOptions(self.mat) )
*
*/
/* 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":724
* CHKERR( MatSetFromOptions(self.mat) )
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( MatSetUp(self.mat) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_109setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_108setUp[] = "Mat.setUp(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_109setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setUp (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_108setUp(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_108setUp(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":725
*
* def setUp(self):
* 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(45, 725, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":726
* def setUp(self):
* CHKERR( MatSetUp(self.mat) )
* return self # <<<<<<<<<<<<<<
*
* def setOption(self, option, flag):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":724
* CHKERR( MatSetFromOptions(self.mat) )
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( MatSetUp(self.mat) )
* return self
*/
/* 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":728
* return self
*
* def setOption(self, option, flag): # <<<<<<<<<<<<<<
* CHKERR( MatSetOption(self.mat, option, flag) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_111setOption(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_110setOption[] = "Mat.setOption(self, option, flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_111setOption(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_option = 0;
PyObject *__pyx_v_flag = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_option,&__pyx_n_s_flag,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_option)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setOption", 1, 2, 2, 1); __PYX_ERR(45, 728, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOption") < 0)) __PYX_ERR(45, 728, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_option = values[0];
__pyx_v_flag = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setOption", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 728, __pyx_L3_error)
__pyx_L3_error:;
__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_110setOption(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_option, __pyx_v_flag);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_110setOption(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":729
*
* def setOption(self, option, flag):
* CHKERR( MatSetOption(self.mat, option, flag) ) # <<<<<<<<<<<<<<
*
* def getOption(self, option):
*/
__pyx_t_1 = ((MatOption)__Pyx_PyInt_As_MatOption(__pyx_v_option)); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 729, __pyx_L1_error)
__pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 729, __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(45, 729, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":728
* return self
*
* def setOption(self, option, flag): # <<<<<<<<<<<<<<
* CHKERR( MatSetOption(self.mat, option, flag) )
*
*/
/* 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":731
* CHKERR( MatSetOption(self.mat, option, flag) )
*
* def getOption(self, option): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatGetOption(self.mat, option, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_113getOption(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_112getOption[] = "Mat.getOption(self, option)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_113getOption(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_option = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_option,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_option)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getOption") < 0)) __PYX_ERR(45, 731, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_option = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getOption", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 731, __pyx_L3_error)
__pyx_L3_error:;
__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_112getOption(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_option);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_112getOption(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":732
*
* def getOption(self, option):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( MatGetOption(self.mat, option, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/Mat.pyx":733
* def getOption(self, option):
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatGetOption(self.mat, option, &flag) ) # <<<<<<<<<<<<<<
* return toBool(flag)
*
*/
__pyx_t_1 = ((MatOption)__Pyx_PyInt_As_MatOption(__pyx_v_option)); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 733, __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(45, 733, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":734
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatGetOption(self.mat, option, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def getType(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 734, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":731
* CHKERR( MatSetOption(self.mat, option, flag) )
*
* def getOption(self, option): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatGetOption(self.mat, option, &flag) )
*/
/* 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":736
* return toBool(flag)
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscMatType cval = NULL
* CHKERR( MatGetType(self.mat, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_115getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_114getType[] = "Mat.getType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_115getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_114getType(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_114getType(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":737
*
* def getType(self):
* cdef PetscMatType cval = NULL # <<<<<<<<<<<<<<
* CHKERR( MatGetType(self.mat, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Mat.pyx":738
* def getType(self):
* 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(45, 738, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":739
* cdef PetscMatType cval = NULL
* CHKERR( MatGetType(self.mat, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def getSize(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 739, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":736
* return toBool(flag)
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscMatType cval = NULL
* CHKERR( MatGetType(self.mat, &cval) )
*/
/* 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":741
* return bytes2str(cval)
*
* def getSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt M = 0, N = 0
* CHKERR( MatGetSize(self.mat, &M, &N) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_117getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_116getSize[] = "Mat.getSize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_117getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getSize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_116getSize(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_116getSize(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":742
*
* def getSize(self):
* 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":743
* def getSize(self):
* 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(45, 743, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":744
* cdef PetscInt M = 0, N = 0
* CHKERR( MatGetSize(self.mat, &M, &N) )
* return (toInt(M), toInt(N)) # <<<<<<<<<<<<<<
*
* def getLocalSize(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 744, __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(45, 744, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 744, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":741
* return bytes2str(cval)
*
* def getSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt M = 0, N = 0
* CHKERR( MatGetSize(self.mat, &M, &N) )
*/
/* 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":746
* return (toInt(M), toInt(N))
*
* def getLocalSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt m = 0, n = 0
* CHKERR( MatGetLocalSize(self.mat, &m, &n) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_119getLocalSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_118getLocalSize[] = "Mat.getLocalSize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_119getLocalSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getLocalSize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getLocalSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalSize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_118getLocalSize(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_118getLocalSize(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":747
*
* def getLocalSize(self):
* 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":748
* def getLocalSize(self):
* 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(45, 748, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":749
* cdef PetscInt m = 0, n = 0
* CHKERR( MatGetLocalSize(self.mat, &m, &n) )
* return (toInt(m), toInt(n)) # <<<<<<<<<<<<<<
*
* def getSizes(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 749, __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(45, 749, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 749, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":746
* return (toInt(M), toInt(N))
*
* def getLocalSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt m = 0, n = 0
* CHKERR( MatGetLocalSize(self.mat, &m, &n) )
*/
/* 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":751
* return (toInt(m), toInt(n))
*
* def getSizes(self): # <<<<<<<<<<<<<<
* cdef PetscInt m = 0, n = 0
* cdef PetscInt M = 0, N = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_121getSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_120getSizes[] = "Mat.getSizes(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_121getSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getSizes (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSizes", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_120getSizes(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_120getSizes(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":752
*
* def getSizes(self):
* 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":753
* def getSizes(self):
* 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":754
* 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(45, 754, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":755
* 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(45, 755, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":756
* CHKERR( MatGetLocalSize(self.mat, &m, &n) )
* CHKERR( MatGetSize(self.mat, &M, &N) )
* return ((toInt(m), toInt(M)), (toInt(n), toInt(N))) # <<<<<<<<<<<<<<
*
* def getBlockSize(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 756, __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(45, 756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__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(45, 756, __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(45, 756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__pyx_t_3 = 0;
__pyx_t_2 = 0;
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
__pyx_t_4 = 0;
__pyx_t_5 = 0;
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":751
* return (toInt(m), toInt(n))
*
* def getSizes(self): # <<<<<<<<<<<<<<
* cdef PetscInt m = 0, n = 0
* cdef PetscInt M = 0, N = 0
*/
/* 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":758
* return ((toInt(m), toInt(M)), (toInt(n), toInt(N)))
*
* def getBlockSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt bs = 0
* CHKERR( MatGetBlockSize(self.mat, &bs) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_123getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_122getBlockSize[] = "Mat.getBlockSize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_123getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getBlockSize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_122getBlockSize(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_122getBlockSize(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":759
*
* def getBlockSize(self):
* cdef PetscInt bs = 0 # <<<<<<<<<<<<<<
* CHKERR( MatGetBlockSize(self.mat, &bs) )
* return toInt(bs)
*/
__pyx_v_bs = 0;
/* "petsc4py/PETSc/Mat.pyx":760
* def getBlockSize(self):
* 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(45, 760, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":761
* cdef PetscInt bs = 0
* CHKERR( MatGetBlockSize(self.mat, &bs) )
* return toInt(bs) # <<<<<<<<<<<<<<
*
* def getBlockSizes(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 761, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":758
* return ((toInt(m), toInt(M)), (toInt(n), toInt(N)))
*
* def getBlockSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt bs = 0
* CHKERR( MatGetBlockSize(self.mat, &bs) )
*/
/* 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":763
* return toInt(bs)
*
* def getBlockSizes(self): # <<<<<<<<<<<<<<
* cdef PetscInt rbs = 0, cbs = 0
* CHKERR( MatGetBlockSizes(self.mat, &rbs, &cbs) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_125getBlockSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_124getBlockSizes[] = "Mat.getBlockSizes(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_125getBlockSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getBlockSizes (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getBlockSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSizes", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_124getBlockSizes(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_124getBlockSizes(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":764
*
* def getBlockSizes(self):
* 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":765
* def getBlockSizes(self):
* 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(45, 765, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":766
* cdef PetscInt rbs = 0, cbs = 0
* CHKERR( MatGetBlockSizes(self.mat, &rbs, &cbs) )
* return (toInt(rbs), toInt(cbs)) # <<<<<<<<<<<<<<
*
* def getOwnershipRange(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_rbs); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 766, __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(45, 766, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 766, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":763
* return toInt(bs)
*
* def getBlockSizes(self): # <<<<<<<<<<<<<<
* cdef PetscInt rbs = 0, cbs = 0
* CHKERR( MatGetBlockSizes(self.mat, &rbs, &cbs) )
*/
/* 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":768
* return (toInt(rbs), toInt(cbs))
*
* def getOwnershipRange(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = 0, ival2 = 0
* CHKERR( MatGetOwnershipRange(self.mat, &ival1, &ival2) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_127getOwnershipRange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_126getOwnershipRange[] = "Mat.getOwnershipRange(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_127getOwnershipRange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOwnershipRange (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOwnershipRange", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRange", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_126getOwnershipRange(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_126getOwnershipRange(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":769
*
* def getOwnershipRange(self):
* 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":770
* def getOwnershipRange(self):
* 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(45, 770, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":771
* cdef PetscInt ival1 = 0, ival2 = 0
* CHKERR( MatGetOwnershipRange(self.mat, &ival1, &ival2) )
* return (toInt(ival1), toInt(ival2)) # <<<<<<<<<<<<<<
*
* def getOwnershipRanges(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival1); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 771, __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(45, 771, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 771, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":768
* return (toInt(rbs), toInt(cbs))
*
* def getOwnershipRange(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = 0, ival2 = 0
* CHKERR( MatGetOwnershipRange(self.mat, &ival1, &ival2) )
*/
/* 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":773
* return (toInt(ival1), toInt(ival2))
*
* def getOwnershipRanges(self): # <<<<<<<<<<<<<<
* cdef const PetscInt *rowrng = NULL
* CHKERR( MatGetOwnershipRanges(self.mat, &rowrng) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_129getOwnershipRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_128getOwnershipRanges[] = "Mat.getOwnershipRanges(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_129getOwnershipRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOwnershipRanges (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOwnershipRanges", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRanges", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_128getOwnershipRanges(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_128getOwnershipRanges(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":774
*
* def getOwnershipRanges(self):
* 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":775
* def getOwnershipRanges(self):
* 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(45, 775, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":776
* 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":777
* 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(45, 777, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":778
* 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":779
* 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(45, 779, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":780
* cdef int size = -1
* CHKERR( <PetscErrorCode>MPI_Comm_size(comm, &size) )
* return array_i(size+1, rowrng) # <<<<<<<<<<<<<<
*
* def getOwnershipRangeColumn(self):
*/
__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(45, 780, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":773
* return (toInt(ival1), toInt(ival2))
*
* def getOwnershipRanges(self): # <<<<<<<<<<<<<<
* cdef const PetscInt *rowrng = NULL
* CHKERR( MatGetOwnershipRanges(self.mat, &rowrng) )
*/
/* 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":782
* return array_i(size+1, rowrng)
*
* def getOwnershipRangeColumn(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = 0, ival2 = 0
* CHKERR( MatGetOwnershipRangeColumn(self.mat, &ival1, &ival2) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_131getOwnershipRangeColumn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_130getOwnershipRangeColumn[] = "Mat.getOwnershipRangeColumn(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_131getOwnershipRangeColumn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOwnershipRangeColumn (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOwnershipRangeColumn", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRangeColumn", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_130getOwnershipRangeColumn(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_130getOwnershipRangeColumn(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":783
*
* def getOwnershipRangeColumn(self):
* 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":784
* def getOwnershipRangeColumn(self):
* 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(45, 784, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":785
* cdef PetscInt ival1 = 0, ival2 = 0
* CHKERR( MatGetOwnershipRangeColumn(self.mat, &ival1, &ival2) )
* return (toInt(ival1), toInt(ival2)) # <<<<<<<<<<<<<<
*
* def getOwnershipRangesColumn(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival1); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 785, __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(45, 785, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 785, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":782
* return array_i(size+1, rowrng)
*
* def getOwnershipRangeColumn(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = 0, ival2 = 0
* CHKERR( MatGetOwnershipRangeColumn(self.mat, &ival1, &ival2) )
*/
/* 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":787
* return (toInt(ival1), toInt(ival2))
*
* def getOwnershipRangesColumn(self): # <<<<<<<<<<<<<<
* cdef const PetscInt *colrng = NULL
* CHKERR( MatGetOwnershipRangesColumn(self.mat, &colrng) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_133getOwnershipRangesColumn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_132getOwnershipRangesColumn[] = "Mat.getOwnershipRangesColumn(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_133getOwnershipRangesColumn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOwnershipRangesColumn (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOwnershipRangesColumn", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRangesColumn", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_132getOwnershipRangesColumn(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_132getOwnershipRangesColumn(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":788
*
* def getOwnershipRangesColumn(self):
* 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":789
* def getOwnershipRangesColumn(self):
* 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(45, 789, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":790
* 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":791
* 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(45, 791, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":792
* 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":793
* 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(45, 793, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":794
* cdef int size = -1
* CHKERR( <PetscErrorCode>MPI_Comm_size(comm, &size) )
* return array_i(size+1, colrng) # <<<<<<<<<<<<<<
*
* def getOwnershipIS(self):
*/
__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(45, 794, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":787
* return (toInt(ival1), toInt(ival2))
*
* def getOwnershipRangesColumn(self): # <<<<<<<<<<<<<<
* cdef const PetscInt *colrng = NULL
* CHKERR( MatGetOwnershipRangesColumn(self.mat, &colrng) )
*/
/* 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":796
* return array_i(size+1, colrng)
*
* def getOwnershipIS(self): # <<<<<<<<<<<<<<
* cdef IS rows = IS()
* cdef IS cols = IS()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_135getOwnershipIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_134getOwnershipIS[] = "Mat.getOwnershipIS(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_135getOwnershipIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOwnershipIS (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOwnershipIS", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipIS", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_134getOwnershipIS(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_134getOwnershipIS(struct PyPetscMatObject *__pyx_v_self) {
struct PyPetscISObject *__pyx_v_rows = 0;
struct PyPetscISObject *__pyx_v_cols = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getOwnershipIS", 0);
/* "petsc4py/PETSc/Mat.pyx":797
*
* def getOwnershipIS(self):
* cdef IS rows = IS() # <<<<<<<<<<<<<<
* cdef IS cols = IS()
* CHKERR( MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset) )
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 797, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_rows = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":798
* def getOwnershipIS(self):
* cdef IS rows = IS()
* cdef IS cols = IS() # <<<<<<<<<<<<<<
* CHKERR( MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset) )
* return (rows, cols)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 798, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_cols = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":799
* cdef IS rows = IS()
* cdef IS cols = IS()
* CHKERR( MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset) ) # <<<<<<<<<<<<<<
* return (rows, cols)
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipIS(__pyx_v_self->mat, (&__pyx_v_rows->iset), (&__pyx_v_cols->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 799, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":800
* cdef IS cols = IS()
* CHKERR( MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset) )
* return (rows, cols) # <<<<<<<<<<<<<<
*
* def getInfo(self, info=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 800, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_rows));
__Pyx_GIVEREF(((PyObject *)__pyx_v_rows));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_rows));
__Pyx_INCREF(((PyObject *)__pyx_v_cols));
__Pyx_GIVEREF(((PyObject *)__pyx_v_cols));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_cols));
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":796
* return array_i(size+1, colrng)
*
* def getOwnershipIS(self): # <<<<<<<<<<<<<<
* cdef IS rows = IS()
* cdef IS cols = IS()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getOwnershipIS", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_rows);
__Pyx_XDECREF((PyObject *)__pyx_v_cols);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":802
* return (rows, cols)
*
* def getInfo(self, info=None): # <<<<<<<<<<<<<<
* cdef PetscMatInfoType itype = infotype(info)
* cdef PetscMatInfo cinfo
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_137getInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_136getInfo[] = "Mat.getInfo(self, info=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_137getInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_info = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_info,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getInfo") < 0)) __PYX_ERR(45, 802, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_info = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getInfo", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 802, __pyx_L3_error)
__pyx_L3_error:;
__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_136getInfo(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_info);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_136getInfo(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":803
*
* def getInfo(self, info=None):
* 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(45, 803, __pyx_L1_error)
__pyx_v_itype = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":805
* 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(45, 805, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":806
* cdef PetscMatInfo cinfo
* CHKERR( MatGetInfo(self.mat, itype, &cinfo) )
* return cinfo # <<<<<<<<<<<<<<
*
* def duplicate(self, copy=False):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_convert__to_py_MatInfo(__pyx_v_cinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 806, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":802
* return (rows, cols)
*
* def getInfo(self, info=None): # <<<<<<<<<<<<<<
* cdef PetscMatInfoType itype = infotype(info)
* cdef PetscMatInfo cinfo
*/
/* 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":808
* return cinfo
*
* def duplicate(self, copy=False): # <<<<<<<<<<<<<<
* cdef PetscMatDuplicateOption flag = MAT_DO_NOT_COPY_VALUES
* if copy: flag = MAT_COPY_VALUES
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_139duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_138duplicate[] = "Mat.duplicate(self, copy=False)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_139duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_copy = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_copy,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_False);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_copy);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "duplicate") < 0)) __PYX_ERR(45, 808, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_copy = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("duplicate", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 808, __pyx_L3_error)
__pyx_L3_error:;
__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_138duplicate(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_copy);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_138duplicate(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_copy) {
MatDuplicateOption __pyx_v_flag;
struct PyPetscMatObject *__pyx_v_mat = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PetscErrorCode __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("duplicate", 0);
/* "petsc4py/PETSc/Mat.pyx":809
*
* def duplicate(self, copy=False):
* cdef PetscMatDuplicateOption flag = MAT_DO_NOT_COPY_VALUES # <<<<<<<<<<<<<<
* if copy: flag = MAT_COPY_VALUES
* if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN
*/
__pyx_v_flag = MAT_DO_NOT_COPY_VALUES;
/* "petsc4py/PETSc/Mat.pyx":810
* def duplicate(self, copy=False):
* cdef PetscMatDuplicateOption flag = MAT_DO_NOT_COPY_VALUES
* if copy: flag = MAT_COPY_VALUES # <<<<<<<<<<<<<<
* if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN
* cdef Mat mat = type(self)()
*/
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_copy); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 810, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_v_flag = MAT_COPY_VALUES;
}
/* "petsc4py/PETSc/Mat.pyx":811
* cdef PetscMatDuplicateOption flag = MAT_DO_NOT_COPY_VALUES
* if copy: flag = MAT_COPY_VALUES
* if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN # <<<<<<<<<<<<<<
* cdef Mat mat = type(self)()
* CHKERR( MatDuplicate(self.mat, flag, &mat.mat) )
*/
__pyx_t_2 = __Pyx_PyInt_From_MatDuplicateOption(MAT_COPY_VALUES); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 811, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyObject_RichCompare(__pyx_v_copy, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 811, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 811, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_1) {
__pyx_v_flag = MAT_SHARE_NONZERO_PATTERN;
}
/* "petsc4py/PETSc/Mat.pyx":812
* if copy: flag = MAT_COPY_VALUES
* if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN
* cdef Mat mat = type(self)() # <<<<<<<<<<<<<<
* CHKERR( MatDuplicate(self.mat, flag, &mat.mat) )
* return mat
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_4 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 812, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(45, 812, __pyx_L1_error)
__pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":813
* if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN
* cdef Mat mat = type(self)()
* CHKERR( MatDuplicate(self.mat, flag, &mat.mat) ) # <<<<<<<<<<<<<<
* return mat
*
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, __pyx_v_flag, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 813, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":814
* cdef Mat mat = type(self)()
* CHKERR( MatDuplicate(self.mat, flag, &mat.mat) )
* return mat # <<<<<<<<<<<<<<
*
* def copy(self, Mat result=None, structure=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_mat));
__pyx_r = ((PyObject *)__pyx_v_mat);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":808
* return cinfo
*
* def duplicate(self, copy=False): # <<<<<<<<<<<<<<
* cdef PetscMatDuplicateOption flag = MAT_DO_NOT_COPY_VALUES
* if copy: flag = MAT_COPY_VALUES
*/
/* 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":816
* return mat
*
* def copy(self, Mat result=None, structure=None): # <<<<<<<<<<<<<<
* cdef PetscMatDuplicateOption copy = MAT_COPY_VALUES
* cdef PetscMatStructure mstr = matstructure(structure)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_141copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_140copy[] = "Mat.copy(self, Mat result=None, structure=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_141copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_result = 0;
PyObject *__pyx_v_structure = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,&__pyx_n_s_structure,0};
PyObject* values[2] = {0,0};
values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None);
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_structure);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy") < 0)) __PYX_ERR(45, 816, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_result = ((struct PyPetscMatObject *)values[0]);
__pyx_v_structure = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("copy", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 816, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(45, 816, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_140copy(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_result, __pyx_v_structure);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_140copy(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;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
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("copy", 0);
__Pyx_INCREF((PyObject *)__pyx_v_result);
/* "petsc4py/PETSc/Mat.pyx":817
*
* def copy(self, Mat result=None, structure=None):
* 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":818
* def copy(self, Mat result=None, structure=None):
* 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(45, 818, __pyx_L1_error)
__pyx_v_mstr = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":819
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":820
* cdef PetscMatStructure mstr = matstructure(structure)
* if result is None:
* result = type(self)() # <<<<<<<<<<<<<<
* if result.mat == NULL:
* CHKERR( MatDuplicate(self.mat, copy, &result.mat) )
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__pyx_t_5 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 820, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(45, 820, __pyx_L1_error)
__Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_4));
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Mat.pyx":819
* 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":821
* if result is None:
* result = type(self)()
* if result.mat == NULL: # <<<<<<<<<<<<<<
* CHKERR( MatDuplicate(self.mat, copy, &result.mat) )
* else:
*/
__pyx_t_3 = ((__pyx_v_result->mat == NULL) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":822
* 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(45, 822, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":821
* 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":824
* 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(45, 824, __pyx_L1_error)
}
__pyx_L4:;
/* "petsc4py/PETSc/Mat.pyx":825
* else:
* CHKERR( MatCopy(self.mat, result.mat, mstr) )
* return result # <<<<<<<<<<<<<<
*
* def load(self, Viewer viewer):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":816
* return mat
*
* def copy(self, Mat result=None, structure=None): # <<<<<<<<<<<<<<
* cdef PetscMatDuplicateOption copy = MAT_COPY_VALUES
* cdef PetscMatStructure mstr = matstructure(structure)
*/
/* 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.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":827
* return result
*
* def load(self, Viewer viewer): # <<<<<<<<<<<<<<
* cdef MPI_Comm comm = MPI_COMM_NULL
* cdef PetscObject obj = <PetscObject>(viewer.vwr)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_143load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_142load[] = "Mat.load(self, Viewer viewer)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_143load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load") < 0)) __PYX_ERR(45, 827, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 827, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(45, 827, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_142load(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_142load(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":828
*
* def load(self, Viewer viewer):
* 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":829
* def load(self, Viewer viewer):
* 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":830
* 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) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Mat.pyx":831
* 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(45, 831, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":832
* 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(45, 832, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":830
* 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":833
* 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(45, 833, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":834
* CHKERR( MatCreate(comm, &self.mat) )
* CHKERR( MatLoad(self.mat, viewer.vwr) )
* return self # <<<<<<<<<<<<<<
*
* def convert(self, mat_type=None, Mat out=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":827
* return result
*
* def load(self, Viewer viewer): # <<<<<<<<<<<<<<
* cdef MPI_Comm comm = MPI_COMM_NULL
* cdef PetscObject obj = <PetscObject>(viewer.vwr)
*/
/* 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":836
* return self
*
* def convert(self, mat_type=None, Mat out=None): # <<<<<<<<<<<<<<
* cdef PetscMatType mtype = MATSAME
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_145convert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_144convert[] = "Mat.convert(self, mat_type=None, Mat out=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_145convert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_mat_type = 0;
struct PyPetscMatObject *__pyx_v_out = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat_type,&__pyx_n_s_out,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_None);
values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat_type);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(45, 836, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mat_type = values[0];
__pyx_v_out = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("convert", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 836, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.convert", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(45, 836, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_144convert(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat_type, __pyx_v_out);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_144convert(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;
int __pyx_t_3;
PetscErrorCode __pyx_t_4;
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":837
*
* def convert(self, mat_type=None, Mat out=None):
* cdef PetscMatType mtype = MATSAME # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* mat_type = str2bytes(mat_type, &mtype)
*/
__pyx_v_mtype = MATSAME;
/* "petsc4py/PETSc/Mat.pyx":838
* def convert(self, mat_type=None, Mat out=None):
* 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":839
* 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(45, 839, __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":840
* 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) != 0);
if (__pyx_t_2) {
__pyx_v_mtype = MATSAME;
}
/* "petsc4py/PETSc/Mat.pyx":841
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_DECREF_SET(__pyx_v_out, __pyx_v_self);
}
/* "petsc4py/PETSc/Mat.pyx":842
* 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_3 = ((__pyx_v_out->mat == __pyx_v_self->mat) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":843
* 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":842
* 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":844
* if out.mat == self.mat:
* reuse = MAT_INPLACE_MATRIX
* elif out.mat == NULL: # <<<<<<<<<<<<<<
* reuse = MAT_INITIAL_MATRIX
* else:
*/
__pyx_t_3 = ((__pyx_v_out->mat == NULL) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":845
* 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":844
* 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":847
* 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":848
* else:
* reuse = MAT_REUSE_MATRIX
* CHKERR( MatConvert(self.mat, mtype, reuse, &out.mat) ) # <<<<<<<<<<<<<<
* return out
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatConvert(__pyx_v_self->mat, __pyx_v_mtype, __pyx_v_reuse, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 848, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":849
* reuse = MAT_REUSE_MATRIX
* CHKERR( MatConvert(self.mat, mtype, reuse, &out.mat) )
* return out # <<<<<<<<<<<<<<
*
* def transpose(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":836
* return self
*
* def convert(self, mat_type=None, Mat out=None): # <<<<<<<<<<<<<<
* cdef PetscMatType mtype = MATSAME
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
*/
/* 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":851
* return out
*
* def transpose(self, Mat out=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* if out is None: out = self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_147transpose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_146transpose[] = "Mat.transpose(self, Mat out=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_147transpose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_out = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "transpose") < 0)) __PYX_ERR(45, 851, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_out = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("transpose", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 851, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.transpose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(45, 851, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_146transpose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_146transpose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out) {
MatReuse __pyx_v_reuse;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
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;
__Pyx_RefNannySetupContext("transpose", 0);
__Pyx_INCREF((PyObject *)__pyx_v_out);
/* "petsc4py/PETSc/Mat.pyx":852
*
* def transpose(self, Mat out=None):
* 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":853
* def transpose(self, Mat out=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_DECREF_SET(__pyx_v_out, __pyx_v_self);
}
/* "petsc4py/PETSc/Mat.pyx":854
* 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_2 = ((__pyx_v_out->mat == __pyx_v_self->mat) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":855
* 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":854
* 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":856
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":857
* 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":856
* 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":859
* 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":860
* else:
* reuse = MAT_REUSE_MATRIX
* CHKERR( MatTranspose(self.mat, reuse, &out.mat) ) # <<<<<<<<<<<<<<
* return out
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatTranspose(__pyx_v_self->mat, __pyx_v_reuse, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 860, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":861
* reuse = MAT_REUSE_MATRIX
* CHKERR( MatTranspose(self.mat, reuse, &out.mat) )
* return out # <<<<<<<<<<<<<<
*
* def setTransposePrecursor(self, Mat out):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_out));
__pyx_r = ((PyObject *)__pyx_v_out);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":851
* return out
*
* def transpose(self, Mat out=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* if out is None: out = self
*/
/* 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":863
* return out
*
* def setTransposePrecursor(self, Mat out): # <<<<<<<<<<<<<<
* CHKERR( MatTransposeSetPrecursor(self.mat, out.mat) )
* return out
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_149setTransposePrecursor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_148setTransposePrecursor[] = "Mat.setTransposePrecursor(self, Mat out)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_149setTransposePrecursor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_out = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTransposePrecursor") < 0)) __PYX_ERR(45, 863, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_out = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setTransposePrecursor", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 863, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.setTransposePrecursor", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "out", 0))) __PYX_ERR(45, 863, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_148setTransposePrecursor(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_148setTransposePrecursor(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":864
*
* def setTransposePrecursor(self, Mat out):
* CHKERR( MatTransposeSetPrecursor(self.mat, out.mat) ) # <<<<<<<<<<<<<<
* return out
*
*/
__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(45, 864, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":865
* def setTransposePrecursor(self, Mat out):
* CHKERR( MatTransposeSetPrecursor(self.mat, out.mat) )
* return out # <<<<<<<<<<<<<<
*
* def hermitianTranspose(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":863
* return out
*
* def setTransposePrecursor(self, Mat out): # <<<<<<<<<<<<<<
* CHKERR( MatTransposeSetPrecursor(self.mat, out.mat) )
* return out
*/
/* function exit code */
__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":867
* return out
*
* def hermitianTranspose(self, Mat out=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* if out is None: out = self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_151hermitianTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_150hermitianTranspose[] = "Mat.hermitianTranspose(self, Mat out=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_151hermitianTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_out = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hermitianTranspose") < 0)) __PYX_ERR(45, 867, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_out = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("hermitianTranspose", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 867, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.hermitianTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(45, 867, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_150hermitianTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_150hermitianTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out) {
MatReuse __pyx_v_reuse;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
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;
__Pyx_RefNannySetupContext("hermitianTranspose", 0);
__Pyx_INCREF((PyObject *)__pyx_v_out);
/* "petsc4py/PETSc/Mat.pyx":868
*
* def hermitianTranspose(self, Mat out=None):
* 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":869
* def hermitianTranspose(self, Mat out=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_DECREF_SET(__pyx_v_out, __pyx_v_self);
}
/* "petsc4py/PETSc/Mat.pyx":870
* 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_2 = ((__pyx_v_out->mat == __pyx_v_self->mat) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":871
* 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":870
* 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":872
* 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) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":873
* 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":872
* 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":875
* 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":876
* else:
* reuse = MAT_REUSE_MATRIX
* CHKERR( MatHermitianTranspose(self.mat, reuse, &out.mat) ) # <<<<<<<<<<<<<<
* return out
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatHermitianTranspose(__pyx_v_self->mat, __pyx_v_reuse, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 876, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":877
* reuse = MAT_REUSE_MATRIX
* CHKERR( MatHermitianTranspose(self.mat, reuse, &out.mat) )
* return out # <<<<<<<<<<<<<<
*
* def realPart(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":867
* return out
*
* def hermitianTranspose(self, Mat out=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* if out is None: out = self
*/
/* 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":879
* return out
*
* def realPart(self, Mat out=None): # <<<<<<<<<<<<<<
* if out is None:
* out = self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_153realPart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_152realPart[] = "Mat.realPart(self, Mat out=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_153realPart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_out = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "realPart") < 0)) __PYX_ERR(45, 879, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_out = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("realPart", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 879, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.realPart", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(45, 879, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_152realPart(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_152realPart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
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;
__Pyx_RefNannySetupContext("realPart", 0);
__Pyx_INCREF((PyObject *)__pyx_v_out);
/* "petsc4py/PETSc/Mat.pyx":880
*
* def realPart(self, Mat out=None):
* if out is None: # <<<<<<<<<<<<<<
* out = self
* elif out.mat == NULL:
*/
__pyx_t_1 = (((PyObject *)__pyx_v_out) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":881
* def realPart(self, Mat out=None):
* 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":880
*
* def realPart(self, Mat out=None):
* if out is None: # <<<<<<<<<<<<<<
* out = self
* elif out.mat == NULL:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Mat.pyx":882
* 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_2 = ((__pyx_v_out->mat == NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":883
* out = self
* elif out.mat == NULL:
* CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) # <<<<<<<<<<<<<<
* CHKERR( MatRealPart(out.mat) )
* return out
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, MAT_COPY_VALUES, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 883, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":882
* 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":884
* elif out.mat == NULL:
* CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) )
* CHKERR( MatRealPart(out.mat) ) # <<<<<<<<<<<<<<
* return out
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRealPart(__pyx_v_out->mat)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 884, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":885
* CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) )
* CHKERR( MatRealPart(out.mat) )
* return out # <<<<<<<<<<<<<<
*
* def imagPart(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":879
* return out
*
* def realPart(self, Mat out=None): # <<<<<<<<<<<<<<
* if out is None:
* out = self
*/
/* 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":887
* return out
*
* def imagPart(self, Mat out=None): # <<<<<<<<<<<<<<
* if out is None:
* out = self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_155imagPart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_154imagPart[] = "Mat.imagPart(self, Mat out=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_155imagPart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_out = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "imagPart") < 0)) __PYX_ERR(45, 887, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_out = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("imagPart", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 887, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.imagPart", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(45, 887, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_154imagPart(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_154imagPart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
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;
__Pyx_RefNannySetupContext("imagPart", 0);
__Pyx_INCREF((PyObject *)__pyx_v_out);
/* "petsc4py/PETSc/Mat.pyx":888
*
* def imagPart(self, Mat out=None):
* if out is None: # <<<<<<<<<<<<<<
* out = self
* elif out.mat == NULL:
*/
__pyx_t_1 = (((PyObject *)__pyx_v_out) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":889
* def imagPart(self, Mat out=None):
* 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":888
*
* def imagPart(self, Mat out=None):
* if out is None: # <<<<<<<<<<<<<<
* out = self
* elif out.mat == NULL:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Mat.pyx":890
* 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_2 = ((__pyx_v_out->mat == NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":891
* out = self
* elif out.mat == NULL:
* CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) # <<<<<<<<<<<<<<
* CHKERR( MatImaginaryPart(out.mat) )
* return out
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, MAT_COPY_VALUES, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 891, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":890
* 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":892
* elif out.mat == NULL:
* CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) )
* CHKERR( MatImaginaryPart(out.mat) ) # <<<<<<<<<<<<<<
* return out
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatImaginaryPart(__pyx_v_out->mat)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 892, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":893
* CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) )
* CHKERR( MatImaginaryPart(out.mat) )
* return out # <<<<<<<<<<<<<<
*
* def conjugate(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":887
* return out
*
* def imagPart(self, Mat out=None): # <<<<<<<<<<<<<<
* if out is None:
* out = self
*/
/* 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":895
* return out
*
* def conjugate(self, Mat out=None): # <<<<<<<<<<<<<<
* if out is None:
* out = self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_157conjugate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_156conjugate[] = "Mat.conjugate(self, Mat out=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_157conjugate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_out = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "conjugate") < 0)) __PYX_ERR(45, 895, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_out = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("conjugate", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 895, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.conjugate", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(45, 895, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_156conjugate(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_156conjugate(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
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;
__Pyx_RefNannySetupContext("conjugate", 0);
__Pyx_INCREF((PyObject *)__pyx_v_out);
/* "petsc4py/PETSc/Mat.pyx":896
*
* def conjugate(self, Mat out=None):
* if out is None: # <<<<<<<<<<<<<<
* out = self
* elif out.mat == NULL:
*/
__pyx_t_1 = (((PyObject *)__pyx_v_out) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":897
* def conjugate(self, Mat out=None):
* 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":896
*
* def conjugate(self, Mat out=None):
* if out is None: # <<<<<<<<<<<<<<
* out = self
* elif out.mat == NULL:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Mat.pyx":898
* 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_2 = ((__pyx_v_out->mat == NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":899
* out = self
* elif out.mat == NULL:
* CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) # <<<<<<<<<<<<<<
* CHKERR( MatConjugate(out.mat) )
* return out
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, MAT_COPY_VALUES, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 899, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":898
* 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":900
* elif out.mat == NULL:
* CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) )
* CHKERR( MatConjugate(out.mat) ) # <<<<<<<<<<<<<<
* return out
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatConjugate(__pyx_v_out->mat)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 900, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":901
* CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) )
* CHKERR( MatConjugate(out.mat) )
* return out # <<<<<<<<<<<<<<
*
* def permute(self, IS row, IS col):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_out));
__pyx_r = ((PyObject *)__pyx_v_out);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":895
* return out
*
* def conjugate(self, Mat out=None): # <<<<<<<<<<<<<<
* if out is None:
* out = self
*/
/* 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":903
* return out
*
* def permute(self, IS row, IS col): # <<<<<<<<<<<<<<
* cdef Mat mat = Mat()
* CHKERR( MatPermute(self.mat, row.iset, col.iset, &mat.mat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_159permute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_158permute[] = "Mat.permute(self, IS row, IS col)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_159permute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_row = 0;
struct PyPetscISObject *__pyx_v_col = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("permute", 1, 2, 2, 1); __PYX_ERR(45, 903, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "permute") < 0)) __PYX_ERR(45, 903, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_row = ((struct PyPetscISObject *)values[0]);
__pyx_v_col = ((struct PyPetscISObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("permute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 903, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.permute", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_row), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "row", 0))) __PYX_ERR(45, 903, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_col), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "col", 0))) __PYX_ERR(45, 903, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_158permute(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_158permute(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_row, struct PyPetscISObject *__pyx_v_col) {
struct PyPetscMatObject *__pyx_v_mat = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("permute", 0);
/* "petsc4py/PETSc/Mat.pyx":904
*
* def permute(self, IS row, IS col):
* cdef Mat mat = Mat() # <<<<<<<<<<<<<<
* CHKERR( MatPermute(self.mat, row.iset, col.iset, &mat.mat) )
* return mat
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 904, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":905
* def permute(self, IS row, IS col):
* cdef Mat mat = Mat()
* CHKERR( MatPermute(self.mat, row.iset, col.iset, &mat.mat) ) # <<<<<<<<<<<<<<
* return mat
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPermute(__pyx_v_self->mat, __pyx_v_row->iset, __pyx_v_col->iset, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 905, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":906
* cdef Mat mat = Mat()
* CHKERR( MatPermute(self.mat, row.iset, col.iset, &mat.mat) )
* return mat # <<<<<<<<<<<<<<
*
* def equal(self, Mat mat):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_mat));
__pyx_r = ((PyObject *)__pyx_v_mat);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":903
* return out
*
* def permute(self, IS row, IS col): # <<<<<<<<<<<<<<
* cdef Mat mat = Mat()
* CHKERR( MatPermute(self.mat, row.iset, col.iset, &mat.mat) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.permute", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_mat);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":908
* return mat
*
* def equal(self, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatEqual(self.mat, mat.mat, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_161equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_160equal[] = "Mat.equal(self, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_161equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(45, 908, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("equal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 908, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.equal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(45, 908, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_160equal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_160equal(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":909
*
* def equal(self, Mat mat):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( MatEqual(self.mat, mat.mat, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/Mat.pyx":910
* def equal(self, Mat mat):
* 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(45, 910, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":911
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatEqual(self.mat, mat.mat, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def isTranspose(self, Mat mat=None, tol=0):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 911, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":908
* return mat
*
* def equal(self, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatEqual(self.mat, mat.mat, &flag) )
*/
/* 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":913
* return toBool(flag)
*
* def isTranspose(self, Mat mat=None, tol=0): # <<<<<<<<<<<<<<
* if mat is None: mat = self
* cdef PetscReal rval = asReal(tol)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_163isTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_162isTranspose[] = "Mat.isTranspose(self, Mat mat=None, tol=0)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_163isTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 0;
PyObject *__pyx_v_tol = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_tol,0};
PyObject* values[2] = {0,0};
values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None);
values[1] = ((PyObject *)__pyx_int_0);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isTranspose") < 0)) __PYX_ERR(45, 913, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
__pyx_v_tol = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("isTranspose", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 913, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.isTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "mat", 0))) __PYX_ERR(45, 913, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_162isTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_tol);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_162isTranspose(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;
int __pyx_t_2;
PetscReal __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("isTranspose", 0);
__Pyx_INCREF((PyObject *)__pyx_v_mat);
/* "petsc4py/PETSc/Mat.pyx":914
*
* def isTranspose(self, Mat mat=None, tol=0):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_DECREF_SET(__pyx_v_mat, __pyx_v_self);
}
/* "petsc4py/PETSc/Mat.pyx":915
* def isTranspose(self, Mat mat=None, tol=0):
* 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_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(45, 915, __pyx_L1_error)
__pyx_v_rval = __pyx_t_3;
/* "petsc4py/PETSc/Mat.pyx":916
* 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":917
* cdef PetscReal rval = asReal(tol)
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatIsTranspose(self.mat, mat.mat, rval, &flag) ) # <<<<<<<<<<<<<<
* return toBool(flag)
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsTranspose(__pyx_v_self->mat, __pyx_v_mat->mat, __pyx_v_rval, (&__pyx_v_flag))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 917, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":918
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatIsTranspose(self.mat, mat.mat, rval, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def isSymmetric(self, tol=0):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 918, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":913
* return toBool(flag)
*
* def isTranspose(self, Mat mat=None, tol=0): # <<<<<<<<<<<<<<
* if mat is None: mat = self
* cdef PetscReal rval = asReal(tol)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_5);
__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":920
* return toBool(flag)
*
* def isSymmetric(self, tol=0): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(tol)
* cdef PetscBool flag = PETSC_FALSE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_165isSymmetric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_164isSymmetric[] = "Mat.isSymmetric(self, tol=0)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_165isSymmetric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tol = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)__pyx_int_0);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isSymmetric") < 0)) __PYX_ERR(45, 920, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_tol = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("isSymmetric", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 920, __pyx_L3_error)
__pyx_L3_error:;
__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_164isSymmetric(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_tol);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_164isSymmetric(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":921
*
* def isSymmetric(self, tol=0):
* 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(45, 921, __pyx_L1_error)
__pyx_v_rval = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":922
* def isSymmetric(self, tol=0):
* 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":923
* 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(45, 923, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":924
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatIsSymmetric(self.mat, rval, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def isSymmetricKnown(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 924, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":920
* return toBool(flag)
*
* def isSymmetric(self, tol=0): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(tol)
* cdef PetscBool flag = PETSC_FALSE
*/
/* 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":926
* return toBool(flag)
*
* def isSymmetricKnown(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag1 = PETSC_FALSE
* cdef PetscBool flag2 = PETSC_FALSE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_167isSymmetricKnown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_166isSymmetricKnown[] = "Mat.isSymmetricKnown(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_167isSymmetricKnown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isSymmetricKnown (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("isSymmetricKnown", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isSymmetricKnown", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_166isSymmetricKnown(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_166isSymmetricKnown(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":927
*
* def isSymmetricKnown(self):
* 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":928
* def isSymmetricKnown(self):
* 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":929
* 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(45, 929, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":930
* cdef PetscBool flag2 = PETSC_FALSE
* CHKERR( MatIsSymmetricKnown(self.mat, &flag1, &flag2) )
* return (toBool(flag1), toBool(flag2)) # <<<<<<<<<<<<<<
*
* def isHermitian(self, tol=0):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag1); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 930, __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(45, 930, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 930, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":926
* return toBool(flag)
*
* def isSymmetricKnown(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag1 = PETSC_FALSE
* cdef PetscBool flag2 = PETSC_FALSE
*/
/* 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":932
* return (toBool(flag1), toBool(flag2))
*
* def isHermitian(self, tol=0): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(tol)
* cdef PetscBool flag = PETSC_FALSE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_169isHermitian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_168isHermitian[] = "Mat.isHermitian(self, tol=0)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_169isHermitian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tol = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)__pyx_int_0);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isHermitian") < 0)) __PYX_ERR(45, 932, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_tol = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("isHermitian", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 932, __pyx_L3_error)
__pyx_L3_error:;
__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_168isHermitian(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_tol);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_168isHermitian(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":933
*
* def isHermitian(self, tol=0):
* 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(45, 933, __pyx_L1_error)
__pyx_v_rval = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":934
* def isHermitian(self, tol=0):
* 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":935
* 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(45, 935, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":936
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatIsHermitian(self.mat, rval, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def isHermitianKnown(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 936, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":932
* return (toBool(flag1), toBool(flag2))
*
* def isHermitian(self, tol=0): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(tol)
* cdef PetscBool flag = PETSC_FALSE
*/
/* 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":938
* return toBool(flag)
*
* def isHermitianKnown(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag1 = PETSC_FALSE
* cdef PetscBool flag2 = PETSC_FALSE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_171isHermitianKnown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_170isHermitianKnown[] = "Mat.isHermitianKnown(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_171isHermitianKnown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isHermitianKnown (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("isHermitianKnown", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isHermitianKnown", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_170isHermitianKnown(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_170isHermitianKnown(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":939
*
* def isHermitianKnown(self):
* 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":940
* def isHermitianKnown(self):
* 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":941
* 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(45, 941, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":942
* cdef PetscBool flag2 = PETSC_FALSE
* CHKERR( MatIsHermitianKnown(self.mat, &flag1, &flag2) )
* return (toBool(flag1), toBool(flag2)) # <<<<<<<<<<<<<<
*
* def isStructurallySymmetric(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag1); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 942, __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(45, 942, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 942, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":938
* return toBool(flag)
*
* def isHermitianKnown(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag1 = PETSC_FALSE
* cdef PetscBool flag2 = PETSC_FALSE
*/
/* 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":944
* return (toBool(flag1), toBool(flag2))
*
* def isStructurallySymmetric(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatIsStructurallySymmetric(self.mat, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_173isStructurallySymmetric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_172isStructurallySymmetric[] = "Mat.isStructurallySymmetric(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_173isStructurallySymmetric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isStructurallySymmetric (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("isStructurallySymmetric", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isStructurallySymmetric", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_172isStructurallySymmetric(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_172isStructurallySymmetric(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":945
*
* def isStructurallySymmetric(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( MatIsStructurallySymmetric(self.mat, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/Mat.pyx":946
* def isStructurallySymmetric(self):
* 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(45, 946, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":947
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatIsStructurallySymmetric(self.mat, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def zeroEntries(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 947, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":944
* return (toBool(flag1), toBool(flag2))
*
* def isStructurallySymmetric(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatIsStructurallySymmetric(self.mat, &flag) )
*/
/* 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":949
* return toBool(flag)
*
* def zeroEntries(self): # <<<<<<<<<<<<<<
* CHKERR( MatZeroEntries(self.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_175zeroEntries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_174zeroEntries[] = "Mat.zeroEntries(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_175zeroEntries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("zeroEntries (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("zeroEntries", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "zeroEntries", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_174zeroEntries(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_174zeroEntries(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":950
*
* def zeroEntries(self):
* CHKERR( MatZeroEntries(self.mat) ) # <<<<<<<<<<<<<<
*
* def getValue(self, row, col):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroEntries(__pyx_v_self->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 950, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":949
* return toBool(flag)
*
* def zeroEntries(self): # <<<<<<<<<<<<<<
* CHKERR( MatZeroEntries(self.mat) )
*
*/
/* 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":952
* CHKERR( MatZeroEntries(self.mat) )
*
* def getValue(self, row, col): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = asInt(row)
* cdef PetscInt ival2 = asInt(col)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_177getValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_176getValue[] = "Mat.getValue(self, row, col)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_177getValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_row = 0;
PyObject *__pyx_v_col = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("getValue", 1, 2, 2, 1); __PYX_ERR(45, 952, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getValue") < 0)) __PYX_ERR(45, 952, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_row = values[0];
__pyx_v_col = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getValue", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 952, __pyx_L3_error)
__pyx_L3_error:;
__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_176getValue(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_176getValue(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":953
*
* def getValue(self, row, col):
* 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(45, 953, __pyx_L1_error)
__pyx_v_ival1 = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":954
* def getValue(self, row, col):
* 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(45, 954, __pyx_L1_error)
__pyx_v_ival2 = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":955
* 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":956
* 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(45, 956, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":957
* cdef PetscScalar sval = 0
* CHKERR( MatGetValues(self.mat, 1, &ival1, 1, &ival2, &sval) )
* return toScalar(sval) # <<<<<<<<<<<<<<
*
* def getValues(self, rows, cols, values=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 957, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":952
* CHKERR( MatZeroEntries(self.mat) )
*
* def getValue(self, row, col): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = asInt(row)
* cdef PetscInt ival2 = asInt(col)
*/
/* 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":959
* return toScalar(sval)
*
* def getValues(self, rows, cols, values=None): # <<<<<<<<<<<<<<
* return matgetvalues(self.mat, rows, cols, values)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_179getValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_178getValues[] = "Mat.getValues(self, rows, cols, values=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_179getValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rows = 0;
PyObject *__pyx_v_cols = 0;
PyObject *__pyx_v_values = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_values,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("getValues", 0, 2, 3, 1); __PYX_ERR(45, 959, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getValues") < 0)) __PYX_ERR(45, 959, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_rows = values[0];
__pyx_v_cols = values[1];
__pyx_v_values = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getValues", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 959, __pyx_L3_error)
__pyx_L3_error:;
__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_178getValues(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_178getValues(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":960
*
* def getValues(self, rows, cols, values=None):
* return matgetvalues(self.mat, rows, cols, values) # <<<<<<<<<<<<<<
*
* def getValuesCSR(self):
*/
__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(45, 960, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":959
* return toScalar(sval)
*
* def getValues(self, rows, cols, values=None): # <<<<<<<<<<<<<<
* return matgetvalues(self.mat, rows, cols, values)
*
*/
/* 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":962
* return matgetvalues(self.mat, rows, cols, values)
*
* def getValuesCSR(self): # <<<<<<<<<<<<<<
* # row ownership
* cdef PetscInt rstart=0, rend=0, nrows=0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_181getValuesCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_180getValuesCSR[] = "Mat.getValuesCSR(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_181getValuesCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getValuesCSR (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getValuesCSR", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getValuesCSR", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_180getValuesCSR(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_180getValuesCSR(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":964
* def getValuesCSR(self):
* # 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":965
* # 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(45, 965, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":966
* 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":968
* 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":969
* # 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(45, 969, __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(45, 969, __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":970
* 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":971
* 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":972
* 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":973
* 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(45, 973, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":974
* 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":975
* 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(45, 975, __pyx_L1_error)
}
/* "petsc4py/PETSc/Mat.pyx":977
* 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":978
* # 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(45, 978, __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(45, 978, __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":979
* 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":980
* 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(45, 980, __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(45, 980, __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":981
* 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":982
* 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":983
* 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":984
* 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(45, 984, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":985
* 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(45, 985, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":986
* 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(45, 986, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":987
* 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(45, 987, __pyx_L1_error)
}
/* "petsc4py/PETSc/Mat.pyx":989
* CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, &cols, &vals) )
* #
* return (ai, aj, av) # <<<<<<<<<<<<<<
*
* def getRow(self, row):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 989, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_ai));
__Pyx_GIVEREF(((PyObject *)__pyx_v_ai));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_ai));
__Pyx_INCREF(((PyObject *)__pyx_v_aj));
__Pyx_GIVEREF(((PyObject *)__pyx_v_aj));
PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_aj));
__Pyx_INCREF(((PyObject *)__pyx_v_av));
__Pyx_GIVEREF(((PyObject *)__pyx_v_av));
PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_av));
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":962
* return matgetvalues(self.mat, rows, cols, values)
*
* def getValuesCSR(self): # <<<<<<<<<<<<<<
* # row ownership
* cdef PetscInt rstart=0, rend=0, nrows=0
*/
/* 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":991
* return (ai, aj, av)
*
* def getRow(self, row): # <<<<<<<<<<<<<<
* cdef PetscInt irow = asInt(row)
* cdef PetscInt ncols = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_183getRow(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_182getRow[] = "Mat.getRow(self, row)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_183getRow(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_row = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getRow") < 0)) __PYX_ERR(45, 991, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_row = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getRow", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 991, __pyx_L3_error)
__pyx_L3_error:;
__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_182getRow(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_182getRow(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":992
*
* def getRow(self, row):
* 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(45, 992, __pyx_L1_error)
__pyx_v_irow = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":993
* def getRow(self, row):
* 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":994
* 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":995
* 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":996
* 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(45, 996, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":997
* 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(45, 997, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_cols = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":998
* 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(45, 998, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_vals = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":999
* 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(45, 999, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1000
* cdef object vals = array_s(ncols, svals)
* CHKERR( MatRestoreRow(self.mat, irow, &ncols, &icols, &svals) )
* return (cols, vals) # <<<<<<<<<<<<<<
*
* def getRowIJ(self, symmetric=False, compressed=False):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1000, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_cols);
__Pyx_GIVEREF(__pyx_v_cols);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cols);
__Pyx_INCREF(__pyx_v_vals);
__Pyx_GIVEREF(__pyx_v_vals);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vals);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":991
* return (ai, aj, av)
*
* def getRow(self, row): # <<<<<<<<<<<<<<
* cdef PetscInt irow = asInt(row)
* cdef PetscInt ncols = 0
*/
/* 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":1002
* return (cols, vals)
*
* def getRowIJ(self, symmetric=False, compressed=False): # <<<<<<<<<<<<<<
* cdef PetscInt shift=0
* cdef PetscBool symm=symmetric
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_185getRowIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_184getRowIJ[] = "Mat.getRowIJ(self, symmetric=False, compressed=False)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_185getRowIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_symmetric = 0;
PyObject *__pyx_v_compressed = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_symmetric,&__pyx_n_s_compressed,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_False);
values[1] = ((PyObject *)Py_False);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_symmetric);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compressed);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getRowIJ") < 0)) __PYX_ERR(45, 1002, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_symmetric = values[0];
__pyx_v_compressed = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getRowIJ", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1002, __pyx_L3_error)
__pyx_L3_error:;
__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_184getRowIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_symmetric, __pyx_v_compressed);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_184getRowIJ(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":1003
*
* def getRowIJ(self, symmetric=False, compressed=False):
* cdef PetscInt shift=0 # <<<<<<<<<<<<<<
* cdef PetscBool symm=symmetric
* cdef PetscBool bcmp=compressed
*/
__pyx_v_shift = 0;
/* "petsc4py/PETSc/Mat.pyx":1004
* def getRowIJ(self, symmetric=False, compressed=False):
* cdef PetscInt shift=0
* cdef PetscBool symm=symmetric # <<<<<<<<<<<<<<
* cdef PetscBool bcmp=compressed
* cdef PetscInt n=0
*/
__pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_symmetric)); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 1004, __pyx_L1_error)
__pyx_v_symm = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1005
* cdef PetscInt shift=0
* cdef PetscBool symm=symmetric
* cdef PetscBool bcmp=compressed # <<<<<<<<<<<<<<
* cdef PetscInt n=0
* cdef const PetscInt *ia=NULL
*/
__pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_compressed)); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 1005, __pyx_L1_error)
__pyx_v_bcmp = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1006
* 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":1007
* 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":1008
* 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":1009
* 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":1010
* 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(45, 1010, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1011
* 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":1012
* 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) != 0);
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(45, 1012, __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":1013
* 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) != 0);
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(45, 1013, __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":1014
* 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(45, 1014, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1015
* 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=False, compressed=False):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 1015, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_ai);
__Pyx_GIVEREF(__pyx_v_ai);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ai);
__Pyx_INCREF(__pyx_v_aj);
__Pyx_GIVEREF(__pyx_v_aj);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_aj);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1002
* return (cols, vals)
*
* def getRowIJ(self, symmetric=False, compressed=False): # <<<<<<<<<<<<<<
* cdef PetscInt shift=0
* cdef PetscBool symm=symmetric
*/
/* 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":1017
* return (ai, aj)
*
* def getColumnIJ(self, symmetric=False, compressed=False): # <<<<<<<<<<<<<<
* cdef PetscInt shift=0
* cdef PetscBool symm=symmetric, bcmp=compressed
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_187getColumnIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_186getColumnIJ[] = "Mat.getColumnIJ(self, symmetric=False, compressed=False)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_187getColumnIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_symmetric = 0;
PyObject *__pyx_v_compressed = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_symmetric,&__pyx_n_s_compressed,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_False);
values[1] = ((PyObject *)Py_False);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_symmetric);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compressed);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getColumnIJ") < 0)) __PYX_ERR(45, 1017, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_symmetric = values[0];
__pyx_v_compressed = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getColumnIJ", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1017, __pyx_L3_error)
__pyx_L3_error:;
__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_186getColumnIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_symmetric, __pyx_v_compressed);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_186getColumnIJ(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":1018
*
* def getColumnIJ(self, symmetric=False, compressed=False):
* cdef PetscInt shift=0 # <<<<<<<<<<<<<<
* cdef PetscBool symm=symmetric, bcmp=compressed
* cdef PetscInt n=0
*/
__pyx_v_shift = 0;
/* "petsc4py/PETSc/Mat.pyx":1019
* def getColumnIJ(self, symmetric=False, compressed=False):
* cdef PetscInt shift=0
* cdef PetscBool symm=symmetric, bcmp=compressed # <<<<<<<<<<<<<<
* cdef PetscInt n=0
* cdef const PetscInt *ia=NULL
*/
__pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_symmetric)); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 1019, __pyx_L1_error)
__pyx_v_symm = __pyx_t_1;
__pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_compressed)); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 1019, __pyx_L1_error)
__pyx_v_bcmp = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1020
* 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":1021
* 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":1022
* 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":1023
* 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":1024
* 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(45, 1024, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1025
* 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":1026
* 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) != 0);
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(45, 1026, __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":1027
* 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) != 0);
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(45, 1027, __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":1028
* 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(45, 1028, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1029
* 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(self, row, col, value, addv=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 1029, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_ai);
__Pyx_GIVEREF(__pyx_v_ai);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ai);
__Pyx_INCREF(__pyx_v_aj);
__Pyx_GIVEREF(__pyx_v_aj);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_aj);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1017
* return (ai, aj)
*
* def getColumnIJ(self, symmetric=False, compressed=False): # <<<<<<<<<<<<<<
* cdef PetscInt shift=0
* cdef PetscBool symm=symmetric, bcmp=compressed
*/
/* 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":1031
* return (ai, aj)
*
* def setValue(self, row, col, value, addv=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = asInt(row)
* cdef PetscInt ival2 = asInt(col)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_189setValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_188setValue[] = "Mat.setValue(self, row, col, value, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_189setValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_row = 0;
PyObject *__pyx_v_col = 0;
PyObject *__pyx_v_value = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValue", 0, 3, 4, 1); __PYX_ERR(45, 1031, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValue", 0, 3, 4, 2); __PYX_ERR(45, 1031, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValue") < 0)) __PYX_ERR(45, 1031, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_row = values[0];
__pyx_v_col = values[1];
__pyx_v_value = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValue", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1031, __pyx_L3_error)
__pyx_L3_error:;
__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_188setValue(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_188setValue(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":1032
*
* def setValue(self, row, col, value, addv=None):
* 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(45, 1032, __pyx_L1_error)
__pyx_v_ival1 = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1033
* def setValue(self, row, col, value, addv=None):
* 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(45, 1033, __pyx_L1_error)
__pyx_v_ival2 = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1034
* cdef PetscInt ival1 = asInt(row)
* cdef PetscInt ival2 = asInt(col)
* cdef PetscScalar sval = asScalar(value) # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) )
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_value); if (unlikely(__pyx_t_2 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(45, 1034, __pyx_L1_error)
__pyx_v_sval = __pyx_t_2;
/* "petsc4py/PETSc/Mat.pyx":1035
* 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(45, 1035, __pyx_L1_error)
__pyx_v_caddv = __pyx_t_3;
/* "petsc4py/PETSc/Mat.pyx":1036
* cdef PetscScalar sval = asScalar(value)
* cdef PetscInsertMode caddv = insertmode(addv)
* CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) # <<<<<<<<<<<<<<
*
* def setValues(self, rows, cols, values, addv=None):
*/
__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(45, 1036, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1031
* return (ai, aj)
*
* def setValue(self, row, col, value, addv=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = asInt(row)
* cdef PetscInt ival2 = asInt(col)
*/
/* 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":1038
* CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) )
*
* def setValues(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<<
* matsetvalues(self.mat, rows, cols, values, addv, 0, 0)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_191setValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_190setValues[] = "Mat.setValues(self, rows, cols, values, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_191setValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rows = 0;
PyObject *__pyx_v_cols = 0;
PyObject *__pyx_v_values = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_values,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValues", 0, 3, 4, 1); __PYX_ERR(45, 1038, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValues", 0, 3, 4, 2); __PYX_ERR(45, 1038, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValues") < 0)) __PYX_ERR(45, 1038, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_rows = values[0];
__pyx_v_cols = values[1];
__pyx_v_values = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValues", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1038, __pyx_L3_error)
__pyx_L3_error:;
__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_190setValues(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_190setValues(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":1039
*
* def setValues(self, rows, cols, values, addv=None):
* matsetvalues(self.mat, rows, cols, values, addv, 0, 0) # <<<<<<<<<<<<<<
*
* def setValuesRCV(self, R, C, V, addv=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(45, 1039, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1038
* CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) )
*
* def setValues(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<<
* matsetvalues(self.mat, rows, cols, values, 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.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":1041
* matsetvalues(self.mat, rows, cols, values, addv, 0, 0)
*
* def setValuesRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<<
* matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_193setValuesRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_192setValuesRCV[] = "Mat.setValuesRCV(self, R, C, V, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_193setValuesRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_R = 0;
PyObject *__pyx_v_C = 0;
PyObject *__pyx_v_V = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_C,&__pyx_n_s_V,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesRCV", 0, 3, 4, 1); __PYX_ERR(45, 1041, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesRCV", 0, 3, 4, 2); __PYX_ERR(45, 1041, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesRCV") < 0)) __PYX_ERR(45, 1041, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_R = values[0];
__pyx_v_C = values[1];
__pyx_v_V = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesRCV", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1041, __pyx_L3_error)
__pyx_L3_error:;
__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_192setValuesRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_192setValuesRCV(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":1042
*
* def setValuesRCV(self, R, C, V, addv=None):
* matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0) # <<<<<<<<<<<<<<
*
* def setValuesIJV(self, I, J, V, addv=None, rowmap=None):
*/
__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(45, 1042, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1041
* matsetvalues(self.mat, rows, cols, values, addv, 0, 0)
*
* def setValuesRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<<
* 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":1044
* matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0)
*
* def setValuesIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<<
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_195setValuesIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_194setValuesIJV[] = "Mat.setValuesIJV(self, I, J, V, addv=None, rowmap=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_195setValuesIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setValuesIJV (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,&__pyx_n_s_rowmap,0};
PyObject* values[5] = {0,0,0,0,0};
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesIJV", 0, 3, 5, 1); __PYX_ERR(45, 1044, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesIJV", 0, 3, 5, 2); __PYX_ERR(45, 1044, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowmap);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesIJV") < 0)) __PYX_ERR(45, 1044, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_I = values[0];
__pyx_v_J = values[1];
__pyx_v_V = values[2];
__pyx_v_addv = values[3];
__pyx_v_rowmap = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesIJV", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1044, __pyx_L3_error)
__pyx_L3_error:;
__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_194setValuesIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_194setValuesIJV(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":1045
*
* def setValuesIJV(self, I, J, V, addv=None, rowmap=None):
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0) # <<<<<<<<<<<<<<
*
* def setValuesCSR(self, I, J, V, addv=None):
*/
__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(45, 1045, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1044
* matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0)
*
* def setValuesIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<<
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0)
*
*/
/* 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":1047
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0)
*
* def setValuesCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<<
* matsetvalues_csr(self.mat, I, J, V, addv, 0, 0)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_197setValuesCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_196setValuesCSR[] = "Mat.setValuesCSR(self, I, J, V, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_197setValuesCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_I = 0;
PyObject *__pyx_v_J = 0;
PyObject *__pyx_v_V = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesCSR", 0, 3, 4, 1); __PYX_ERR(45, 1047, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesCSR", 0, 3, 4, 2); __PYX_ERR(45, 1047, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesCSR") < 0)) __PYX_ERR(45, 1047, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_I = values[0];
__pyx_v_J = values[1];
__pyx_v_V = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesCSR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1047, __pyx_L3_error)
__pyx_L3_error:;
__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_196setValuesCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_196setValuesCSR(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":1048
*
* def setValuesCSR(self, I, J, V, addv=None):
* matsetvalues_csr(self.mat, I, J, V, addv, 0, 0) # <<<<<<<<<<<<<<
*
* def setValuesBlocked(self, rows, cols, values, addv=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, 0, 0); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1048, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1047
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0)
*
* def setValuesCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<<
* matsetvalues_csr(self.mat, I, J, 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.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":1050
* matsetvalues_csr(self.mat, I, J, V, addv, 0, 0)
*
* def setValuesBlocked(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<<
* matsetvalues(self.mat, rows, cols, values, addv, 1, 0)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_199setValuesBlocked(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_198setValuesBlocked[] = "Mat.setValuesBlocked(self, rows, cols, values, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_199setValuesBlocked(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rows = 0;
PyObject *__pyx_v_cols = 0;
PyObject *__pyx_v_values = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_values,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 3, 4, 1); __PYX_ERR(45, 1050, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 3, 4, 2); __PYX_ERR(45, 1050, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlocked") < 0)) __PYX_ERR(45, 1050, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_rows = values[0];
__pyx_v_cols = values[1];
__pyx_v_values = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1050, __pyx_L3_error)
__pyx_L3_error:;
__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_198setValuesBlocked(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_198setValuesBlocked(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":1051
*
* def setValuesBlocked(self, rows, cols, values, addv=None):
* matsetvalues(self.mat, rows, cols, values, addv, 1, 0) # <<<<<<<<<<<<<<
*
* def setValuesBlockedRCV(self, R, C, V, addv=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(45, 1051, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1050
* matsetvalues_csr(self.mat, I, J, V, addv, 0, 0)
*
* def setValuesBlocked(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<<
* matsetvalues(self.mat, rows, cols, values, 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.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":1053
* matsetvalues(self.mat, rows, cols, values, addv, 1, 0)
*
* def setValuesBlockedRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<<
* matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_201setValuesBlockedRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_200setValuesBlockedRCV[] = "Mat.setValuesBlockedRCV(self, R, C, V, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_201setValuesBlockedRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_R = 0;
PyObject *__pyx_v_C = 0;
PyObject *__pyx_v_V = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_C,&__pyx_n_s_V,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlockedRCV", 0, 3, 4, 1); __PYX_ERR(45, 1053, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlockedRCV", 0, 3, 4, 2); __PYX_ERR(45, 1053, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedRCV") < 0)) __PYX_ERR(45, 1053, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_R = values[0];
__pyx_v_C = values[1];
__pyx_v_V = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesBlockedRCV", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1053, __pyx_L3_error)
__pyx_L3_error:;
__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_200setValuesBlockedRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_200setValuesBlockedRCV(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":1054
*
* def setValuesBlockedRCV(self, R, C, V, addv=None):
* matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0) # <<<<<<<<<<<<<<
*
* def setValuesBlockedIJV(self, I, J, V, addv=None, rowmap=None):
*/
__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(45, 1054, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1053
* matsetvalues(self.mat, rows, cols, values, addv, 1, 0)
*
* def setValuesBlockedRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<<
* 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":1056
* matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0)
*
* def setValuesBlockedIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<<
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_203setValuesBlockedIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_202setValuesBlockedIJV[] = "Mat.setValuesBlockedIJV(self, I, J, V, addv=None, rowmap=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_203setValuesBlockedIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setValuesBlockedIJV (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,&__pyx_n_s_rowmap,0};
PyObject* values[5] = {0,0,0,0,0};
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlockedIJV", 0, 3, 5, 1); __PYX_ERR(45, 1056, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlockedIJV", 0, 3, 5, 2); __PYX_ERR(45, 1056, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowmap);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedIJV") < 0)) __PYX_ERR(45, 1056, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_I = values[0];
__pyx_v_J = values[1];
__pyx_v_V = values[2];
__pyx_v_addv = values[3];
__pyx_v_rowmap = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesBlockedIJV", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1056, __pyx_L3_error)
__pyx_L3_error:;
__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_202setValuesBlockedIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_202setValuesBlockedIJV(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":1057
*
* def setValuesBlockedIJV(self, I, J, V, addv=None, rowmap=None):
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0) # <<<<<<<<<<<<<<
*
* def setValuesBlockedCSR(self, I, J, V, addv=None):
*/
__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(45, 1057, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1056
* matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0)
*
* def setValuesBlockedIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<<
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0)
*
*/
/* 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":1059
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0)
*
* def setValuesBlockedCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<<
* matsetvalues_csr(self.mat, I, J, V, addv, 1, 0)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_205setValuesBlockedCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_204setValuesBlockedCSR[] = "Mat.setValuesBlockedCSR(self, I, J, V, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_205setValuesBlockedCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_I = 0;
PyObject *__pyx_v_J = 0;
PyObject *__pyx_v_V = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlockedCSR", 0, 3, 4, 1); __PYX_ERR(45, 1059, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlockedCSR", 0, 3, 4, 2); __PYX_ERR(45, 1059, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedCSR") < 0)) __PYX_ERR(45, 1059, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_I = values[0];
__pyx_v_J = values[1];
__pyx_v_V = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesBlockedCSR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1059, __pyx_L3_error)
__pyx_L3_error:;
__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_204setValuesBlockedCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_204setValuesBlockedCSR(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":1060
*
* def setValuesBlockedCSR(self, I, J, V, addv=None):
* matsetvalues_csr(self.mat, I, J, V, addv, 1, 0) # <<<<<<<<<<<<<<
*
* def setLGMap(self, LGMap rmap, LGMap cmap=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(45, 1060, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1059
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0)
*
* def setValuesBlockedCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<<
* matsetvalues_csr(self.mat, I, J, 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.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":1062
* matsetvalues_csr(self.mat, I, J, V, addv, 1, 0)
*
* def setLGMap(self, LGMap rmap, LGMap cmap=None): # <<<<<<<<<<<<<<
* if cmap is None: cmap = rmap
* CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_207setLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_206setLGMap[] = "Mat.setLGMap(self, LGMap rmap, LGMap cmap=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_207setLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscLGMapObject *__pyx_v_rmap = 0;
struct PyPetscLGMapObject *__pyx_v_cmap = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rmap,&__pyx_n_s_cmap,0};
PyObject* values[2] = {0,0};
values[1] = (PyObject *)((struct PyPetscLGMapObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rmap)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmap);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLGMap") < 0)) __PYX_ERR(45, 1062, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_rmap = ((struct PyPetscLGMapObject *)values[0]);
__pyx_v_cmap = ((struct PyPetscLGMapObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setLGMap", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1062, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.setLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rmap), __pyx_ptype_8petsc4py_5PETSc_LGMap, 0, "rmap", 0))) __PYX_ERR(45, 1062, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmap), __pyx_ptype_8petsc4py_5PETSc_LGMap, 1, "cmap", 0))) __PYX_ERR(45, 1062, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_206setLGMap(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rmap, __pyx_v_cmap);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_206setLGMap(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;
int __pyx_t_2;
PetscErrorCode __pyx_t_3;
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":1063
*
* def setLGMap(self, LGMap rmap, LGMap cmap=None):
* if cmap is None: cmap = rmap # <<<<<<<<<<<<<<
* CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) )
*
*/
__pyx_t_1 = (((PyObject *)__pyx_v_cmap) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(((PyObject *)__pyx_v_rmap));
__Pyx_DECREF_SET(__pyx_v_cmap, __pyx_v_rmap);
}
/* "petsc4py/PETSc/Mat.pyx":1064
* def setLGMap(self, LGMap rmap, LGMap cmap=None):
* if cmap is None: cmap = rmap
* CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) ) # <<<<<<<<<<<<<<
*
* def getLGMap(self):
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetLocalToGlobalMapping(__pyx_v_self->mat, __pyx_v_rmap->lgm, __pyx_v_cmap->lgm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1064, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1062
* matsetvalues_csr(self.mat, I, J, V, addv, 1, 0)
*
* def setLGMap(self, LGMap rmap, LGMap cmap=None): # <<<<<<<<<<<<<<
* if cmap is None: cmap = rmap
* CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) )
*/
/* 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":1066
* CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) )
*
* def getLGMap(self): # <<<<<<<<<<<<<<
* cdef LGMap cmap = LGMap()
* cdef LGMap rmap = LGMap()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_209getLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_208getLGMap[] = "Mat.getLGMap(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_209getLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getLGMap (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getLGMap", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLGMap", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_208getLGMap(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_208getLGMap(struct PyPetscMatObject *__pyx_v_self) {
struct PyPetscLGMapObject *__pyx_v_cmap = 0;
struct PyPetscLGMapObject *__pyx_v_rmap = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getLGMap", 0);
/* "petsc4py/PETSc/Mat.pyx":1067
*
* def getLGMap(self):
* cdef LGMap cmap = LGMap() # <<<<<<<<<<<<<<
* cdef LGMap rmap = LGMap()
* CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) )
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_cmap = ((struct PyPetscLGMapObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1068
* def getLGMap(self):
* cdef LGMap cmap = LGMap()
* cdef LGMap rmap = LGMap() # <<<<<<<<<<<<<<
* CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) )
* PetscINCREF(cmap.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1068, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_rmap = ((struct PyPetscLGMapObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1069
* cdef LGMap cmap = LGMap()
* cdef LGMap rmap = LGMap()
* CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) ) # <<<<<<<<<<<<<<
* PetscINCREF(cmap.obj)
* PetscINCREF(rmap.obj)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalToGlobalMapping(__pyx_v_self->mat, (&__pyx_v_rmap->lgm), (&__pyx_v_cmap->lgm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1069, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1070
* cdef LGMap rmap = LGMap()
* CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) )
* PetscINCREF(cmap.obj) # <<<<<<<<<<<<<<
* PetscINCREF(rmap.obj)
* return (rmap, cmap)
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cmap->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1071
* CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) )
* PetscINCREF(cmap.obj)
* PetscINCREF(rmap.obj) # <<<<<<<<<<<<<<
* return (rmap, cmap)
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_rmap->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1072
* PetscINCREF(cmap.obj)
* PetscINCREF(rmap.obj)
* return (rmap, cmap) # <<<<<<<<<<<<<<
*
* def setValueLocal(self, row, col, value, addv=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1072, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_rmap));
__Pyx_GIVEREF(((PyObject *)__pyx_v_rmap));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_rmap));
__Pyx_INCREF(((PyObject *)__pyx_v_cmap));
__Pyx_GIVEREF(((PyObject *)__pyx_v_cmap));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_cmap));
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1066
* CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) )
*
* def getLGMap(self): # <<<<<<<<<<<<<<
* cdef LGMap cmap = LGMap()
* cdef LGMap rmap = LGMap()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_cmap);
__Pyx_XDECREF((PyObject *)__pyx_v_rmap);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1074
* return (rmap, cmap)
*
* def setValueLocal(self, row, col, value, addv=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = asInt(row)
* cdef PetscInt ival2 = asInt(col)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_211setValueLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_210setValueLocal[] = "Mat.setValueLocal(self, row, col, value, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_211setValueLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_row = 0;
PyObject *__pyx_v_col = 0;
PyObject *__pyx_v_value = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 3, 4, 1); __PYX_ERR(45, 1074, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 3, 4, 2); __PYX_ERR(45, 1074, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValueLocal") < 0)) __PYX_ERR(45, 1074, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_row = values[0];
__pyx_v_col = values[1];
__pyx_v_value = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1074, __pyx_L3_error)
__pyx_L3_error:;
__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_210setValueLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_210setValueLocal(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":1075
*
* def setValueLocal(self, row, col, value, addv=None):
* 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(45, 1075, __pyx_L1_error)
__pyx_v_ival1 = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1076
* def setValueLocal(self, row, col, value, addv=None):
* 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(45, 1076, __pyx_L1_error)
__pyx_v_ival2 = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1077
* cdef PetscInt ival1 = asInt(row)
* cdef PetscInt ival2 = asInt(col)
* cdef PetscScalar sval = asScalar(value) # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* CHKERR( MatSetValuesLocal(
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_value); if (unlikely(__pyx_t_2 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(45, 1077, __pyx_L1_error)
__pyx_v_sval = __pyx_t_2;
/* "petsc4py/PETSc/Mat.pyx":1078
* 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(45, 1078, __pyx_L1_error)
__pyx_v_caddv = __pyx_t_3;
/* "petsc4py/PETSc/Mat.pyx":1079
* 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(45, 1079, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1074
* return (rmap, cmap)
*
* def setValueLocal(self, row, col, value, addv=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = asInt(row)
* cdef PetscInt ival2 = asInt(col)
*/
/* 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":1082
* self.mat, 1, &ival1, 1, &ival2, &sval, caddv) )
*
* def setValuesLocal(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<<
* matsetvalues(self.mat, rows, cols, values, addv, 0, 1)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_213setValuesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_212setValuesLocal[] = "Mat.setValuesLocal(self, rows, cols, values, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_213setValuesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rows = 0;
PyObject *__pyx_v_cols = 0;
PyObject *__pyx_v_values = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_values,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 3, 4, 1); __PYX_ERR(45, 1082, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 3, 4, 2); __PYX_ERR(45, 1082, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesLocal") < 0)) __PYX_ERR(45, 1082, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_rows = values[0];
__pyx_v_cols = values[1];
__pyx_v_values = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1082, __pyx_L3_error)
__pyx_L3_error:;
__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_212setValuesLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_212setValuesLocal(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":1083
*
* def setValuesLocal(self, rows, cols, values, addv=None):
* matsetvalues(self.mat, rows, cols, values, addv, 0, 1) # <<<<<<<<<<<<<<
*
* def setValuesLocalRCV(self, R, C, V, addv=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(45, 1083, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1082
* self.mat, 1, &ival1, 1, &ival2, &sval, caddv) )
*
* def setValuesLocal(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<<
* matsetvalues(self.mat, rows, cols, values, 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.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":1085
* matsetvalues(self.mat, rows, cols, values, addv, 0, 1)
*
* def setValuesLocalRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<<
* matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_215setValuesLocalRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_214setValuesLocalRCV[] = "Mat.setValuesLocalRCV(self, R, C, V, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_215setValuesLocalRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_R = 0;
PyObject *__pyx_v_C = 0;
PyObject *__pyx_v_V = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_C,&__pyx_n_s_V,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesLocalRCV", 0, 3, 4, 1); __PYX_ERR(45, 1085, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesLocalRCV", 0, 3, 4, 2); __PYX_ERR(45, 1085, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesLocalRCV") < 0)) __PYX_ERR(45, 1085, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_R = values[0];
__pyx_v_C = values[1];
__pyx_v_V = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesLocalRCV", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1085, __pyx_L3_error)
__pyx_L3_error:;
__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_214setValuesLocalRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_214setValuesLocalRCV(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":1086
*
* def setValuesLocalRCV(self, R, C, V, addv=None):
* matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1) # <<<<<<<<<<<<<<
*
* def setValuesLocalIJV(self, I, J, V, addv=None, rowmap=None):
*/
__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(45, 1086, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1085
* matsetvalues(self.mat, rows, cols, values, addv, 0, 1)
*
* def setValuesLocalRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<<
* 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":1088
* matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1)
*
* def setValuesLocalIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<<
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_217setValuesLocalIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_216setValuesLocalIJV[] = "Mat.setValuesLocalIJV(self, I, J, V, addv=None, rowmap=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_217setValuesLocalIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setValuesLocalIJV (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,&__pyx_n_s_rowmap,0};
PyObject* values[5] = {0,0,0,0,0};
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesLocalIJV", 0, 3, 5, 1); __PYX_ERR(45, 1088, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesLocalIJV", 0, 3, 5, 2); __PYX_ERR(45, 1088, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowmap);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesLocalIJV") < 0)) __PYX_ERR(45, 1088, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_I = values[0];
__pyx_v_J = values[1];
__pyx_v_V = values[2];
__pyx_v_addv = values[3];
__pyx_v_rowmap = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesLocalIJV", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1088, __pyx_L3_error)
__pyx_L3_error:;
__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_216setValuesLocalIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_216setValuesLocalIJV(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":1089
*
* def setValuesLocalIJV(self, I, J, V, addv=None, rowmap=None):
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1) # <<<<<<<<<<<<<<
*
* def setValuesLocalCSR(self, I, J, V, addv=None):
*/
__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(45, 1089, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1088
* matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1)
*
* def setValuesLocalIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<<
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1)
*
*/
/* 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":1091
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1)
*
* def setValuesLocalCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<<
* matsetvalues_csr(self.mat, I, J, V, addv, 0, 1)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_219setValuesLocalCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_218setValuesLocalCSR[] = "Mat.setValuesLocalCSR(self, I, J, V, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_219setValuesLocalCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_I = 0;
PyObject *__pyx_v_J = 0;
PyObject *__pyx_v_V = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesLocalCSR", 0, 3, 4, 1); __PYX_ERR(45, 1091, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesLocalCSR", 0, 3, 4, 2); __PYX_ERR(45, 1091, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesLocalCSR") < 0)) __PYX_ERR(45, 1091, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_I = values[0];
__pyx_v_J = values[1];
__pyx_v_V = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesLocalCSR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1091, __pyx_L3_error)
__pyx_L3_error:;
__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_218setValuesLocalCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_218setValuesLocalCSR(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":1092
*
* def setValuesLocalCSR(self, I, J, V, addv=None):
* matsetvalues_csr(self.mat, I, J, V, addv, 0, 1) # <<<<<<<<<<<<<<
*
* def setValuesBlockedLocal(self, rows, cols, values, addv=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, 0, 1); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1092, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1091
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1)
*
* def setValuesLocalCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<<
* matsetvalues_csr(self.mat, I, J, 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.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":1094
* matsetvalues_csr(self.mat, I, J, V, addv, 0, 1)
*
* def setValuesBlockedLocal(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<<
* matsetvalues(self.mat, rows, cols, values, addv, 1, 1)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_221setValuesBlockedLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_220setValuesBlockedLocal[] = "Mat.setValuesBlockedLocal(self, rows, cols, values, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_221setValuesBlockedLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rows = 0;
PyObject *__pyx_v_cols = 0;
PyObject *__pyx_v_values = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_values,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 3, 4, 1); __PYX_ERR(45, 1094, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 3, 4, 2); __PYX_ERR(45, 1094, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedLocal") < 0)) __PYX_ERR(45, 1094, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_rows = values[0];
__pyx_v_cols = values[1];
__pyx_v_values = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1094, __pyx_L3_error)
__pyx_L3_error:;
__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_220setValuesBlockedLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_220setValuesBlockedLocal(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":1095
*
* def setValuesBlockedLocal(self, rows, cols, values, addv=None):
* matsetvalues(self.mat, rows, cols, values, addv, 1, 1) # <<<<<<<<<<<<<<
*
* def setValuesBlockedLocalRCV(self, R, C, V, addv=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(45, 1095, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1094
* matsetvalues_csr(self.mat, I, J, V, addv, 0, 1)
*
* def setValuesBlockedLocal(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<<
* matsetvalues(self.mat, rows, cols, values, 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.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":1097
* matsetvalues(self.mat, rows, cols, values, addv, 1, 1)
*
* def setValuesBlockedLocalRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<<
* matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_223setValuesBlockedLocalRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_222setValuesBlockedLocalRCV[] = "Mat.setValuesBlockedLocalRCV(self, R, C, V, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_223setValuesBlockedLocalRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_R = 0;
PyObject *__pyx_v_C = 0;
PyObject *__pyx_v_V = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_C,&__pyx_n_s_V,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalRCV", 0, 3, 4, 1); __PYX_ERR(45, 1097, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalRCV", 0, 3, 4, 2); __PYX_ERR(45, 1097, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedLocalRCV") < 0)) __PYX_ERR(45, 1097, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_R = values[0];
__pyx_v_C = values[1];
__pyx_v_V = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalRCV", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1097, __pyx_L3_error)
__pyx_L3_error:;
__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_222setValuesBlockedLocalRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_222setValuesBlockedLocalRCV(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":1098
*
* def setValuesBlockedLocalRCV(self, R, C, V, addv=None):
* matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1) # <<<<<<<<<<<<<<
*
* def setValuesBlockedLocalIJV(self, I, J, V, addv=None, rowmap=None):
*/
__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(45, 1098, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1097
* matsetvalues(self.mat, rows, cols, values, addv, 1, 1)
*
* def setValuesBlockedLocalRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<<
* 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":1100
* matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1)
*
* def setValuesBlockedLocalIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<<
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_225setValuesBlockedLocalIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_224setValuesBlockedLocalIJV[] = "Mat.setValuesBlockedLocalIJV(self, I, J, V, addv=None, rowmap=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_225setValuesBlockedLocalIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setValuesBlockedLocalIJV (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,&__pyx_n_s_rowmap,0};
PyObject* values[5] = {0,0,0,0,0};
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalIJV", 0, 3, 5, 1); __PYX_ERR(45, 1100, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalIJV", 0, 3, 5, 2); __PYX_ERR(45, 1100, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowmap);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedLocalIJV") < 0)) __PYX_ERR(45, 1100, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_I = values[0];
__pyx_v_J = values[1];
__pyx_v_V = values[2];
__pyx_v_addv = values[3];
__pyx_v_rowmap = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalIJV", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1100, __pyx_L3_error)
__pyx_L3_error:;
__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_224setValuesBlockedLocalIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_224setValuesBlockedLocalIJV(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":1101
*
* def setValuesBlockedLocalIJV(self, I, J, V, addv=None, rowmap=None):
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1) # <<<<<<<<<<<<<<
*
* def setValuesBlockedLocalCSR(self, I, J, V, addv=None):
*/
__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(45, 1101, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1100
* matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1)
*
* def setValuesBlockedLocalIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<<
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1)
*
*/
/* 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":1103
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1)
*
* def setValuesBlockedLocalCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<<
* matsetvalues_csr(self.mat, I, J, V, addv, 1, 1)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_227setValuesBlockedLocalCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_226setValuesBlockedLocalCSR[] = "Mat.setValuesBlockedLocalCSR(self, I, J, V, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_227setValuesBlockedLocalCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_I = 0;
PyObject *__pyx_v_J = 0;
PyObject *__pyx_v_V = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalCSR", 0, 3, 4, 1); __PYX_ERR(45, 1103, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalCSR", 0, 3, 4, 2); __PYX_ERR(45, 1103, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedLocalCSR") < 0)) __PYX_ERR(45, 1103, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_I = values[0];
__pyx_v_J = values[1];
__pyx_v_V = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalCSR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1103, __pyx_L3_error)
__pyx_L3_error:;
__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_226setValuesBlockedLocalCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_226setValuesBlockedLocalCSR(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":1104
*
* def setValuesBlockedLocalCSR(self, I, J, V, addv=None):
* 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(45, 1104, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1103
* matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1)
*
* def setValuesBlockedLocalCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<<
* matsetvalues_csr(self.mat, I, J, 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.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":1110
* Stencil = _Mat_Stencil
*
* def setStencil(self, dims, starts=None, dof=1): # <<<<<<<<<<<<<<
* cdef PetscInt ndim, ndof
* cdef PetscInt cdims[3], cstarts[3]
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_229setStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_228setStencil[] = "Mat.setStencil(self, dims, starts=None, dof=1)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_229setStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_dims = 0;
PyObject *__pyx_v_starts = 0;
PyObject *__pyx_v_dof = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dims,&__pyx_n_s_starts,&__pyx_n_s_dof,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)__pyx_int_1);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dims)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_starts);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dof);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setStencil") < 0)) __PYX_ERR(45, 1110, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_dims = values[0];
__pyx_v_starts = values[1];
__pyx_v_dof = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setStencil", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1110, __pyx_L3_error)
__pyx_L3_error:;
__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_228setStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_dims, __pyx_v_starts, __pyx_v_dof);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_228setStencil(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;
int __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setStencil", 0);
/* "petsc4py/PETSc/Mat.pyx":1113
* 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":1114
* 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":1115
* 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(45, 1115, __pyx_L1_error)
__pyx_v_ndim = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1116
* 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(45, 1116, __pyx_L1_error)
__pyx_v_ndof = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1117
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":1118
* 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(45, 1118, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1117
* 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":1119
* if starts is not None:
* asDims(dims, &cstarts[0], &cstarts[1], &cstarts[2])
* CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) ) # <<<<<<<<<<<<<<
*
* def setValueStencil(self, row, col, value, addv=None):
*/
__pyx_t_4 = __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_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1119, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1110
* Stencil = _Mat_Stencil
*
* def setStencil(self, dims, starts=None, dof=1): # <<<<<<<<<<<<<<
* cdef PetscInt ndim, ndof
* cdef PetscInt cdims[3], cstarts[3]
*/
/* 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":1121
* CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) )
*
* def setValueStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<<
* cdef _Mat_Stencil r = row, c = col
* cdef PetscInsertMode im = insertmode(addv)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_231setValueStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_230setValueStencil[] = "Mat.setValueStencil(self, row, col, value, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_231setValueStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_row = 0;
PyObject *__pyx_v_col = 0;
PyObject *__pyx_v_value = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValueStencil", 0, 3, 4, 1); __PYX_ERR(45, 1121, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValueStencil", 0, 3, 4, 2); __PYX_ERR(45, 1121, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValueStencil") < 0)) __PYX_ERR(45, 1121, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_row = values[0];
__pyx_v_col = values[1];
__pyx_v_value = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValueStencil", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1121, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueStencil", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_230setValueStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_230setValueStencil(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__Mat_Stencil *__pyx_v_r = 0;
struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__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("setValueStencil", 0);
/* "petsc4py/PETSc/Mat.pyx":1122
*
* def setValueStencil(self, row, col, value, addv=None):
* cdef _Mat_Stencil r = row, c = col # <<<<<<<<<<<<<<
* cdef PetscInsertMode im = insertmode(addv)
* matsetvaluestencil(self.mat, r, c, value, im, 0)
*/
if (!(likely(((__pyx_v_row) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_row, __pyx_ptype_8petsc4py_5PETSc__Mat_Stencil))))) __PYX_ERR(45, 1122, __pyx_L1_error)
__pyx_t_1 = __pyx_v_row;
__Pyx_INCREF(__pyx_t_1);
__pyx_v_r = ((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_t_1);
__pyx_t_1 = 0;
if (!(likely(((__pyx_v_col) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_col, __pyx_ptype_8petsc4py_5PETSc__Mat_Stencil))))) __PYX_ERR(45, 1122, __pyx_L1_error)
__pyx_t_1 = __pyx_v_col;
__Pyx_INCREF(__pyx_t_1);
__pyx_v_c = ((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1123
* def setValueStencil(self, row, col, value, addv=None):
* cdef _Mat_Stencil r = row, c = col
* cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<<
* matsetvaluestencil(self.mat, r, c, value, im, 0)
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_2 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(45, 1123, __pyx_L1_error)
__pyx_v_im = __pyx_t_2;
/* "petsc4py/PETSc/Mat.pyx":1124
* cdef _Mat_Stencil 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):
*/
__pyx_t_1 = __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_1)) __PYX_ERR(45, 1124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1121
* CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) )
*
* def setValueStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<<
* cdef _Mat_Stencil r = row, c = col
* cdef PetscInsertMode im = insertmode(addv)
*/
/* 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.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":1126
* matsetvaluestencil(self.mat, r, c, value, im, 0)
*
* def setValueStagStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<<
* raise NotImplementedError('setValueStagStencil not yet implemented in petsc4py')
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_233setValueStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_232setValueStagStencil[] = "Mat.setValueStagStencil(self, row, col, value, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_233setValueStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setValueStagStencil (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValueStagStencil", 0, 3, 4, 1); __PYX_ERR(45, 1126, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValueStagStencil", 0, 3, 4, 2); __PYX_ERR(45, 1126, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValueStagStencil") < 0)) __PYX_ERR(45, 1126, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_row = values[0];
__pyx_v_col = values[1];
__pyx_v_value = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValueStagStencil", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1126, __pyx_L3_error)
__pyx_L3_error:;
__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_232setValueStagStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_232setValueStagStencil(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
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setValueStagStencil", 0);
/* "petsc4py/PETSc/Mat.pyx":1127
*
* def setValueStagStencil(self, row, col, value, addv=None):
* raise NotImplementedError('setValueStagStencil not yet implemented in petsc4py') # <<<<<<<<<<<<<<
*
* def setValueBlockedStencil(self, row, col, value, addv=None):
*/
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1127, __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(45, 1127, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1126
* matsetvaluestencil(self.mat, r, c, value, im, 0)
*
* def setValueStagStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<<
* raise NotImplementedError('setValueStagStencil not yet implemented in petsc4py')
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__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":1129
* raise NotImplementedError('setValueStagStencil not yet implemented in petsc4py')
*
* def setValueBlockedStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<<
* cdef _Mat_Stencil r = row, c = col
* cdef PetscInsertMode im = insertmode(addv)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_235setValueBlockedStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_234setValueBlockedStencil[] = "Mat.setValueBlockedStencil(self, row, col, value, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_235setValueBlockedStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_row = 0;
PyObject *__pyx_v_col = 0;
PyObject *__pyx_v_value = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValueBlockedStencil", 0, 3, 4, 1); __PYX_ERR(45, 1129, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValueBlockedStencil", 0, 3, 4, 2); __PYX_ERR(45, 1129, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValueBlockedStencil") < 0)) __PYX_ERR(45, 1129, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_row = values[0];
__pyx_v_col = values[1];
__pyx_v_value = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValueBlockedStencil", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1129, __pyx_L3_error)
__pyx_L3_error:;
__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_234setValueBlockedStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_234setValueBlockedStencil(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__Mat_Stencil *__pyx_v_r = 0;
struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__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":1130
*
* def setValueBlockedStencil(self, row, col, value, addv=None):
* cdef _Mat_Stencil r = row, c = col # <<<<<<<<<<<<<<
* cdef PetscInsertMode im = insertmode(addv)
* matsetvaluestencil(self.mat, r, c, value, im, 1)
*/
if (!(likely(((__pyx_v_row) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_row, __pyx_ptype_8petsc4py_5PETSc__Mat_Stencil))))) __PYX_ERR(45, 1130, __pyx_L1_error)
__pyx_t_1 = __pyx_v_row;
__Pyx_INCREF(__pyx_t_1);
__pyx_v_r = ((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_t_1);
__pyx_t_1 = 0;
if (!(likely(((__pyx_v_col) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_col, __pyx_ptype_8petsc4py_5PETSc__Mat_Stencil))))) __PYX_ERR(45, 1130, __pyx_L1_error)
__pyx_t_1 = __pyx_v_col;
__Pyx_INCREF(__pyx_t_1);
__pyx_v_c = ((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1131
* def setValueBlockedStencil(self, row, col, value, addv=None):
* cdef _Mat_Stencil 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(45, 1131, __pyx_L1_error)
__pyx_v_im = __pyx_t_2;
/* "petsc4py/PETSc/Mat.pyx":1132
* cdef _Mat_Stencil 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):
*/
__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(45, 1132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1129
* raise NotImplementedError('setValueStagStencil not yet implemented in petsc4py')
*
* def setValueBlockedStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<<
* cdef _Mat_Stencil r = row, c = col
* cdef PetscInsertMode im = insertmode(addv)
*/
/* 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":1134
* matsetvaluestencil(self.mat, r, c, value, im, 1)
*
* def setValueBlockedStagStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<<
* raise NotImplementedError('setValueBlockedStagStencil not yet implemented in petsc4py')
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_237setValueBlockedStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_236setValueBlockedStagStencil[] = "Mat.setValueBlockedStagStencil(self, row, col, value, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_237setValueBlockedStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setValueBlockedStagStencil (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValueBlockedStagStencil", 0, 3, 4, 1); __PYX_ERR(45, 1134, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setValueBlockedStagStencil", 0, 3, 4, 2); __PYX_ERR(45, 1134, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValueBlockedStagStencil") < 0)) __PYX_ERR(45, 1134, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_row = values[0];
__pyx_v_col = values[1];
__pyx_v_value = values[2];
__pyx_v_addv = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setValueBlockedStagStencil", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1134, __pyx_L3_error)
__pyx_L3_error:;
__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_236setValueBlockedStagStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_236setValueBlockedStagStencil(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
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setValueBlockedStagStencil", 0);
/* "petsc4py/PETSc/Mat.pyx":1135
*
* def setValueBlockedStagStencil(self, row, col, value, addv=None):
* raise NotImplementedError('setValueBlockedStagStencil not yet implemented in petsc4py') # <<<<<<<<<<<<<<
*
* def zeroRows(self, rows, diag=1, Vec x=None, Vec b=None):
*/
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1135, __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(45, 1135, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1134
* matsetvaluestencil(self.mat, r, c, value, im, 1)
*
* def setValueBlockedStagStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<<
* raise NotImplementedError('setValueBlockedStagStencil not yet implemented in petsc4py')
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__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":1137
* raise NotImplementedError('setValueBlockedStagStencil not yet implemented in petsc4py')
*
* def zeroRows(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<<
* cdef PetscInt ni=0, *i=NULL
* cdef PetscScalar sval = asScalar(diag)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_239zeroRows(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_238zeroRows[] = "Mat.zeroRows(self, rows, diag=1, Vec x=None, Vec b=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_239zeroRows(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rows = 0;
PyObject *__pyx_v_diag = 0;
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_b = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_diag,&__pyx_n_s_x,&__pyx_n_s_b,0};
PyObject* values[4] = {0,0,0,0};
values[1] = ((PyObject *)__pyx_int_1);
values[2] = (PyObject *)((struct PyPetscVecObject *)Py_None);
values[3] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_diag);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zeroRows") < 0)) __PYX_ERR(45, 1137, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_rows = values[0];
__pyx_v_diag = values[1];
__pyx_v_x = ((struct PyPetscVecObject *)values[2]);
__pyx_v_b = ((struct PyPetscVecObject *)values[3]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("zeroRows", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1137, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRows", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(45, 1137, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(45, 1137, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_238zeroRows(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_diag, __pyx_v_x, __pyx_v_b);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_238zeroRows(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;
int __pyx_t_3;
Vec __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("zeroRows", 0);
__Pyx_INCREF(__pyx_v_rows);
/* "petsc4py/PETSc/Mat.pyx":1138
*
* def zeroRows(self, rows, diag=1, Vec x=None, Vec b=None):
* 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":1139
* def zeroRows(self, rows, diag=1, Vec x=None, Vec b=None):
* cdef PetscInt ni=0, *i=NULL
* cdef PetscScalar sval = asScalar(diag) # <<<<<<<<<<<<<<
* cdef PetscVec xvec=NULL, bvec=NULL
* if x is not None: xvec = x.vec
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_diag); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(45, 1139, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1140
* 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":1141
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_4 = __pyx_v_x->vec;
__pyx_v_xvec = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":1142
* 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_3 = (((PyObject *)__pyx_v_b) != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
__pyx_t_4 = __pyx_v_b->vec;
__pyx_v_bvec = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":1143
* 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_ptype_8petsc4py_5PETSc_IS);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":1144
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1144, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1143
* 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":1146
* 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_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_rows, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 1146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/Mat.pyx":1147
* else:
* rows = iarray_i(rows, &ni, &i)
* CHKERR( MatZeroRows(self.mat, ni, i, sval, xvec, bvec) ) # <<<<<<<<<<<<<<
*
* def zeroRowsLocal(self, rows, diag=1, Vec x=None, Vec b=None):
*/
__pyx_t_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1147, __pyx_L1_error)
}
__pyx_L5:;
/* "petsc4py/PETSc/Mat.pyx":1137
* raise NotImplementedError('setValueBlockedStagStencil not yet implemented in petsc4py')
*
* def zeroRows(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<<
* cdef PetscInt ni=0, *i=NULL
* cdef PetscScalar sval = asScalar(diag)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_6);
__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":1149
* CHKERR( MatZeroRows(self.mat, ni, i, sval, xvec, bvec) )
*
* def zeroRowsLocal(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<<
* cdef PetscInt ni=0, *i=NULL
* cdef PetscScalar sval = asScalar(diag)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_241zeroRowsLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_240zeroRowsLocal[] = "Mat.zeroRowsLocal(self, rows, diag=1, Vec x=None, Vec b=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_241zeroRowsLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rows = 0;
PyObject *__pyx_v_diag = 0;
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_b = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_diag,&__pyx_n_s_x,&__pyx_n_s_b,0};
PyObject* values[4] = {0,0,0,0};
values[1] = ((PyObject *)__pyx_int_1);
values[2] = (PyObject *)((struct PyPetscVecObject *)Py_None);
values[3] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_diag);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zeroRowsLocal") < 0)) __PYX_ERR(45, 1149, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_rows = values[0];
__pyx_v_diag = values[1];
__pyx_v_x = ((struct PyPetscVecObject *)values[2]);
__pyx_v_b = ((struct PyPetscVecObject *)values[3]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("zeroRowsLocal", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1149, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsLocal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(45, 1149, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(45, 1149, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_240zeroRowsLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_diag, __pyx_v_x, __pyx_v_b);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_240zeroRowsLocal(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;
int __pyx_t_3;
Vec __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("zeroRowsLocal", 0);
__Pyx_INCREF(__pyx_v_rows);
/* "petsc4py/PETSc/Mat.pyx":1150
*
* def zeroRowsLocal(self, rows, diag=1, Vec x=None, Vec b=None):
* 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":1151
* def zeroRowsLocal(self, rows, diag=1, Vec x=None, Vec b=None):
* cdef PetscInt ni=0, *i=NULL
* cdef PetscScalar sval = asScalar(diag) # <<<<<<<<<<<<<<
* cdef PetscVec xvec=NULL, bvec=NULL
* if x is not None: xvec = x.vec
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_diag); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(45, 1151, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1152
* 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":1153
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_4 = __pyx_v_x->vec;
__pyx_v_xvec = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":1154
* 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_3 = (((PyObject *)__pyx_v_b) != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
__pyx_t_4 = __pyx_v_b->vec;
__pyx_v_bvec = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":1155
* 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_ptype_8petsc4py_5PETSc_IS);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":1156
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1156, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1155
* 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":1158
* 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_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_rows, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 1158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/Mat.pyx":1159
* else:
* rows = iarray_i(rows, &ni, &i)
* CHKERR( MatZeroRowsLocal(self.mat, ni, i, sval, xvec, bvec) ) # <<<<<<<<<<<<<<
*
* def zeroRowsColumns(self, rows, diag=1, Vec x=None, Vec b=None):
*/
__pyx_t_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1159, __pyx_L1_error)
}
__pyx_L5:;
/* "petsc4py/PETSc/Mat.pyx":1149
* CHKERR( MatZeroRows(self.mat, ni, i, sval, xvec, bvec) )
*
* def zeroRowsLocal(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<<
* cdef PetscInt ni=0, *i=NULL
* cdef PetscScalar sval = asScalar(diag)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_6);
__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":1161
* CHKERR( MatZeroRowsLocal(self.mat, ni, i, sval, xvec, bvec) )
*
* def zeroRowsColumns(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<<
* cdef PetscInt ni=0, *i=NULL
* cdef PetscScalar sval = asScalar(diag)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_243zeroRowsColumns(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_242zeroRowsColumns[] = "Mat.zeroRowsColumns(self, rows, diag=1, Vec x=None, Vec b=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_243zeroRowsColumns(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rows = 0;
PyObject *__pyx_v_diag = 0;
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_b = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_diag,&__pyx_n_s_x,&__pyx_n_s_b,0};
PyObject* values[4] = {0,0,0,0};
values[1] = ((PyObject *)__pyx_int_1);
values[2] = (PyObject *)((struct PyPetscVecObject *)Py_None);
values[3] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_diag);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zeroRowsColumns") < 0)) __PYX_ERR(45, 1161, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_rows = values[0];
__pyx_v_diag = values[1];
__pyx_v_x = ((struct PyPetscVecObject *)values[2]);
__pyx_v_b = ((struct PyPetscVecObject *)values[3]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("zeroRowsColumns", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1161, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsColumns", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(45, 1161, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(45, 1161, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_242zeroRowsColumns(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_diag, __pyx_v_x, __pyx_v_b);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_242zeroRowsColumns(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;
int __pyx_t_3;
Vec __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("zeroRowsColumns", 0);
__Pyx_INCREF(__pyx_v_rows);
/* "petsc4py/PETSc/Mat.pyx":1162
*
* def zeroRowsColumns(self, rows, diag=1, Vec x=None, Vec b=None):
* 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":1163
* def zeroRowsColumns(self, rows, diag=1, Vec x=None, Vec b=None):
* cdef PetscInt ni=0, *i=NULL
* cdef PetscScalar sval = asScalar(diag) # <<<<<<<<<<<<<<
* cdef PetscVec xvec=NULL, bvec=NULL
* if x is not None: xvec = x.vec
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_diag); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(45, 1163, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1164
* 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":1165
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_4 = __pyx_v_x->vec;
__pyx_v_xvec = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":1166
* 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_3 = (((PyObject *)__pyx_v_b) != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
__pyx_t_4 = __pyx_v_b->vec;
__pyx_v_bvec = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":1167
* 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_ptype_8petsc4py_5PETSc_IS);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":1168
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1168, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1167
* 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":1170
* 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_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_rows, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 1170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/Mat.pyx":1171
* else:
* rows = iarray_i(rows, &ni, &i)
* CHKERR( MatZeroRowsColumns(self.mat, ni, i, sval, xvec, bvec) ) # <<<<<<<<<<<<<<
*
* def zeroRowsColumnsLocal(self, rows, diag=1, Vec x=None, Vec b=None):
*/
__pyx_t_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1171, __pyx_L1_error)
}
__pyx_L5:;
/* "petsc4py/PETSc/Mat.pyx":1161
* CHKERR( MatZeroRowsLocal(self.mat, ni, i, sval, xvec, bvec) )
*
* def zeroRowsColumns(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<<
* cdef PetscInt ni=0, *i=NULL
* cdef PetscScalar sval = asScalar(diag)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_6);
__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":1173
* CHKERR( MatZeroRowsColumns(self.mat, ni, i, sval, xvec, bvec) )
*
* def zeroRowsColumnsLocal(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<<
* cdef PetscInt ni=0, *i=NULL
* cdef PetscScalar sval = asScalar(diag)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_245zeroRowsColumnsLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_244zeroRowsColumnsLocal[] = "Mat.zeroRowsColumnsLocal(self, rows, diag=1, Vec x=None, Vec b=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_245zeroRowsColumnsLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rows = 0;
PyObject *__pyx_v_diag = 0;
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_b = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_diag,&__pyx_n_s_x,&__pyx_n_s_b,0};
PyObject* values[4] = {0,0,0,0};
values[1] = ((PyObject *)__pyx_int_1);
values[2] = (PyObject *)((struct PyPetscVecObject *)Py_None);
values[3] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_diag);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zeroRowsColumnsLocal") < 0)) __PYX_ERR(45, 1173, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_rows = values[0];
__pyx_v_diag = values[1];
__pyx_v_x = ((struct PyPetscVecObject *)values[2]);
__pyx_v_b = ((struct PyPetscVecObject *)values[3]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("zeroRowsColumnsLocal", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1173, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsColumnsLocal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(45, 1173, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(45, 1173, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_244zeroRowsColumnsLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_diag, __pyx_v_x, __pyx_v_b);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_244zeroRowsColumnsLocal(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;
int __pyx_t_3;
Vec __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("zeroRowsColumnsLocal", 0);
__Pyx_INCREF(__pyx_v_rows);
/* "petsc4py/PETSc/Mat.pyx":1174
*
* def zeroRowsColumnsLocal(self, rows, diag=1, Vec x=None, Vec b=None):
* 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":1175
* def zeroRowsColumnsLocal(self, rows, diag=1, Vec x=None, Vec b=None):
* cdef PetscInt ni=0, *i=NULL
* cdef PetscScalar sval = asScalar(diag) # <<<<<<<<<<<<<<
* cdef PetscVec xvec=NULL, bvec=NULL
* if x is not None: xvec = x.vec
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_diag); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(45, 1175, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1176
* 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":1177
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_4 = __pyx_v_x->vec;
__pyx_v_xvec = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":1178
* 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_3 = (((PyObject *)__pyx_v_b) != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
__pyx_t_4 = __pyx_v_b->vec;
__pyx_v_bvec = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":1179
* 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_ptype_8petsc4py_5PETSc_IS);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":1180
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1180, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1179
* 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":1182
* 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_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_rows, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 1182, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_6);
__pyx_t_6 = 0;
/* "petsc4py/PETSc/Mat.pyx":1183
* else:
* rows = iarray_i(rows, &ni, &i)
* CHKERR( MatZeroRowsColumnsLocal(self.mat, ni, i, sval, xvec, bvec) ) # <<<<<<<<<<<<<<
*
* def zeroRowsColumnsStencil(self, rows, diag=1, Vec x=None, Vec b=None):
*/
__pyx_t_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1183, __pyx_L1_error)
}
__pyx_L5:;
/* "petsc4py/PETSc/Mat.pyx":1173
* CHKERR( MatZeroRowsColumns(self.mat, ni, i, sval, xvec, bvec) )
*
* def zeroRowsColumnsLocal(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<<
* cdef PetscInt ni=0, *i=NULL
* cdef PetscScalar sval = asScalar(diag)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_6);
__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":1185
* CHKERR( MatZeroRowsColumnsLocal(self.mat, ni, i, sval, xvec, bvec) )
*
* def zeroRowsColumnsStencil(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(diag)
* cdef PetscInt nrows = asInt(len(rows))
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_247zeroRowsColumnsStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_246zeroRowsColumnsStencil[] = "Mat.zeroRowsColumnsStencil(self, rows, diag=1, Vec x=None, Vec b=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_247zeroRowsColumnsStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rows = 0;
PyObject *__pyx_v_diag = 0;
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_b = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_diag,&__pyx_n_s_x,&__pyx_n_s_b,0};
PyObject* values[4] = {0,0,0,0};
values[1] = ((PyObject *)__pyx_int_1);
values[2] = (PyObject *)((struct PyPetscVecObject *)Py_None);
values[3] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_diag);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zeroRowsColumnsStencil") < 0)) __PYX_ERR(45, 1185, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_rows = values[0];
__pyx_v_diag = values[1];
__pyx_v_x = ((struct PyPetscVecObject *)values[2]);
__pyx_v_b = ((struct PyPetscVecObject *)values[3]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("zeroRowsColumnsStencil", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1185, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsColumnsStencil", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(45, 1185, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(45, 1185, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_246zeroRowsColumnsStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_diag, __pyx_v_x, __pyx_v_b);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_246zeroRowsColumnsStencil(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b) {
PetscScalar __pyx_v_sval;
PetscInt __pyx_v_nrows;
CYTHON_UNUSED MatStencil __pyx_v_st;
struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_r = 0;
MatStencil *__pyx_v_crows;
PetscInt __pyx_v_i;
Vec __pyx_v_xvec;
Vec __pyx_v_bvec;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscScalar __pyx_t_1;
Py_ssize_t __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscInt __pyx_t_4;
PetscErrorCode __pyx_t_5;
PetscInt __pyx_t_6;
PetscInt __pyx_t_7;
MatStencil __pyx_t_8;
int __pyx_t_9;
int __pyx_t_10;
Vec __pyx_t_11;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("zeroRowsColumnsStencil", 0);
/* "petsc4py/PETSc/Mat.pyx":1186
*
* def zeroRowsColumnsStencil(self, rows, diag=1, Vec x=None, Vec b=None):
* cdef PetscScalar sval = asScalar(diag) # <<<<<<<<<<<<<<
* cdef PetscInt nrows = asInt(len(rows))
* cdef PetscMatStencil st
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_diag); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(45, 1186, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1187
* def zeroRowsColumnsStencil(self, rows, diag=1, Vec x=None, Vec b=None):
* cdef PetscScalar sval = asScalar(diag)
* cdef PetscInt nrows = asInt(len(rows)) # <<<<<<<<<<<<<<
* cdef PetscMatStencil st
* cdef _Mat_Stencil r
*/
__pyx_t_2 = PyObject_Length(__pyx_v_rows); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(45, 1187, __pyx_L1_error)
__pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1187, __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(45, 1187, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_nrows = __pyx_t_4;
/* "petsc4py/PETSc/Mat.pyx":1190
* cdef PetscMatStencil st
* cdef _Mat_Stencil r
* cdef PetscMatStencil *crows = NULL # <<<<<<<<<<<<<<
* CHKERR( PetscMalloc(<size_t>(nrows+1)*sizeof(st), &crows) )
* for i in range(nrows):
*/
__pyx_v_crows = NULL;
/* "petsc4py/PETSc/Mat.pyx":1191
* cdef _Mat_Stencil r
* cdef PetscMatStencil *crows = NULL
* CHKERR( PetscMalloc(<size_t>(nrows+1)*sizeof(st), &crows) ) # <<<<<<<<<<<<<<
* for i in range(nrows):
* r = rows[i]
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)(__pyx_v_nrows + 1)) * (sizeof(__pyx_v_st))), (&__pyx_v_crows))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1191, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1192
* cdef PetscMatStencil *crows = NULL
* CHKERR( PetscMalloc(<size_t>(nrows+1)*sizeof(st), &crows) )
* for i in range(nrows): # <<<<<<<<<<<<<<
* r = rows[i]
* crows[i] = r.stencil
*/
__pyx_t_4 = __pyx_v_nrows;
__pyx_t_6 = __pyx_t_4;
for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
__pyx_v_i = __pyx_t_7;
/* "petsc4py/PETSc/Mat.pyx":1193
* CHKERR( PetscMalloc(<size_t>(nrows+1)*sizeof(st), &crows) )
* for i in range(nrows):
* r = rows[i] # <<<<<<<<<<<<<<
* crows[i] = r.stencil
* cdef PetscVec xvec = NULL, bvec = NULL
*/
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_rows, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc__Mat_Stencil))))) __PYX_ERR(45, 1193, __pyx_L1_error)
__Pyx_XDECREF_SET(__pyx_v_r, ((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_t_3));
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1194
* for i in range(nrows):
* r = rows[i]
* crows[i] = r.stencil # <<<<<<<<<<<<<<
* cdef PetscVec xvec = NULL, bvec = NULL
* if x is not None: xvec = x.vec
*/
__pyx_t_8 = __pyx_v_r->stencil;
(__pyx_v_crows[__pyx_v_i]) = __pyx_t_8;
}
/* "petsc4py/PETSc/Mat.pyx":1195
* r = rows[i]
* crows[i] = r.stencil
* cdef PetscVec xvec = NULL, bvec = NULL # <<<<<<<<<<<<<<
* if x is not None: xvec = x.vec
* if b is not None: bvec = b.vec
*/
__pyx_v_xvec = NULL;
__pyx_v_bvec = NULL;
/* "petsc4py/PETSc/Mat.pyx":1196
* crows[i] = r.stencil
* cdef PetscVec xvec = NULL, bvec = NULL
* if x is not None: xvec = x.vec # <<<<<<<<<<<<<<
* if b is not None: bvec = b.vec
* CHKERR( MatZeroRowsColumnsStencil(self.mat, nrows, crows, sval, xvec, bvec) )
*/
__pyx_t_9 = (((PyObject *)__pyx_v_x) != Py_None);
__pyx_t_10 = (__pyx_t_9 != 0);
if (__pyx_t_10) {
__pyx_t_11 = __pyx_v_x->vec;
__pyx_v_xvec = __pyx_t_11;
}
/* "petsc4py/PETSc/Mat.pyx":1197
* 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_10 = (((PyObject *)__pyx_v_b) != Py_None);
__pyx_t_9 = (__pyx_t_10 != 0);
if (__pyx_t_9) {
__pyx_t_11 = __pyx_v_b->vec;
__pyx_v_bvec = __pyx_t_11;
}
/* "petsc4py/PETSc/Mat.pyx":1198
* 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(45, 1198, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1199
* if b is not None: bvec = b.vec
* CHKERR( MatZeroRowsColumnsStencil(self.mat, nrows, crows, sval, xvec, bvec) )
* CHKERR( PetscFree( crows ) ) # <<<<<<<<<<<<<<
*
* def storeValues(self):
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_crows)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1199, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1185
* CHKERR( MatZeroRowsColumnsLocal(self.mat, ni, i, sval, xvec, bvec) )
*
* def zeroRowsColumnsStencil(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(diag)
* cdef PetscInt nrows = asInt(len(rows))
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsColumnsStencil", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_r);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1201
* CHKERR( PetscFree( crows ) )
*
* def storeValues(self): # <<<<<<<<<<<<<<
* CHKERR( MatStoreValues(self.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_249storeValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_248storeValues[] = "Mat.storeValues(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_249storeValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("storeValues (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("storeValues", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "storeValues", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_248storeValues(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_248storeValues(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":1202
*
* def storeValues(self):
* CHKERR( MatStoreValues(self.mat) ) # <<<<<<<<<<<<<<
*
* def retrieveValues(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatStoreValues(__pyx_v_self->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1202, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1201
* CHKERR( PetscFree( crows ) )
*
* def storeValues(self): # <<<<<<<<<<<<<<
* CHKERR( MatStoreValues(self.mat) )
*
*/
/* 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":1204
* CHKERR( MatStoreValues(self.mat) )
*
* def retrieveValues(self): # <<<<<<<<<<<<<<
* CHKERR( MatRetrieveValues(self.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_251retrieveValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_250retrieveValues[] = "Mat.retrieveValues(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_251retrieveValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("retrieveValues (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("retrieveValues", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "retrieveValues", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_250retrieveValues(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_250retrieveValues(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":1205
*
* def retrieveValues(self):
* CHKERR( MatRetrieveValues(self.mat) ) # <<<<<<<<<<<<<<
*
* def assemblyBegin(self, assembly=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(45, 1205, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1204
* CHKERR( MatStoreValues(self.mat) )
*
* def retrieveValues(self): # <<<<<<<<<<<<<<
* CHKERR( MatRetrieveValues(self.mat) )
*
*/
/* 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":1207
* CHKERR( MatRetrieveValues(self.mat) )
*
* def assemblyBegin(self, assembly=None): # <<<<<<<<<<<<<<
* cdef PetscMatAssemblyType flag = assemblytype(assembly)
* CHKERR( MatAssemblyBegin(self.mat, flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_253assemblyBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_252assemblyBegin[] = "Mat.assemblyBegin(self, assembly=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_253assemblyBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_assembly = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_assembly,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_assembly);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assemblyBegin") < 0)) __PYX_ERR(45, 1207, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_assembly = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("assemblyBegin", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1207, __pyx_L3_error)
__pyx_L3_error:;
__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_252assemblyBegin(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_assembly);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_252assemblyBegin(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":1208
*
* def assemblyBegin(self, assembly=None):
* 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(45, 1208, __pyx_L1_error)
__pyx_v_flag = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1209
* def assemblyBegin(self, assembly=None):
* cdef PetscMatAssemblyType flag = assemblytype(assembly)
* CHKERR( MatAssemblyBegin(self.mat, flag) ) # <<<<<<<<<<<<<<
*
* def assemblyEnd(self, assembly=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(45, 1209, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1207
* CHKERR( MatRetrieveValues(self.mat) )
*
* def assemblyBegin(self, assembly=None): # <<<<<<<<<<<<<<
* cdef PetscMatAssemblyType flag = assemblytype(assembly)
* CHKERR( MatAssemblyBegin(self.mat, flag) )
*/
/* 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":1211
* CHKERR( MatAssemblyBegin(self.mat, flag) )
*
* def assemblyEnd(self, assembly=None): # <<<<<<<<<<<<<<
* cdef PetscMatAssemblyType flag = assemblytype(assembly)
* CHKERR( MatAssemblyEnd(self.mat, flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_255assemblyEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_254assemblyEnd[] = "Mat.assemblyEnd(self, assembly=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_255assemblyEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_assembly = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_assembly,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_assembly);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assemblyEnd") < 0)) __PYX_ERR(45, 1211, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_assembly = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("assemblyEnd", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1211, __pyx_L3_error)
__pyx_L3_error:;
__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_254assemblyEnd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_assembly);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_254assemblyEnd(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":1212
*
* def assemblyEnd(self, assembly=None):
* 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(45, 1212, __pyx_L1_error)
__pyx_v_flag = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1213
* def assemblyEnd(self, assembly=None):
* cdef PetscMatAssemblyType flag = assemblytype(assembly)
* CHKERR( MatAssemblyEnd(self.mat, flag) ) # <<<<<<<<<<<<<<
*
* def assemble(self, assembly=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(45, 1213, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1211
* CHKERR( MatAssemblyBegin(self.mat, flag) )
*
* def assemblyEnd(self, assembly=None): # <<<<<<<<<<<<<<
* cdef PetscMatAssemblyType flag = assemblytype(assembly)
* CHKERR( MatAssemblyEnd(self.mat, flag) )
*/
/* 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":1215
* CHKERR( MatAssemblyEnd(self.mat, flag) )
*
* def assemble(self, assembly=None): # <<<<<<<<<<<<<<
* cdef PetscMatAssemblyType flag = assemblytype(assembly)
* CHKERR( MatAssemblyBegin(self.mat, flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_257assemble(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_256assemble[] = "Mat.assemble(self, assembly=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_257assemble(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_assembly = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_assembly,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_assembly);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assemble") < 0)) __PYX_ERR(45, 1215, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_assembly = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("assemble", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1215, __pyx_L3_error)
__pyx_L3_error:;
__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_256assemble(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_assembly);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_256assemble(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":1216
*
* def assemble(self, assembly=None):
* 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(45, 1216, __pyx_L1_error)
__pyx_v_flag = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1217
* def assemble(self, assembly=None):
* 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(45, 1217, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1218
* cdef PetscMatAssemblyType flag = assemblytype(assembly)
* CHKERR( MatAssemblyBegin(self.mat, flag) )
* CHKERR( MatAssemblyEnd(self.mat, flag) ) # <<<<<<<<<<<<<<
*
* def isAssembled(self):
*/
__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(45, 1218, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1215
* CHKERR( MatAssemblyEnd(self.mat, flag) )
*
* def assemble(self, assembly=None): # <<<<<<<<<<<<<<
* cdef PetscMatAssemblyType flag = assemblytype(assembly)
* CHKERR( MatAssemblyBegin(self.mat, flag) )
*/
/* 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":1220
* CHKERR( MatAssemblyEnd(self.mat, flag) )
*
* def isAssembled(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatAssembled(self.mat, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_259isAssembled(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_258isAssembled[] = "Mat.isAssembled(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_259isAssembled(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isAssembled (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("isAssembled", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isAssembled", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_258isAssembled(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_258isAssembled(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":1221
*
* def isAssembled(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( MatAssembled(self.mat, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/Mat.pyx":1222
* def isAssembled(self):
* 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(45, 1222, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1223
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatAssembled(self.mat, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def findZeroRows(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1223, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1220
* CHKERR( MatAssemblyEnd(self.mat, flag) )
*
* def isAssembled(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatAssembled(self.mat, &flag) )
*/
/* 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":1225
* return toBool(flag)
*
* def findZeroRows(self): # <<<<<<<<<<<<<<
* cdef IS zerorows = IS()
* CHKERR( MatFindZeroRows(self.mat, &zerorows.iset) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_261findZeroRows(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_260findZeroRows[] = "Mat.findZeroRows(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_261findZeroRows(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("findZeroRows (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("findZeroRows", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "findZeroRows", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_260findZeroRows(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_260findZeroRows(struct PyPetscMatObject *__pyx_v_self) {
struct PyPetscISObject *__pyx_v_zerorows = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("findZeroRows", 0);
/* "petsc4py/PETSc/Mat.pyx":1226
*
* def findZeroRows(self):
* cdef IS zerorows = IS() # <<<<<<<<<<<<<<
* CHKERR( MatFindZeroRows(self.mat, &zerorows.iset) )
* return zerorows
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_zerorows = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1227
* def findZeroRows(self):
* cdef IS zerorows = IS()
* CHKERR( MatFindZeroRows(self.mat, &zerorows.iset) ) # <<<<<<<<<<<<<<
* return zerorows
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatFindZeroRows(__pyx_v_self->mat, (&__pyx_v_zerorows->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1227, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1228
* cdef IS zerorows = IS()
* CHKERR( MatFindZeroRows(self.mat, &zerorows.iset) )
* return zerorows # <<<<<<<<<<<<<<
*
* def createVecs(self, side=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_zerorows));
__pyx_r = ((PyObject *)__pyx_v_zerorows);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1225
* return toBool(flag)
*
* def findZeroRows(self): # <<<<<<<<<<<<<<
* cdef IS zerorows = IS()
* CHKERR( MatFindZeroRows(self.mat, &zerorows.iset) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.findZeroRows", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_zerorows);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1230
* return zerorows
*
* def createVecs(self, side=None): # <<<<<<<<<<<<<<
* cdef Vec vecr, vecl
* if side is None:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_263createVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_262createVecs[] = "Mat.createVecs(self, side=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_263createVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_side = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_side,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_side);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createVecs") < 0)) __PYX_ERR(45, 1230, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_side = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createVecs", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1230, __pyx_L3_error)
__pyx_L3_error:;
__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_262createVecs(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_side);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_262createVecs(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;
int __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("createVecs", 0);
/* "petsc4py/PETSc/Mat.pyx":1232
* def createVecs(self, side=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1233
* 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 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_vecr = ((struct PyPetscVecObject *)__pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_vecl = ((struct PyPetscVecObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1234
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, (&__pyx_v_vecr->vec), (&__pyx_v_vecl->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1234, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1235
* 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_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_vecr));
__Pyx_GIVEREF(((PyObject *)__pyx_v_vecr));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_vecr));
__Pyx_INCREF(((PyObject *)__pyx_v_vecl));
__Pyx_GIVEREF(((PyObject *)__pyx_v_vecl));
PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_vecl));
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1232
* def createVecs(self, side=None):
* cdef Vec vecr, vecl
* if side is None: # <<<<<<<<<<<<<<
* vecr = Vec(); vecl = Vec();
* CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) )
*/
}
/* "petsc4py/PETSc/Mat.pyx":1236
* 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_3 = __pyx_v_side;
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1236, __pyx_L1_error)
if (!__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_R, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1236, __pyx_L1_error)
if (!__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_right, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1236, __pyx_L1_error)
if (!__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_Right, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1236, __pyx_L1_error)
if (!__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_RIGHT, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1236, __pyx_L1_error)
__pyx_t_2 = __pyx_t_1;
__pyx_L4_bool_binop_done:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Mat.pyx":1237
* 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 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_vecr = ((struct PyPetscVecObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1238
* 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_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(45, 1238, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1239
* 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":1236
* 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":1240
* 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_3 = __pyx_v_side;
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_l, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(45, 1240, __pyx_L1_error)
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L9_bool_binop_done;
}
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_L, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(45, 1240, __pyx_L1_error)
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L9_bool_binop_done;
}
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(45, 1240, __pyx_L1_error)
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L9_bool_binop_done;
}
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_Left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(45, 1240, __pyx_L1_error)
if (!__pyx_t_2) {
} else {
__pyx_t_1 = __pyx_t_2;
goto __pyx_L9_bool_binop_done;
}
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_LEFT, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(45, 1240, __pyx_L1_error)
__pyx_t_1 = __pyx_t_2;
__pyx_L9_bool_binop_done:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_2 = (__pyx_t_1 != 0);
if (likely(__pyx_t_2)) {
/* "petsc4py/PETSc/Mat.pyx":1241
* return vecr
* elif side in ('l', 'L', 'left', 'Left', 'LEFT'):
* vecl = Vec() # <<<<<<<<<<<<<<
* CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) )
* return vecl
*/
__pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1241, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_vecl = ((struct PyPetscVecObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1242
* elif side in ('l', 'L', 'left', 'Left', 'LEFT'):
* vecl = Vec()
* CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) # <<<<<<<<<<<<<<
* return vecl
* else:
*/
__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(45, 1242, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1243
* 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":1240
* 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":1245
* return vecl
* else:
* raise ValueError("side '%r' not understood" % side) # <<<<<<<<<<<<<<
*
* def createVecRight(self):
*/
/*else*/ {
__pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_side_r_not_understood, __pyx_v_side); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 1245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_ERR(45, 1245, __pyx_L1_error)
}
/* "petsc4py/PETSc/Mat.pyx":1230
* return zerorows
*
* def createVecs(self, side=None): # <<<<<<<<<<<<<<
* cdef Vec vecr, vecl
* if side is None:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createVecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_vecr);
__Pyx_XDECREF((PyObject *)__pyx_v_vecl);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1247
* raise ValueError("side '%r' not understood" % side)
*
* def createVecRight(self): # <<<<<<<<<<<<<<
* cdef Vec vecr = Vec()
* CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_265createVecRight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_264createVecRight[] = "Mat.createVecRight(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_265createVecRight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createVecRight (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("createVecRight", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createVecRight", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_264createVecRight(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_264createVecRight(struct PyPetscMatObject *__pyx_v_self) {
struct PyPetscVecObject *__pyx_v_vecr = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createVecRight", 0);
/* "petsc4py/PETSc/Mat.pyx":1248
*
* def createVecRight(self):
* cdef Vec vecr = Vec() # <<<<<<<<<<<<<<
* CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) )
* return vecr
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_vecr = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1249
* def createVecRight(self):
* cdef Vec vecr = Vec()
* CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) # <<<<<<<<<<<<<<
* return vecr
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, (&__pyx_v_vecr->vec), NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1249, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1250
* cdef Vec vecr = Vec()
* CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) )
* return vecr # <<<<<<<<<<<<<<
*
* def createVecLeft(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_vecr));
__pyx_r = ((PyObject *)__pyx_v_vecr);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1247
* raise ValueError("side '%r' not understood" % side)
*
* def createVecRight(self): # <<<<<<<<<<<<<<
* cdef Vec vecr = Vec()
* CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createVecRight", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_vecr);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1252
* return vecr
*
* def createVecLeft(self): # <<<<<<<<<<<<<<
* cdef Vec vecl = Vec()
* CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_267createVecLeft(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_266createVecLeft[] = "Mat.createVecLeft(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_267createVecLeft(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("createVecLeft (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("createVecLeft", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createVecLeft", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_266createVecLeft(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_266createVecLeft(struct PyPetscMatObject *__pyx_v_self) {
struct PyPetscVecObject *__pyx_v_vecl = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("createVecLeft", 0);
/* "petsc4py/PETSc/Mat.pyx":1253
*
* def createVecLeft(self):
* cdef Vec vecl = Vec() # <<<<<<<<<<<<<<
* CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) )
* return vecl
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_vecl = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1254
* def createVecLeft(self):
* cdef Vec vecl = Vec()
* CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) # <<<<<<<<<<<<<<
* return vecl
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_vecl->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1254, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1255
* 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":1252
* return vecr
*
* def createVecLeft(self): # <<<<<<<<<<<<<<
* cdef Vec vecl = Vec()
* CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createVecLeft", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_vecl);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1263
* #
*
* def getColumnVector(self, column, Vec result=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(column)
* if result is None:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_269getColumnVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_268getColumnVector[] = "Mat.getColumnVector(self, column, Vec result=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_269getColumnVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_column = 0;
struct PyPetscVecObject *__pyx_v_result = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_column,&__pyx_n_s_result,0};
PyObject* values[2] = {0,0};
values[1] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_column)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getColumnVector") < 0)) __PYX_ERR(45, 1263, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_column = values[0];
__pyx_v_result = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getColumnVector", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1263, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getColumnVector", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(45, 1263, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_268getColumnVector(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_column, __pyx_v_result);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_268getColumnVector(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;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PetscErrorCode __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getColumnVector", 0);
__Pyx_INCREF((PyObject *)__pyx_v_result);
/* "petsc4py/PETSc/Mat.pyx":1264
*
* def getColumnVector(self, column, Vec result=None):
* 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(45, 1264, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1265
* def getColumnVector(self, column, Vec result=None):
* cdef PetscInt ival = asInt(column)
* if result is None: # <<<<<<<<<<<<<<
* result = Vec()
* if result.vec == NULL:
*/
__pyx_t_2 = (((PyObject *)__pyx_v_result) == Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":1266
* 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 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 1266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_4));
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Mat.pyx":1265
* def getColumnVector(self, column, Vec result=None):
* cdef PetscInt ival = asInt(column)
* if result is None: # <<<<<<<<<<<<<<
* result = Vec()
* if result.vec == NULL:
*/
}
/* "petsc4py/PETSc/Mat.pyx":1267
* 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_3 = ((__pyx_v_result->vec == NULL) != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":1268
* result = Vec()
* if result.vec == NULL:
* CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) # <<<<<<<<<<<<<<
* CHKERR( MatGetColumnVector(self.mat, result.vec, ival) )
* 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(45, 1268, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1267
* 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":1269
* if result.vec == NULL:
* CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) )
* CHKERR( MatGetColumnVector(self.mat, result.vec, ival) ) # <<<<<<<<<<<<<<
* return result
*
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetColumnVector(__pyx_v_self->mat, __pyx_v_result->vec, __pyx_v_ival)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1269, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1270
* CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) )
* CHKERR( MatGetColumnVector(self.mat, result.vec, ival) )
* return result # <<<<<<<<<<<<<<
*
* def getRedundantMatrix(self, nsubcomm, subcomm=None, Mat out=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1263
* #
*
* def getColumnVector(self, column, Vec result=None): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(column)
* if result is None:
*/
/* function exit code */
__pyx_L1_error:;
__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":1272
* return result
*
* def getRedundantMatrix(self, nsubcomm, subcomm=None, Mat out=None): # <<<<<<<<<<<<<<
* cdef PetscInt _nsubcomm = asInt(nsubcomm)
* cdef MPI_Comm _subcomm = MPI_COMM_NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_271getRedundantMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_270getRedundantMatrix[] = "Mat.getRedundantMatrix(self, nsubcomm, subcomm=None, Mat out=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_271getRedundantMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_nsubcomm = 0;
PyObject *__pyx_v_subcomm = 0;
struct PyPetscMatObject *__pyx_v_out = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsubcomm,&__pyx_n_s_subcomm,&__pyx_n_s_out,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsubcomm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subcomm);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getRedundantMatrix") < 0)) __PYX_ERR(45, 1272, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_nsubcomm = values[0];
__pyx_v_subcomm = values[1];
__pyx_v_out = ((struct PyPetscMatObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getRedundantMatrix", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1272, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getRedundantMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(45, 1272, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_270getRedundantMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nsubcomm, __pyx_v_subcomm, __pyx_v_out);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_270getRedundantMatrix(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;
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("getRedundantMatrix", 0);
__Pyx_INCREF((PyObject *)__pyx_v_out);
/* "petsc4py/PETSc/Mat.pyx":1273
*
* def getRedundantMatrix(self, nsubcomm, subcomm=None, Mat out=None):
* 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(45, 1273, __pyx_L1_error)
__pyx_v__nsubcomm = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1274
* def getRedundantMatrix(self, nsubcomm, subcomm=None, Mat out=None):
* 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":1275
* 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(45, 1275, __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(PyErr_Occurred())) __PYX_ERR(45, 1275, __pyx_L1_error)
__pyx_v__subcomm = __pyx_t_3;
}
/* "petsc4py/PETSc/Mat.pyx":1276
* 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":1277
* 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);
__pyx_t_4 = (__pyx_t_2 != 0);
if (__pyx_t_4) {
__pyx_t_5 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 1277, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF_SET(__pyx_v_out, ((struct PyPetscMatObject *)__pyx_t_5));
__pyx_t_5 = 0;
}
/* "petsc4py/PETSc/Mat.pyx":1278
* 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_4 = ((__pyx_v_out->mat != NULL) != 0);
if (__pyx_t_4) {
__pyx_v_reuse = MAT_REUSE_MATRIX;
}
/* "petsc4py/PETSc/Mat.pyx":1279
* 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_6 = __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_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1279, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1280
* 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):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_out));
__pyx_r = ((PyObject *)__pyx_v_out);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1272
* return result
*
* def getRedundantMatrix(self, nsubcomm, subcomm=None, Mat out=None): # <<<<<<<<<<<<<<
* cdef PetscInt _nsubcomm = asInt(nsubcomm)
* cdef MPI_Comm _subcomm = MPI_COMM_NULL
*/
/* function exit code */
__pyx_L1_error:;
__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":1282
* return out
*
* def getDiagonal(self, Vec result=None): # <<<<<<<<<<<<<<
* if result is None:
* result = Vec()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_273getDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_272getDiagonal[] = "Mat.getDiagonal(self, Vec result=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_273getDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_result = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getDiagonal") < 0)) __PYX_ERR(45, 1282, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_result = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getDiagonal", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1282, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(45, 1282, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_272getDiagonal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_result);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_272getDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDiagonal", 0);
__Pyx_INCREF((PyObject *)__pyx_v_result);
/* "petsc4py/PETSc/Mat.pyx":1283
*
* def getDiagonal(self, Vec result=None):
* if result is None: # <<<<<<<<<<<<<<
* result = Vec()
* if result.vec == NULL:
*/
__pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1284
* def getDiagonal(self, Vec result=None):
* if result is None:
* result = Vec() # <<<<<<<<<<<<<<
* if result.vec == NULL:
* CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) )
*/
__pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_3));
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1283
*
* def getDiagonal(self, Vec result=None):
* if result is None: # <<<<<<<<<<<<<<
* result = Vec()
* if result.vec == NULL:
*/
}
/* "petsc4py/PETSc/Mat.pyx":1285
* 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_2 = ((__pyx_v_result->vec == NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1286
* result = Vec()
* if result.vec == NULL:
* CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) # <<<<<<<<<<<<<<
* CHKERR( MatGetDiagonal(self.mat, result.vec) )
* return result
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_result->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1286, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1285
* 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":1287
* if result.vec == NULL:
* CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) )
* CHKERR( MatGetDiagonal(self.mat, result.vec) ) # <<<<<<<<<<<<<<
* return result
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetDiagonal(__pyx_v_self->mat, __pyx_v_result->vec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1287, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1288
* CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) )
* CHKERR( MatGetDiagonal(self.mat, result.vec) )
* return result # <<<<<<<<<<<<<<
*
* def getRowSum(self, Vec result=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1282
* return out
*
* def getDiagonal(self, Vec result=None): # <<<<<<<<<<<<<<
* if result is None:
* result = Vec()
*/
/* function exit code */
__pyx_L1_error:;
__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":1290
* return result
*
* def getRowSum(self, Vec result=None): # <<<<<<<<<<<<<<
* if result is None:
* result = Vec()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_275getRowSum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_274getRowSum[] = "Mat.getRowSum(self, Vec result=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_275getRowSum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_result = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getRowSum") < 0)) __PYX_ERR(45, 1290, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_result = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getRowSum", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1290, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getRowSum", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(45, 1290, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_274getRowSum(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_result);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_274getRowSum(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getRowSum", 0);
__Pyx_INCREF((PyObject *)__pyx_v_result);
/* "petsc4py/PETSc/Mat.pyx":1291
*
* def getRowSum(self, Vec result=None):
* if result is None: # <<<<<<<<<<<<<<
* result = Vec()
* if result.vec == NULL:
*/
__pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1292
* def getRowSum(self, Vec result=None):
* if result is None:
* result = Vec() # <<<<<<<<<<<<<<
* if result.vec == NULL:
* CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) )
*/
__pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_3));
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1291
*
* def getRowSum(self, Vec result=None):
* if result is None: # <<<<<<<<<<<<<<
* result = Vec()
* if result.vec == NULL:
*/
}
/* "petsc4py/PETSc/Mat.pyx":1293
* 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_2 = ((__pyx_v_result->vec == NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1294
* result = Vec()
* if result.vec == NULL:
* CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) # <<<<<<<<<<<<<<
* CHKERR( MatGetRowSum(self.mat, result.vec) )
* return result
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_result->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1294, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1293
* 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":1295
* if result.vec == NULL:
* CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) )
* CHKERR( MatGetRowSum(self.mat, result.vec) ) # <<<<<<<<<<<<<<
* return result
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetRowSum(__pyx_v_self->mat, __pyx_v_result->vec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1295, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1296
* CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) )
* CHKERR( MatGetRowSum(self.mat, result.vec) )
* return result # <<<<<<<<<<<<<<
*
* def setDiagonal(self, Vec diag, addv=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1290
* return result
*
* def getRowSum(self, Vec result=None): # <<<<<<<<<<<<<<
* if result is None:
* result = Vec()
*/
/* function exit code */
__pyx_L1_error:;
__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":1298
* return result
*
* def setDiagonal(self, Vec diag, addv=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_277setDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_276setDiagonal[] = "Mat.setDiagonal(self, Vec diag, addv=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_277setDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_diag = 0;
PyObject *__pyx_v_addv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_diag,&__pyx_n_s_addv,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_diag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDiagonal") < 0)) __PYX_ERR(45, 1298, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_diag = ((struct PyPetscVecObject *)values[0]);
__pyx_v_addv = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDiagonal", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1298, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.setDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_diag), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "diag", 0))) __PYX_ERR(45, 1298, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_276setDiagonal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_diag, __pyx_v_addv);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_276setDiagonal(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":1299
*
* def setDiagonal(self, Vec diag, addv=None):
* 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(45, 1299, __pyx_L1_error)
__pyx_v_caddv = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1300
* def setDiagonal(self, Vec diag, addv=None):
* cdef PetscInsertMode caddv = insertmode(addv)
* CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) ) # <<<<<<<<<<<<<<
*
* def diagonalScale(self, Vec L=None, Vec R=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(45, 1300, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1298
* return result
*
* def setDiagonal(self, Vec diag, addv=None): # <<<<<<<<<<<<<<
* cdef PetscInsertMode caddv = insertmode(addv)
* CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) )
*/
/* 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":1302
* CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) )
*
* def diagonalScale(self, Vec L=None, Vec R=None): # <<<<<<<<<<<<<<
* cdef PetscVec vecl=NULL, vecr=NULL
* if L is not None: vecl = L.vec
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_279diagonalScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_278diagonalScale[] = "Mat.diagonalScale(self, Vec L=None, Vec R=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_279diagonalScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_L = 0;
struct PyPetscVecObject *__pyx_v_R = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,&__pyx_n_s_R,0};
PyObject* values[2] = {0,0};
values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None);
values[1] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diagonalScale") < 0)) __PYX_ERR(45, 1302, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_L = ((struct PyPetscVecObject *)values[0]);
__pyx_v_R = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("diagonalScale", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1302, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.diagonalScale", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "L", 0))) __PYX_ERR(45, 1302, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_R), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "R", 0))) __PYX_ERR(45, 1302, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_278diagonalScale(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_L, __pyx_v_R);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_278diagonalScale(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;
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("diagonalScale", 0);
/* "petsc4py/PETSc/Mat.pyx":1303
*
* def diagonalScale(self, Vec L=None, Vec R=None):
* 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":1304
* def diagonalScale(self, Vec L=None, Vec R=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_L->vec;
__pyx_v_vecl = __pyx_t_3;
}
/* "petsc4py/PETSc/Mat.pyx":1305
* 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_2 = (((PyObject *)__pyx_v_R) != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __pyx_v_R->vec;
__pyx_v_vecr = __pyx_t_3;
}
/* "petsc4py/PETSc/Mat.pyx":1306
* 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):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDiagonalScale(__pyx_v_self->mat, __pyx_v_vecl, __pyx_v_vecr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1306, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1302
* CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) )
*
* def diagonalScale(self, Vec L=None, Vec R=None): # <<<<<<<<<<<<<<
* cdef PetscVec vecl=NULL, vecr=NULL
* if L is not None: vecl = L.vec
*/
/* 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":1308
* CHKERR( MatDiagonalScale(self.mat, vecl, vecr) )
*
* def invertBlockDiagonal(self): # <<<<<<<<<<<<<<
* cdef PetscInt bs = 0, m = 0
* cdef const PetscScalar *cibdiag = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_281invertBlockDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_280invertBlockDiagonal[] = "Mat.invertBlockDiagonal(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_281invertBlockDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("invertBlockDiagonal (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("invertBlockDiagonal", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "invertBlockDiagonal", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_280invertBlockDiagonal(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_280invertBlockDiagonal(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":1309
*
* def invertBlockDiagonal(self):
* 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":1310
* def invertBlockDiagonal(self):
* 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":1311
* 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(45, 1311, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1312
* 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(45, 1312, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1313
* 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(45, 1313, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1314
* 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(45, 1314, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_ibdiag = ((PyArrayObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Mat.pyx":1315
* 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(45, 1315, __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(45, 1315, __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(45, 1315, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 1315, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_t_4 = 0;
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ibdiag), __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(45, 1315, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/Mat.pyx":1316
* cdef ndarray ibdiag = array_s(m*bs, cibdiag)
* ibdiag.shape = (toInt(m//bs), toInt(bs), toInt(bs))
* return ibdiag.transpose(0, 2, 1) # <<<<<<<<<<<<<<
*
* # null space
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ibdiag), __pyx_n_s_transpose); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 1316, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 1316, __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":1308
* CHKERR( MatDiagonalScale(self.mat, vecl, vecr) )
*
* def invertBlockDiagonal(self): # <<<<<<<<<<<<<<
* cdef PetscInt bs = 0, m = 0
* cdef const PetscScalar *cibdiag = NULL
*/
/* 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":1320
* # null space
*
* def setNullSpace(self, NullSpace nsp): # <<<<<<<<<<<<<<
* CHKERR( MatSetNullSpace(self.mat, nsp.nsp) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_283setNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_282setNullSpace[] = "Mat.setNullSpace(self, NullSpace nsp)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_283setNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscNullSpaceObject *__pyx_v_nsp = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsp,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsp)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNullSpace") < 0)) __PYX_ERR(45, 1320, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_nsp = ((struct PyPetscNullSpaceObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setNullSpace", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1320, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.setNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nsp), __pyx_ptype_8petsc4py_5PETSc_NullSpace, 0, "nsp", 0))) __PYX_ERR(45, 1320, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_282setNullSpace(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nsp);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_282setNullSpace(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":1321
*
* def setNullSpace(self, NullSpace nsp):
* CHKERR( MatSetNullSpace(self.mat, nsp.nsp) ) # <<<<<<<<<<<<<<
*
* def getNullSpace(self):
*/
__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(45, 1321, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1320
* # null space
*
* def setNullSpace(self, NullSpace nsp): # <<<<<<<<<<<<<<
* CHKERR( MatSetNullSpace(self.mat, nsp.nsp) )
*
*/
/* 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":1323
* CHKERR( MatSetNullSpace(self.mat, nsp.nsp) )
*
* def getNullSpace(self): # <<<<<<<<<<<<<<
* cdef NullSpace nsp = NullSpace()
* CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_285getNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_284getNullSpace[] = "Mat.getNullSpace(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_285getNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNullSpace (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNullSpace", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNullSpace", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_284getNullSpace(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_284getNullSpace(struct PyPetscMatObject *__pyx_v_self) {
struct PyPetscNullSpaceObject *__pyx_v_nsp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNullSpace", 0);
/* "petsc4py/PETSc/Mat.pyx":1324
*
* def getNullSpace(self):
* cdef NullSpace nsp = NullSpace() # <<<<<<<<<<<<<<
* CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) )
* PetscINCREF(nsp.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_NullSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1324, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1325
* def getNullSpace(self):
* cdef NullSpace nsp = NullSpace()
* CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) ) # <<<<<<<<<<<<<<
* PetscINCREF(nsp.obj)
* return nsp
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetNullSpace(__pyx_v_self->mat, (&__pyx_v_nsp->nsp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1325, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1326
* cdef NullSpace nsp = NullSpace()
* CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) )
* PetscINCREF(nsp.obj) # <<<<<<<<<<<<<<
* return nsp
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_nsp->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1327
* CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) )
* PetscINCREF(nsp.obj)
* return nsp # <<<<<<<<<<<<<<
*
* def setTransposeNullSpace(self, NullSpace nsp):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_nsp));
__pyx_r = ((PyObject *)__pyx_v_nsp);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1323
* CHKERR( MatSetNullSpace(self.mat, nsp.nsp) )
*
* def getNullSpace(self): # <<<<<<<<<<<<<<
* cdef NullSpace nsp = NullSpace()
* CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_nsp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1329
* return nsp
*
* def setTransposeNullSpace(self, NullSpace nsp): # <<<<<<<<<<<<<<
* CHKERR( MatSetTransposeNullSpace(self.mat, nsp.nsp) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_287setTransposeNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_286setTransposeNullSpace[] = "Mat.setTransposeNullSpace(self, NullSpace nsp)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_287setTransposeNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscNullSpaceObject *__pyx_v_nsp = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsp,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsp)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTransposeNullSpace") < 0)) __PYX_ERR(45, 1329, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_nsp = ((struct PyPetscNullSpaceObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setTransposeNullSpace", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1329, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.setTransposeNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nsp), __pyx_ptype_8petsc4py_5PETSc_NullSpace, 0, "nsp", 0))) __PYX_ERR(45, 1329, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_286setTransposeNullSpace(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nsp);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_286setTransposeNullSpace(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":1330
*
* def setTransposeNullSpace(self, NullSpace nsp):
* CHKERR( MatSetTransposeNullSpace(self.mat, nsp.nsp) ) # <<<<<<<<<<<<<<
*
* def getTransposeNullSpace(self):
*/
__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(45, 1330, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1329
* return nsp
*
* def setTransposeNullSpace(self, NullSpace nsp): # <<<<<<<<<<<<<<
* CHKERR( MatSetTransposeNullSpace(self.mat, nsp.nsp) )
*
*/
/* 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":1332
* CHKERR( MatSetTransposeNullSpace(self.mat, nsp.nsp) )
*
* def getTransposeNullSpace(self): # <<<<<<<<<<<<<<
* cdef NullSpace nsp = NullSpace()
* CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_289getTransposeNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_288getTransposeNullSpace[] = "Mat.getTransposeNullSpace(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_289getTransposeNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getTransposeNullSpace (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getTransposeNullSpace", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTransposeNullSpace", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_288getTransposeNullSpace(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_288getTransposeNullSpace(struct PyPetscMatObject *__pyx_v_self) {
struct PyPetscNullSpaceObject *__pyx_v_nsp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getTransposeNullSpace", 0);
/* "petsc4py/PETSc/Mat.pyx":1333
*
* def getTransposeNullSpace(self):
* cdef NullSpace nsp = NullSpace() # <<<<<<<<<<<<<<
* CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) )
* PetscINCREF(nsp.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_NullSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1333, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1334
* def getTransposeNullSpace(self):
* cdef NullSpace nsp = NullSpace()
* CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) ) # <<<<<<<<<<<<<<
* PetscINCREF(nsp.obj)
* return nsp
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetTransposeNullSpace(__pyx_v_self->mat, (&__pyx_v_nsp->nsp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1334, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1335
* cdef NullSpace nsp = NullSpace()
* CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) )
* PetscINCREF(nsp.obj) # <<<<<<<<<<<<<<
* return nsp
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_nsp->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1336
* CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) )
* PetscINCREF(nsp.obj)
* return nsp # <<<<<<<<<<<<<<
*
* def setNearNullSpace(self, NullSpace nsp):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_nsp));
__pyx_r = ((PyObject *)__pyx_v_nsp);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1332
* CHKERR( MatSetTransposeNullSpace(self.mat, nsp.nsp) )
*
* def getTransposeNullSpace(self): # <<<<<<<<<<<<<<
* cdef NullSpace nsp = NullSpace()
* CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getTransposeNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_nsp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1338
* return nsp
*
* def setNearNullSpace(self, NullSpace nsp): # <<<<<<<<<<<<<<
* CHKERR( MatSetNearNullSpace(self.mat, nsp.nsp) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_291setNearNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_290setNearNullSpace[] = "Mat.setNearNullSpace(self, NullSpace nsp)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_291setNearNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscNullSpaceObject *__pyx_v_nsp = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsp,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsp)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNearNullSpace") < 0)) __PYX_ERR(45, 1338, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_nsp = ((struct PyPetscNullSpaceObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setNearNullSpace", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1338, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.setNearNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nsp), __pyx_ptype_8petsc4py_5PETSc_NullSpace, 0, "nsp", 0))) __PYX_ERR(45, 1338, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_290setNearNullSpace(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nsp);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_290setNearNullSpace(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":1339
*
* def setNearNullSpace(self, NullSpace nsp):
* CHKERR( MatSetNearNullSpace(self.mat, nsp.nsp) ) # <<<<<<<<<<<<<<
*
* def getNearNullSpace(self):
*/
__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(45, 1339, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1338
* return nsp
*
* def setNearNullSpace(self, NullSpace nsp): # <<<<<<<<<<<<<<
* CHKERR( MatSetNearNullSpace(self.mat, nsp.nsp) )
*
*/
/* 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":1341
* CHKERR( MatSetNearNullSpace(self.mat, nsp.nsp) )
*
* def getNearNullSpace(self): # <<<<<<<<<<<<<<
* cdef NullSpace nsp = NullSpace()
* CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_293getNearNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_292getNearNullSpace[] = "Mat.getNearNullSpace(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_293getNearNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNearNullSpace (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNearNullSpace", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNearNullSpace", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_292getNearNullSpace(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_292getNearNullSpace(struct PyPetscMatObject *__pyx_v_self) {
struct PyPetscNullSpaceObject *__pyx_v_nsp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNearNullSpace", 0);
/* "petsc4py/PETSc/Mat.pyx":1342
*
* def getNearNullSpace(self):
* cdef NullSpace nsp = NullSpace() # <<<<<<<<<<<<<<
* CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) )
* PetscINCREF(nsp.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_NullSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1342, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1343
* def getNearNullSpace(self):
* cdef NullSpace nsp = NullSpace()
* CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) ) # <<<<<<<<<<<<<<
* PetscINCREF(nsp.obj)
* return nsp
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetNearNullSpace(__pyx_v_self->mat, (&__pyx_v_nsp->nsp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1343, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1344
* cdef NullSpace nsp = NullSpace()
* CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) )
* PetscINCREF(nsp.obj) # <<<<<<<<<<<<<<
* return nsp
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_nsp->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1345
* CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) )
* 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":1341
* CHKERR( MatSetNearNullSpace(self.mat, nsp.nsp) )
*
* def getNearNullSpace(self): # <<<<<<<<<<<<<<
* cdef NullSpace nsp = NullSpace()
* CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getNearNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_nsp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1349
* # matrix-vector product
*
* def mult(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( MatMult(self.mat, x.vec, y.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_295mult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_294mult[] = "Mat.mult(self, Vec x, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_295mult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("mult", 1, 2, 2, 1); __PYX_ERR(45, 1349, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mult") < 0)) __PYX_ERR(45, 1349, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_y = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("mult", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1349, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.mult", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(45, 1349, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(45, 1349, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_294mult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_294mult(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":1350
*
* def mult(self, Vec x, Vec y):
* CHKERR( MatMult(self.mat, x.vec, y.vec) ) # <<<<<<<<<<<<<<
*
* def multAdd(self, Vec x, Vec v, Vec y):
*/
__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(45, 1350, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1349
* # matrix-vector product
*
* def mult(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( MatMult(self.mat, x.vec, y.vec) )
*
*/
/* 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":1352
* CHKERR( MatMult(self.mat, x.vec, y.vec) )
*
* def multAdd(self, Vec x, Vec v, Vec y): # <<<<<<<<<<<<<<
* CHKERR( MatMultAdd(self.mat, x.vec, v.vec, y.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_297multAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_296multAdd[] = "Mat.multAdd(self, Vec x, Vec v, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_297multAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_v = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_y,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("multAdd", 1, 3, 3, 1); __PYX_ERR(45, 1352, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("multAdd", 1, 3, 3, 2); __PYX_ERR(45, 1352, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multAdd") < 0)) __PYX_ERR(45, 1352, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_v = ((struct PyPetscVecObject *)values[1]);
__pyx_v_y = ((struct PyPetscVecObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("multAdd", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1352, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.multAdd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(45, 1352, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "v", 0))) __PYX_ERR(45, 1352, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(45, 1352, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_296multAdd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_v, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_296multAdd(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":1353
*
* def multAdd(self, Vec x, Vec v, Vec y):
* CHKERR( MatMultAdd(self.mat, x.vec, v.vec, y.vec) ) # <<<<<<<<<<<<<<
*
* def multTranspose(self, Vec x, Vec y):
*/
__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(45, 1353, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1352
* CHKERR( MatMult(self.mat, x.vec, y.vec) )
*
* def multAdd(self, Vec x, Vec v, Vec y): # <<<<<<<<<<<<<<
* CHKERR( MatMultAdd(self.mat, x.vec, v.vec, y.vec) )
*
*/
/* 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":1355
* CHKERR( MatMultAdd(self.mat, x.vec, v.vec, y.vec) )
*
* def multTranspose(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( MatMultTranspose(self.mat, x.vec, y.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_299multTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_298multTranspose[] = "Mat.multTranspose(self, Vec x, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_299multTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("multTranspose", 1, 2, 2, 1); __PYX_ERR(45, 1355, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multTranspose") < 0)) __PYX_ERR(45, 1355, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_y = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("multTranspose", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1355, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.multTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(45, 1355, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(45, 1355, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_298multTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_298multTranspose(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":1356
*
* def multTranspose(self, Vec x, Vec y):
* CHKERR( MatMultTranspose(self.mat, x.vec, y.vec) ) # <<<<<<<<<<<<<<
*
* def multTransposeAdd(self, Vec x, Vec v, Vec y):
*/
__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(45, 1356, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1355
* CHKERR( MatMultAdd(self.mat, x.vec, v.vec, y.vec) )
*
* def multTranspose(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( MatMultTranspose(self.mat, x.vec, y.vec) )
*
*/
/* 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":1358
* CHKERR( MatMultTranspose(self.mat, x.vec, y.vec) )
*
* def multTransposeAdd(self, Vec x, Vec v, Vec y): # <<<<<<<<<<<<<<
* CHKERR( MatMultTransposeAdd(self.mat, x.vec, v.vec, y.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_301multTransposeAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_300multTransposeAdd[] = "Mat.multTransposeAdd(self, Vec x, Vec v, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_301multTransposeAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_v = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_y,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("multTransposeAdd", 1, 3, 3, 1); __PYX_ERR(45, 1358, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("multTransposeAdd", 1, 3, 3, 2); __PYX_ERR(45, 1358, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multTransposeAdd") < 0)) __PYX_ERR(45, 1358, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_v = ((struct PyPetscVecObject *)values[1]);
__pyx_v_y = ((struct PyPetscVecObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("multTransposeAdd", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1358, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.multTransposeAdd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(45, 1358, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "v", 0))) __PYX_ERR(45, 1358, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(45, 1358, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_300multTransposeAdd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_v, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_300multTransposeAdd(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":1359
*
* def multTransposeAdd(self, Vec x, Vec v, Vec y):
* CHKERR( MatMultTransposeAdd(self.mat, x.vec, v.vec, y.vec) ) # <<<<<<<<<<<<<<
*
* def multHermitian(self, Vec x, Vec y):
*/
__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(45, 1359, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1358
* CHKERR( MatMultTranspose(self.mat, x.vec, y.vec) )
*
* def multTransposeAdd(self, Vec x, Vec v, Vec y): # <<<<<<<<<<<<<<
* CHKERR( MatMultTransposeAdd(self.mat, x.vec, v.vec, y.vec) )
*
*/
/* 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":1361
* CHKERR( MatMultTransposeAdd(self.mat, x.vec, v.vec, y.vec) )
*
* def multHermitian(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( MatMultHermitian(self.mat, x.vec, y.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_303multHermitian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_302multHermitian[] = "Mat.multHermitian(self, Vec x, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_303multHermitian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("multHermitian", 1, 2, 2, 1); __PYX_ERR(45, 1361, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multHermitian") < 0)) __PYX_ERR(45, 1361, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_y = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("multHermitian", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1361, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.multHermitian", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(45, 1361, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(45, 1361, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_302multHermitian(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_302multHermitian(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":1362
*
* def multHermitian(self, Vec x, Vec y):
* CHKERR( MatMultHermitian(self.mat, x.vec, y.vec) ) # <<<<<<<<<<<<<<
*
* def multHermitianAdd(self, Vec x, Vec v, Vec y):
*/
__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(45, 1362, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1361
* CHKERR( MatMultTransposeAdd(self.mat, x.vec, v.vec, y.vec) )
*
* def multHermitian(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( MatMultHermitian(self.mat, x.vec, y.vec) )
*
*/
/* 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":1364
* CHKERR( MatMultHermitian(self.mat, x.vec, y.vec) )
*
* def multHermitianAdd(self, Vec x, Vec v, Vec y): # <<<<<<<<<<<<<<
* CHKERR( MatMultHermitianAdd(self.mat, x.vec, v.vec, y.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_305multHermitianAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_304multHermitianAdd[] = "Mat.multHermitianAdd(self, Vec x, Vec v, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_305multHermitianAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_v = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_y,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("multHermitianAdd", 1, 3, 3, 1); __PYX_ERR(45, 1364, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("multHermitianAdd", 1, 3, 3, 2); __PYX_ERR(45, 1364, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multHermitianAdd") < 0)) __PYX_ERR(45, 1364, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_v = ((struct PyPetscVecObject *)values[1]);
__pyx_v_y = ((struct PyPetscVecObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("multHermitianAdd", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1364, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.multHermitianAdd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(45, 1364, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "v", 0))) __PYX_ERR(45, 1364, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(45, 1364, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_304multHermitianAdd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_v, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_304multHermitianAdd(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":1365
*
* def multHermitianAdd(self, Vec x, Vec v, Vec y):
* 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(45, 1365, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1364
* CHKERR( MatMultHermitian(self.mat, x.vec, y.vec) )
*
* def multHermitianAdd(self, Vec x, Vec v, Vec y): # <<<<<<<<<<<<<<
* CHKERR( MatMultHermitianAdd(self.mat, x.vec, v.vec, y.vec) )
*
*/
/* 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":1369
* # SOR
*
* def SOR(self, Vec b, Vec x, omega=1.0, sortype=None, shift=0.0, its=1, lits=1): # <<<<<<<<<<<<<<
* cdef PetscReal comega = asReal(omega)
* cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_307SOR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_306SOR[] = "Mat.SOR(self, Vec b, Vec x, omega=1.0, sortype=None, shift=0.0, its=1, lits=1)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_307SOR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("SOR (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,&__pyx_n_s_omega,&__pyx_n_s_sortype,&__pyx_n_s_shift,&__pyx_n_s_its,&__pyx_n_s_lits,0};
PyObject* values[7] = {0,0,0,0,0,0,0};
values[2] = ((PyObject *)__pyx_float_1_0);
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)__pyx_float_0_0);
values[5] = ((PyObject *)__pyx_int_1);
values[6] = ((PyObject *)__pyx_int_1);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
CYTHON_FALLTHROUGH;
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
CYTHON_FALLTHROUGH;
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("SOR", 0, 2, 7, 1); __PYX_ERR(45, 1369, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sortype);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shift);
if (value) { values[4] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 5:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_its);
if (value) { values[5] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 6:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lits);
if (value) { values[6] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SOR") < 0)) __PYX_ERR(45, 1369, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
CYTHON_FALLTHROUGH;
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
CYTHON_FALLTHROUGH;
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_b = ((struct PyPetscVecObject *)values[0]);
__pyx_v_x = ((struct PyPetscVecObject *)values[1]);
__pyx_v_omega = values[2];
__pyx_v_sortype = values[3];
__pyx_v_shift = values[4];
__pyx_v_its = values[5];
__pyx_v_lits = values[6];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("SOR", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1369, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.SOR", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(45, 1369, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(45, 1369, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_306SOR(((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);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_306SOR(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;
PetscInt __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;
int __pyx_t_3;
PetscInt __pyx_t_4;
PetscErrorCode __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("SOR", 0);
/* "petsc4py/PETSc/Mat.pyx":1370
*
* def SOR(self, Vec b, Vec x, omega=1.0, sortype=None, shift=0.0, its=1, lits=1):
* 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(45, 1370, __pyx_L1_error)
__pyx_v_comega = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1371
* def SOR(self, Vec b, Vec x, omega=1.0, sortype=None, shift=0.0, its=1, lits=1):
* 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":1372
* cdef PetscReal comega = asReal(omega)
* cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP
* if sortype is not None: # <<<<<<<<<<<<<<
* csortype = <PetscMatSORType> asInt(sortype)
* cdef PetscInt cshift = asInt(shift)
*/
__pyx_t_2 = (__pyx_v_sortype != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":1373
* cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP
* if sortype is not None:
* csortype = <PetscMatSORType> asInt(sortype) # <<<<<<<<<<<<<<
* cdef PetscInt cshift = asInt(shift)
* cdef PetscInt cits = asInt(its)
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_sortype); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 1373, __pyx_L1_error)
__pyx_v_csortype = ((MatSORType)__pyx_t_4);
/* "petsc4py/PETSc/Mat.pyx":1372
* cdef PetscReal comega = asReal(omega)
* cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP
* if sortype is not None: # <<<<<<<<<<<<<<
* csortype = <PetscMatSORType> asInt(sortype)
* cdef PetscInt cshift = asInt(shift)
*/
}
/* "petsc4py/PETSc/Mat.pyx":1374
* if sortype is not None:
* csortype = <PetscMatSORType> asInt(sortype)
* cdef PetscInt cshift = asInt(shift) # <<<<<<<<<<<<<<
* cdef PetscInt cits = asInt(its)
* cdef PetscInt clits = asInt(lits)
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_shift); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 1374, __pyx_L1_error)
__pyx_v_cshift = __pyx_t_4;
/* "petsc4py/PETSc/Mat.pyx":1375
* csortype = <PetscMatSORType> asInt(sortype)
* cdef PetscInt cshift = asInt(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_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 1375, __pyx_L1_error)
__pyx_v_cits = __pyx_t_4;
/* "petsc4py/PETSc/Mat.pyx":1376
* cdef PetscInt cshift = asInt(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_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_lits); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 1376, __pyx_L1_error)
__pyx_v_clits = __pyx_t_4;
/* "petsc4py/PETSc/Mat.pyx":1377
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1377, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1369
* # SOR
*
* def SOR(self, Vec b, Vec x, omega=1.0, sortype=None, shift=0.0, its=1, lits=1): # <<<<<<<<<<<<<<
* cdef PetscReal comega = asReal(omega)
* cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP
*/
/* 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":1381
* #
*
* def getDiagonalBlock(self): # <<<<<<<<<<<<<<
* cdef Mat submat = Mat()
* CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_309getDiagonalBlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_308getDiagonalBlock[] = "Mat.getDiagonalBlock(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_309getDiagonalBlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDiagonalBlock (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDiagonalBlock", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDiagonalBlock", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_308getDiagonalBlock(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_308getDiagonalBlock(struct PyPetscMatObject *__pyx_v_self) {
struct PyPetscMatObject *__pyx_v_submat = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDiagonalBlock", 0);
/* "petsc4py/PETSc/Mat.pyx":1382
*
* def getDiagonalBlock(self):
* cdef Mat submat = Mat() # <<<<<<<<<<<<<<
* CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) )
* PetscINCREF(submat.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_submat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1383
* def getDiagonalBlock(self):
* cdef Mat submat = Mat()
* CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) ) # <<<<<<<<<<<<<<
* PetscINCREF(submat.obj)
* return submat
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetDiagonalBlock(__pyx_v_self->mat, (&__pyx_v_submat->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1383, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1384
* cdef Mat submat = Mat()
* CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) )
* PetscINCREF(submat.obj) # <<<<<<<<<<<<<<
* return submat
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_submat->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1385
* CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) )
* PetscINCREF(submat.obj)
* return submat # <<<<<<<<<<<<<<
*
* def increaseOverlap(self, IS iset, overlap=1):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_submat));
__pyx_r = ((PyObject *)__pyx_v_submat);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1381
* #
*
* def getDiagonalBlock(self): # <<<<<<<<<<<<<<
* cdef Mat submat = Mat()
* CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getDiagonalBlock", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_submat);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1387
* return submat
*
* def increaseOverlap(self, IS iset, overlap=1): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(overlap)
* CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_311increaseOverlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_310increaseOverlap[] = "Mat.increaseOverlap(self, IS iset, overlap=1)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_311increaseOverlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_iset = 0;
PyObject *__pyx_v_overlap = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,&__pyx_n_s_overlap,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)__pyx_int_1);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overlap);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "increaseOverlap") < 0)) __PYX_ERR(45, 1387, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_iset = ((struct PyPetscISObject *)values[0]);
__pyx_v_overlap = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("increaseOverlap", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1387, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.increaseOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(45, 1387, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_310increaseOverlap(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_overlap);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_310increaseOverlap(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":1388
*
* def increaseOverlap(self, IS iset, overlap=1):
* 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(45, 1388, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1389
* def increaseOverlap(self, IS iset, overlap=1):
* cdef PetscInt ival = asInt(overlap)
* CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) ) # <<<<<<<<<<<<<<
*
* def createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None):
*/
__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(45, 1389, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1387
* return submat
*
* def increaseOverlap(self, IS iset, overlap=1): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(overlap)
* CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) )
*/
/* 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":1391
* CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) )
*
* def createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* cdef PetscIS ciscol = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_313createSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_312createSubMatrix[] = "Mat.createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_313createSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_isrow = 0;
struct PyPetscISObject *__pyx_v_iscol = 0;
struct PyPetscMatObject *__pyx_v_submat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_submat,0};
PyObject* values[3] = {0,0,0};
values[1] = (PyObject *)((struct PyPetscISObject *)Py_None);
values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_submat);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSubMatrix") < 0)) __PYX_ERR(45, 1391, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_isrow = ((struct PyPetscISObject *)values[0]);
__pyx_v_iscol = ((struct PyPetscISObject *)values[1]);
__pyx_v_submat = ((struct PyPetscMatObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createSubMatrix", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1391, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(45, 1391, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "iscol", 0))) __PYX_ERR(45, 1391, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_submat), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "submat", 0))) __PYX_ERR(45, 1391, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_312createSubMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_submat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_312createSubMatrix(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;
int __pyx_t_2;
IS __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("createSubMatrix", 0);
__Pyx_INCREF((PyObject *)__pyx_v_submat);
/* "petsc4py/PETSc/Mat.pyx":1392
*
* def createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None):
* 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":1393
* def createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None):
* 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":1394
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_iscol->iset;
__pyx_v_ciscol = __pyx_t_3;
}
/* "petsc4py/PETSc/Mat.pyx":1395
* 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_2 = (((PyObject *)__pyx_v_submat) == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 1395, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_submat, ((struct PyPetscMatObject *)__pyx_t_4));
__pyx_t_4 = 0;
}
/* "petsc4py/PETSc/Mat.pyx":1396
* 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) != 0);
if (__pyx_t_1) {
__pyx_v_reuse = MAT_REUSE_MATRIX;
}
/* "petsc4py/PETSc/Mat.pyx":1397
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1397, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1399
* CHKERR( MatCreateSubMatrix(self.mat, isrow.iset, ciscol,
* reuse, &submat.mat) )
* return submat # <<<<<<<<<<<<<<
*
* def createSubMatrices(self, isrows, iscols=None, submats=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_submat));
__pyx_r = ((PyObject *)__pyx_v_submat);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1391
* CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) )
*
* def createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* cdef PetscIS ciscol = NULL
*/
/* function exit code */
__pyx_L1_error:;
__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":1401
* return submat
*
* def createSubMatrices(self, isrows, iscols=None, submats=None): # <<<<<<<<<<<<<<
* if iscols is None: iscols = isrows
* isrows = [isrows] if isinstance(isrows, IS) else list(isrows)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_315createSubMatrices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_314createSubMatrices[] = "Mat.createSubMatrices(self, isrows, iscols=None, submats=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_315createSubMatrices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_isrows = 0;
PyObject *__pyx_v_iscols = 0;
PyObject *__pyx_v_submats = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrows,&__pyx_n_s_iscols,&__pyx_n_s_submats,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrows)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscols);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_submats);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSubMatrices") < 0)) __PYX_ERR(45, 1401, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_isrows = values[0];
__pyx_v_iscols = values[1];
__pyx_v_submats = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createSubMatrices", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1401, __pyx_L3_error)
__pyx_L3_error:;
__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_314createSubMatrices(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrows, __pyx_v_iscols, __pyx_v_submats);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_314createSubMatrices(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_isrows, PyObject *__pyx_v_iscols, PyObject *__pyx_v_submats) {
Py_ssize_t __pyx_v_i;
Py_ssize_t __pyx_v_n;
MatReuse __pyx_v_reuse;
IS *__pyx_v_cisrows;
IS *__pyx_v_ciscols;
Mat *__pyx_v_cmats;
CYTHON_UNUSED PyObject *__pyx_v_tmp1 = 0;
CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0;
struct PyPetscMatObject *__pyx_v_mat = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
Py_ssize_t __pyx_t_5;
Py_ssize_t __pyx_t_6;
IS __pyx_t_7;
PetscErrorCode __pyx_t_8;
Mat __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":1402
*
* def createSubMatrices(self, isrows, iscols=None, submats=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_v_isrows);
__Pyx_DECREF_SET(__pyx_v_iscols, __pyx_v_isrows);
}
/* "petsc4py/PETSc/Mat.pyx":1403
* def createSubMatrices(self, isrows, iscols=None, submats=None):
* 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_2 = __Pyx_TypeCheck(__pyx_v_isrows, __pyx_ptype_8petsc4py_5PETSc_IS);
if ((__pyx_t_2 != 0)) {
__pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 1403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_isrows);
__Pyx_GIVEREF(__pyx_v_isrows);
PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_isrows);
__pyx_t_3 = __pyx_t_4;
__pyx_t_4 = 0;
} else {
__pyx_t_4 = PySequence_List(__pyx_v_isrows); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 1403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = __pyx_t_4;
__pyx_t_4 = 0;
}
__Pyx_DECREF_SET(__pyx_v_isrows, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1404
* 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_2 = __Pyx_TypeCheck(__pyx_v_iscols, __pyx_ptype_8petsc4py_5PETSc_IS);
if ((__pyx_t_2 != 0)) {
__pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 1404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_iscols);
__Pyx_GIVEREF(__pyx_v_iscols);
PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_iscols);
__pyx_t_3 = __pyx_t_4;
__pyx_t_4 = 0;
} else {
__pyx_t_4 = PySequence_List(__pyx_v_iscols); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 1404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = __pyx_t_4;
__pyx_t_4 = 0;
}
__Pyx_DECREF_SET(__pyx_v_iscols, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1405
* 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_5 = PyObject_Length(__pyx_v_isrows); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(45, 1405, __pyx_L1_error)
__pyx_t_6 = PyObject_Length(__pyx_v_iscols); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(45, 1405, __pyx_L1_error)
if (unlikely(!((__pyx_t_5 == __pyx_t_6) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(45, 1405, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/Mat.pyx":1406
* 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_6 = PyObject_Length(__pyx_v_isrows); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(45, 1406, __pyx_L1_error)
__pyx_v_n = __pyx_t_6;
/* "petsc4py/PETSc/Mat.pyx":1407
* 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":1408
* 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":1409
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* cdef PetscIS *cisrows = NULL
* cdef PetscIS *ciscols = NULL # <<<<<<<<<<<<<<
* cdef PetscMat *cmats = NULL
* cdef object tmp1, tmp2
*/
__pyx_v_ciscols = NULL;
/* "petsc4py/PETSc/Mat.pyx":1410
* cdef PetscIS *cisrows = NULL
* cdef PetscIS *ciscols = NULL
* cdef PetscMat *cmats = NULL # <<<<<<<<<<<<<<
* cdef object tmp1, tmp2
* cdef Mat mat
*/
__pyx_v_cmats = NULL;
/* "petsc4py/PETSc/Mat.pyx":1413
* cdef object tmp1, tmp2
* cdef Mat mat
* tmp1 = oarray_p(empty_p(n), NULL, <void**>&cisrows) # <<<<<<<<<<<<<<
* for i from 0 <= i < n: cisrows[i] = (<IS?>isrows[i]).iset
* tmp2 = oarray_p(empty_p(n), NULL, <void**>&ciscols)
*/
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1413, __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_cisrows)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 1413, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_tmp1 = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Mat.pyx":1414
* cdef Mat mat
* tmp1 = oarray_p(empty_p(n), NULL, <void**>&cisrows)
* for i from 0 <= i < n: cisrows[i] = (<IS?>isrows[i]).iset # <<<<<<<<<<<<<<
* tmp2 = oarray_p(empty_p(n), NULL, <void**>&ciscols)
* for i from 0 <= i < n: ciscols[i] = (<IS?>iscols[i]).iset
*/
__pyx_t_6 = __pyx_v_n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_isrows, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 1414, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(45, 1414, __pyx_L1_error)
__pyx_t_7 = ((struct PyPetscISObject *)__pyx_t_4)->iset;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
(__pyx_v_cisrows[__pyx_v_i]) = __pyx_t_7;
}
/* "petsc4py/PETSc/Mat.pyx":1415
* tmp1 = oarray_p(empty_p(n), NULL, <void**>&cisrows)
* for i from 0 <= i < n: cisrows[i] = (<IS?>isrows[i]).iset
* tmp2 = oarray_p(empty_p(n), NULL, <void**>&ciscols) # <<<<<<<<<<<<<<
* for i from 0 <= i < n: ciscols[i] = (<IS?>iscols[i]).iset
* if submats is not None:
*/
__pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 1415, __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_ciscols)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_tmp2 = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1416
* for i from 0 <= i < n: cisrows[i] = (<IS?>isrows[i]).iset
* tmp2 = oarray_p(empty_p(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_6 = __pyx_v_n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_iscols, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(45, 1416, __pyx_L1_error)
__pyx_t_7 = ((struct PyPetscISObject *)__pyx_t_3)->iset;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
(__pyx_v_ciscols[__pyx_v_i]) = __pyx_t_7;
}
/* "petsc4py/PETSc/Mat.pyx":1417
* tmp2 = oarray_p(empty_p(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_2 = (__pyx_v_submats != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Mat.pyx":1418
* 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":1419
* 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_3 = PySequence_List(__pyx_v_submats); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1419, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_submats, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1420
* 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_6 = PyObject_Length(__pyx_v_submats); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(45, 1420, __pyx_L1_error)
__pyx_t_5 = PyObject_Length(__pyx_v_isrows); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(45, 1420, __pyx_L1_error)
if (unlikely(!((__pyx_t_6 == __pyx_t_5) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(45, 1420, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/Mat.pyx":1421
* 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_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)(__pyx_v_n + 1)) * (sizeof(Mat))), (&__pyx_v_cmats))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1421, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1422
* 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: PetscINCREF(<PetscObject*>&cmats[i])
*/
__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_submats, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1422, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(45, 1422, __pyx_L1_error)
__pyx_t_9 = ((struct PyPetscMatObject *)__pyx_t_3)->mat;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
(__pyx_v_cmats[__pyx_v_i]) = __pyx_t_9;
}
/* "petsc4py/PETSc/Mat.pyx":1417
* tmp2 = oarray_p(empty_p(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":1423
* 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: PetscINCREF(<PetscObject*>&cmats[i])
* if reuse == MAT_INITIAL_MATRIX:
*/
__pyx_t_8 = __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_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1423, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1424
* 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: PetscINCREF(<PetscObject*>&cmats[i]) # <<<<<<<<<<<<<<
* if reuse == MAT_INITIAL_MATRIX:
* submats = [None] * n
*/
__pyx_t_5 = __pyx_v_n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&(__pyx_v_cmats[__pyx_v_i])))));
}
/* "petsc4py/PETSc/Mat.pyx":1425
* CHKERR( MatCreateSubMatrices(self.mat, <PetscInt>n, cisrows, ciscols, reuse, &cmats) )
* for i from 0 <= i < n: 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) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Mat.pyx":1426
* for i from 0 <= i < n: PetscINCREF(<PetscObject*>&cmats[i])
* if reuse == MAT_INITIAL_MATRIX:
* submats = [None] * n # <<<<<<<<<<<<<<
* for i from 0 <= i < n:
* submats[i] = mat = Mat()
*/
__pyx_t_3 = PyList_New(1 * ((__pyx_v_n<0) ? 0:__pyx_v_n)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1426, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
{ Py_ssize_t __pyx_temp;
for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) {
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
PyList_SET_ITEM(__pyx_t_3, __pyx_temp, Py_None);
}
}
__Pyx_DECREF_SET(__pyx_v_submats, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1427
* if reuse == MAT_INITIAL_MATRIX:
* submats = [None] * n
* for i from 0 <= i < n: # <<<<<<<<<<<<<<
* submats[i] = mat = Mat()
* mat.mat = cmats[i]
*/
__pyx_t_5 = __pyx_v_n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
/* "petsc4py/PETSc/Mat.pyx":1428
* 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 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1428, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely(__Pyx_SetItemInt(__pyx_v_submats, __pyx_v_i, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(45, 1428, __pyx_L1_error)
__Pyx_INCREF(__pyx_t_3);
__Pyx_XDECREF_SET(__pyx_v_mat, ((struct PyPetscMatObject *)__pyx_t_3));
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1429
* 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":1425
* CHKERR( MatCreateSubMatrices(self.mat, <PetscInt>n, cisrows, ciscols, reuse, &cmats) )
* for i from 0 <= i < n: PetscINCREF(<PetscObject*>&cmats[i])
* if reuse == MAT_INITIAL_MATRIX: # <<<<<<<<<<<<<<
* submats = [None] * n
* for i from 0 <= i < n:
*/
}
/* "petsc4py/PETSc/Mat.pyx":1430
* submats[i] = mat = Mat()
* mat.mat = cmats[i]
* CHKERR( MatDestroyMatrices(<PetscInt>n, &cmats) ) # <<<<<<<<<<<<<<
* return submats
*
*/
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDestroyMatrices(((PetscInt)__pyx_v_n), (&__pyx_v_cmats))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1430, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1431
* 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":1401
* return submat
*
* def createSubMatrices(self, isrows, iscols=None, submats=None): # <<<<<<<<<<<<<<
* if iscols is None: iscols = isrows
* isrows = [isrows] if isinstance(isrows, IS) else list(isrows)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.createSubMatrices", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmp1);
__Pyx_XDECREF(__pyx_v_tmp2);
__Pyx_XDECREF((PyObject *)__pyx_v_mat);
__Pyx_XDECREF(__pyx_v_isrows);
__Pyx_XDECREF(__pyx_v_iscols);
__Pyx_XDECREF(__pyx_v_submats);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1435
* #
*
* def getLocalSubMatrix(self, IS isrow, IS iscol, Mat submat=None): # <<<<<<<<<<<<<<
* if submat is None: submat = Mat()
* else: CHKERR( MatDestroy(&submat.mat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_317getLocalSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_316getLocalSubMatrix[] = "Mat.getLocalSubMatrix(self, IS isrow, IS iscol, Mat submat=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_317getLocalSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_isrow = 0;
struct PyPetscISObject *__pyx_v_iscol = 0;
struct PyPetscMatObject *__pyx_v_submat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_submat,0};
PyObject* values[3] = {0,0,0};
values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("getLocalSubMatrix", 0, 2, 3, 1); __PYX_ERR(45, 1435, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_submat);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getLocalSubMatrix") < 0)) __PYX_ERR(45, 1435, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_isrow = ((struct PyPetscISObject *)values[0]);
__pyx_v_iscol = ((struct PyPetscISObject *)values[1]);
__pyx_v_submat = ((struct PyPetscMatObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getLocalSubMatrix", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1435, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getLocalSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(45, 1435, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(45, 1435, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_submat), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "submat", 0))) __PYX_ERR(45, 1435, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_316getLocalSubMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_submat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_316getLocalSubMatrix(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;
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("getLocalSubMatrix", 0);
__Pyx_INCREF((PyObject *)__pyx_v_submat);
/* "petsc4py/PETSc/Mat.pyx":1436
*
* def getLocalSubMatrix(self, IS isrow, IS iscol, Mat submat=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1436, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_submat, ((struct PyPetscMatObject *)__pyx_t_3));
__pyx_t_3 = 0;
goto __pyx_L3;
}
/* "petsc4py/PETSc/Mat.pyx":1437
* def getLocalSubMatrix(self, IS isrow, IS iscol, Mat submat=None):
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDestroy((&__pyx_v_submat->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1437, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/Mat.pyx":1438
* 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_4 = __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_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1438, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1439
* else: CHKERR( MatDestroy(&submat.mat) )
* CHKERR( MatGetLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) )
* return submat # <<<<<<<<<<<<<<
*
* def restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_submat));
__pyx_r = ((PyObject *)__pyx_v_submat);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1435
* #
*
* def getLocalSubMatrix(self, IS isrow, IS iscol, Mat submat=None): # <<<<<<<<<<<<<<
* if submat is None: submat = Mat()
* else: CHKERR( MatDestroy(&submat.mat) )
*/
/* function exit code */
__pyx_L1_error:;
__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":1441
* return submat
*
* def restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat): # <<<<<<<<<<<<<<
* CHKERR( MatRestoreLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_319restoreLocalSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_318restoreLocalSubMatrix[] = "Mat.restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_319restoreLocalSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_isrow = 0;
struct PyPetscISObject *__pyx_v_iscol = 0;
struct PyPetscMatObject *__pyx_v_submat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_submat,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("restoreLocalSubMatrix", 1, 3, 3, 1); __PYX_ERR(45, 1441, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_submat)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("restoreLocalSubMatrix", 1, 3, 3, 2); __PYX_ERR(45, 1441, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restoreLocalSubMatrix") < 0)) __PYX_ERR(45, 1441, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_isrow = ((struct PyPetscISObject *)values[0]);
__pyx_v_iscol = ((struct PyPetscISObject *)values[1]);
__pyx_v_submat = ((struct PyPetscMatObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("restoreLocalSubMatrix", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1441, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreLocalSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(45, 1441, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(45, 1441, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_submat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "submat", 0))) __PYX_ERR(45, 1441, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_318restoreLocalSubMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_submat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_318restoreLocalSubMatrix(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":1442
*
* def restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat):
* 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(45, 1442, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1441
* return submat
*
* def restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat): # <<<<<<<<<<<<<<
* CHKERR( MatRestoreLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) )
*
*/
/* 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":1446
* #
*
* def norm(self, norm_type=None): # <<<<<<<<<<<<<<
* cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2
* cdef PetscNormType ntype = PETSC_NORM_FROBENIUS
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_321norm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_320norm[] = "Mat.norm(self, norm_type=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_321norm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_norm_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm_type,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norm_type);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "norm") < 0)) __PYX_ERR(45, 1446, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_norm_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("norm", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1446, __pyx_L3_error)
__pyx_L3_error:;
__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_320norm(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_norm_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_320norm(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;
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("norm", 0);
/* "petsc4py/PETSc/Mat.pyx":1447
*
* def norm(self, norm_type=None):
* 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":1448
* def norm(self, norm_type=None):
* 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":1449
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = ((NormType)__Pyx_PyInt_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 1449, __pyx_L1_error)
__pyx_v_ntype = __pyx_t_3;
}
/* "petsc4py/PETSc/Mat.pyx":1451
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNorm(__pyx_v_self->mat, __pyx_v_ntype, __pyx_v_rval)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1451, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1452
* 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_2 = ((__pyx_v_ntype != __pyx_v_norm_1_2) != 0);
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(45, 1452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Mat.pyx":1453
* 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):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 1453, __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(45, 1453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 1453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
__pyx_t_5 = 0;
__pyx_t_6 = 0;
__pyx_r = __pyx_t_7;
__pyx_t_7 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/Mat.pyx":1446
* #
*
* def norm(self, norm_type=None): # <<<<<<<<<<<<<<
* cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2
* cdef PetscNormType ntype = PETSC_NORM_FROBENIUS
*/
/* 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.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":1455
* else: return (toReal(rval[0]), toReal(rval[1]))
*
* def scale(self, alpha): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( MatScale(self.mat, sval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_323scale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_322scale[] = "Mat.scale(self, alpha)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_323scale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_alpha = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scale") < 0)) __PYX_ERR(45, 1455, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_alpha = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("scale", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1455, __pyx_L3_error)
__pyx_L3_error:;
__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_322scale(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_alpha);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_322scale(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":1456
*
* def scale(self, alpha):
* cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<<
* CHKERR( MatScale(self.mat, sval) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(45, 1456, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1457
* def scale(self, alpha):
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( MatScale(self.mat, sval) ) # <<<<<<<<<<<<<<
*
* def shift(self, alpha):
*/
__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(45, 1457, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1455
* else: return (toReal(rval[0]), toReal(rval[1]))
*
* def scale(self, alpha): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( MatScale(self.mat, sval) )
*/
/* 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":1459
* CHKERR( MatScale(self.mat, sval) )
*
* def shift(self, alpha): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( MatShift(self.mat, sval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_325shift(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_324shift[] = "Mat.shift(self, alpha)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_325shift(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_alpha = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shift") < 0)) __PYX_ERR(45, 1459, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_alpha = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("shift", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1459, __pyx_L3_error)
__pyx_L3_error:;
__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_324shift(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_alpha);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_324shift(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":1460
*
* def shift(self, alpha):
* cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<<
* CHKERR( MatShift(self.mat, sval) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(45, 1460, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1461
* def shift(self, alpha):
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( MatShift(self.mat, sval) ) # <<<<<<<<<<<<<<
*
* def chop(self, tol):
*/
__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(45, 1461, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1459
* CHKERR( MatScale(self.mat, sval) )
*
* def shift(self, alpha): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* CHKERR( MatShift(self.mat, sval) )
*/
/* 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":1463
* CHKERR( MatShift(self.mat, sval) )
*
* def chop(self, tol): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(tol)
* CHKERR( MatChop(self.mat, rval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_327chop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_326chop[] = "Mat.chop(self, tol)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_327chop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tol = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chop") < 0)) __PYX_ERR(45, 1463, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_tol = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("chop", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1463, __pyx_L3_error)
__pyx_L3_error:;
__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_326chop(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_tol);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_326chop(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":1464
*
* def chop(self, tol):
* cdef PetscReal rval = asReal(tol) # <<<<<<<<<<<<<<
* CHKERR( MatChop(self.mat, rval) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(45, 1464, __pyx_L1_error)
__pyx_v_rval = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1465
* def chop(self, tol):
* cdef PetscReal rval = asReal(tol)
* CHKERR( MatChop(self.mat, rval) ) # <<<<<<<<<<<<<<
*
* def setRandom(self, Random random=None):
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatChop(__pyx_v_self->mat, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1465, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1463
* CHKERR( MatShift(self.mat, sval) )
*
* def chop(self, tol): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(tol)
* CHKERR( MatChop(self.mat, rval) )
*/
/* 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":1467
* CHKERR( MatChop(self.mat, rval) )
*
* def setRandom(self, Random random=None): # <<<<<<<<<<<<<<
* cdef PetscRandom rnd = NULL
* if random is not None: rnd = random.rnd
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_329setRandom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_328setRandom[] = "Mat.setRandom(self, Random random=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_329setRandom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscRandomObject *__pyx_v_random = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_random,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscRandomObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_random);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setRandom") < 0)) __PYX_ERR(45, 1467, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_random = ((struct PyPetscRandomObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setRandom", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1467, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.setRandom", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_random), __pyx_ptype_8petsc4py_5PETSc_Random, 1, "random", 0))) __PYX_ERR(45, 1467, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_328setRandom(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_random);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_328setRandom(struct PyPetscMatObject *__pyx_v_self, struct PyPetscRandomObject *__pyx_v_random) {
PetscRandom __pyx_v_rnd;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PetscRandom __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setRandom", 0);
/* "petsc4py/PETSc/Mat.pyx":1468
*
* def setRandom(self, Random random=None):
* 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":1469
* def setRandom(self, Random random=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_random->rnd;
__pyx_v_rnd = __pyx_t_3;
}
/* "petsc4py/PETSc/Mat.pyx":1470
* cdef PetscRandom rnd = NULL
* if random is not None: rnd = random.rnd
* CHKERR( MatSetRandom(self.mat, rnd) ) # <<<<<<<<<<<<<<
*
* def axpy(self, alpha, Mat X, structure=None):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetRandom(__pyx_v_self->mat, __pyx_v_rnd)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1470, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1467
* CHKERR( MatChop(self.mat, rval) )
*
* def setRandom(self, Random random=None): # <<<<<<<<<<<<<<
* cdef PetscRandom rnd = NULL
* if random is not None: rnd = random.rnd
*/
/* 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":1472
* CHKERR( MatSetRandom(self.mat, rnd) )
*
* def axpy(self, alpha, Mat X, structure=None): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* cdef PetscMatStructure flag = matstructure(structure)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_331axpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_330axpy[] = "Mat.axpy(self, alpha, Mat X, structure=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_331axpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_alpha = 0;
struct PyPetscMatObject *__pyx_v_X = 0;
PyObject *__pyx_v_structure = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_X,&__pyx_n_s_structure,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("axpy", 0, 2, 3, 1); __PYX_ERR(45, 1472, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_structure);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "axpy") < 0)) __PYX_ERR(45, 1472, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_alpha = values[0];
__pyx_v_X = ((struct PyPetscMatObject *)values[1]);
__pyx_v_structure = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("axpy", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1472, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.axpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(45, 1472, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_330axpy(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_X, __pyx_v_structure);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_330axpy(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":1473
*
* def axpy(self, alpha, Mat X, structure=None):
* cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<<
* cdef PetscMatStructure flag = matstructure(structure)
* CHKERR( MatAXPY(self.mat, sval, X.mat, flag) )
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(45, 1473, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1474
* def axpy(self, alpha, Mat X, structure=None):
* 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(45, 1474, __pyx_L1_error)
__pyx_v_flag = __pyx_t_2;
/* "petsc4py/PETSc/Mat.pyx":1475
* cdef PetscScalar sval = asScalar(alpha)
* cdef PetscMatStructure flag = matstructure(structure)
* CHKERR( MatAXPY(self.mat, sval, X.mat, flag) ) # <<<<<<<<<<<<<<
*
* def aypx(self, alpha, Mat X, structure=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(45, 1475, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1472
* CHKERR( MatSetRandom(self.mat, rnd) )
*
* def axpy(self, alpha, Mat X, structure=None): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* cdef PetscMatStructure flag = matstructure(structure)
*/
/* 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":1477
* CHKERR( MatAXPY(self.mat, sval, X.mat, flag) )
*
* def aypx(self, alpha, Mat X, structure=None): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* cdef PetscMatStructure flag = matstructure(structure)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_333aypx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_332aypx[] = "Mat.aypx(self, alpha, Mat X, structure=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_333aypx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_alpha = 0;
struct PyPetscMatObject *__pyx_v_X = 0;
PyObject *__pyx_v_structure = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_X,&__pyx_n_s_structure,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("aypx", 0, 2, 3, 1); __PYX_ERR(45, 1477, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_structure);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aypx") < 0)) __PYX_ERR(45, 1477, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_alpha = values[0];
__pyx_v_X = ((struct PyPetscMatObject *)values[1]);
__pyx_v_structure = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("aypx", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1477, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.aypx", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(45, 1477, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_332aypx(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_X, __pyx_v_structure);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_332aypx(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":1478
*
* def aypx(self, alpha, Mat X, structure=None):
* cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<<
* cdef PetscMatStructure flag = matstructure(structure)
* CHKERR( MatAYPX(self.mat, sval, X.mat, flag) )
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(45, 1478, __pyx_L1_error)
__pyx_v_sval = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1479
* def aypx(self, alpha, Mat X, structure=None):
* 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(45, 1479, __pyx_L1_error)
__pyx_v_flag = __pyx_t_2;
/* "petsc4py/PETSc/Mat.pyx":1480
* 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(45, 1480, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1477
* CHKERR( MatAXPY(self.mat, sval, X.mat, flag) )
*
* def aypx(self, alpha, Mat X, structure=None): # <<<<<<<<<<<<<<
* cdef PetscScalar sval = asScalar(alpha)
* cdef PetscMatStructure flag = matstructure(structure)
*/
/* 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":1484
* # matrix-matrix product
*
* def matMult(self, Mat mat, Mat result=None, fill=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* cdef PetscReal rval = 2
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_335matMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_334matMult[] = "Mat.matMult(self, Mat mat, Mat result=None, fill=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_335matMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 0;
struct PyPetscMatObject *__pyx_v_result = 0;
PyObject *__pyx_v_fill = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_result,&__pyx_n_s_fill,0};
PyObject* values[3] = {0,0,0};
values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matMult") < 0)) __PYX_ERR(45, 1484, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
__pyx_v_result = ((struct PyPetscMatObject *)values[1]);
__pyx_v_fill = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("matMult", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1484, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.matMult", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(45, 1484, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(45, 1484, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_334matMult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_result, __pyx_v_fill);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_334matMult(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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscReal __pyx_t_4;
PetscErrorCode __pyx_t_5;
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":1485
*
* def matMult(self, Mat mat, Mat result=None, fill=None):
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<<
* cdef PetscReal rval = 2
* if result is None:
*/
__pyx_v_reuse = MAT_INITIAL_MATRIX;
/* "petsc4py/PETSc/Mat.pyx":1486
* def matMult(self, Mat mat, Mat result=None, fill=None):
* 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":1487
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1488
* cdef PetscReal rval = 2
* if result is None:
* result = Mat() # <<<<<<<<<<<<<<
* elif result.mat != NULL:
* reuse = MAT_REUSE_MATRIX
*/
__pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1488, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_3));
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1487
* 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":1489
* if result is None:
* result = Mat()
* elif result.mat != NULL: # <<<<<<<<<<<<<<
* reuse = MAT_REUSE_MATRIX
* if fill is not None: rval = asReal(fill)
*/
__pyx_t_2 = ((__pyx_v_result->mat != NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1490
* 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":1489
* 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":1491
* 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_2 = (__pyx_v_fill != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(45, 1491, __pyx_L1_error)
__pyx_v_rval = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":1492
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1492, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1493
* if fill is not None: rval = asReal(fill)
* CHKERR( MatMatMult(self.mat, mat.mat, reuse, rval, &result.mat) )
* return result # <<<<<<<<<<<<<<
*
* def matTransposeMult(self, Mat mat, Mat result=None, fill=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1484
* # matrix-matrix product
*
* def matMult(self, Mat mat, Mat result=None, fill=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* cdef PetscReal rval = 2
*/
/* function exit code */
__pyx_L1_error:;
__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":1495
* return result
*
* def matTransposeMult(self, Mat mat, Mat result=None, fill=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* cdef PetscReal rval = 2
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_337matTransposeMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_336matTransposeMult[] = "Mat.matTransposeMult(self, Mat mat, Mat result=None, fill=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_337matTransposeMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 0;
struct PyPetscMatObject *__pyx_v_result = 0;
PyObject *__pyx_v_fill = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_result,&__pyx_n_s_fill,0};
PyObject* values[3] = {0,0,0};
values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matTransposeMult") < 0)) __PYX_ERR(45, 1495, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
__pyx_v_result = ((struct PyPetscMatObject *)values[1]);
__pyx_v_fill = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("matTransposeMult", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1495, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.matTransposeMult", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(45, 1495, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(45, 1495, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_336matTransposeMult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_result, __pyx_v_fill);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_336matTransposeMult(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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscReal __pyx_t_4;
PetscErrorCode __pyx_t_5;
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":1496
*
* def matTransposeMult(self, Mat mat, Mat result=None, fill=None):
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<<
* cdef PetscReal rval = 2
* if result is None:
*/
__pyx_v_reuse = MAT_INITIAL_MATRIX;
/* "petsc4py/PETSc/Mat.pyx":1497
* def matTransposeMult(self, Mat mat, Mat result=None, fill=None):
* 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":1498
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1499
* cdef PetscReal rval = 2
* if result is None:
* result = Mat() # <<<<<<<<<<<<<<
* elif result.mat != NULL:
* reuse = MAT_REUSE_MATRIX
*/
__pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_3));
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1498
* 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":1500
* if result is None:
* result = Mat()
* elif result.mat != NULL: # <<<<<<<<<<<<<<
* reuse = MAT_REUSE_MATRIX
* if fill is not None: rval = asReal(fill)
*/
__pyx_t_2 = ((__pyx_v_result->mat != NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1501
* 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":1500
* 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":1502
* 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_2 = (__pyx_v_fill != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(45, 1502, __pyx_L1_error)
__pyx_v_rval = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":1503
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1503, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1504
* if fill is not None: rval = asReal(fill)
* CHKERR( MatMatTransposeMult(self.mat, mat.mat, reuse, rval, &result.mat) )
* return result # <<<<<<<<<<<<<<
*
* def transposeMatMult(self, Mat mat, Mat result=None, fill=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1495
* return result
*
* def matTransposeMult(self, Mat mat, Mat result=None, fill=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* cdef PetscReal rval = 2
*/
/* function exit code */
__pyx_L1_error:;
__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":1506
* return result
*
* def transposeMatMult(self, Mat mat, Mat result=None, fill=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* cdef PetscReal rval = 2
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_339transposeMatMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_338transposeMatMult[] = "Mat.transposeMatMult(self, Mat mat, Mat result=None, fill=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_339transposeMatMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 0;
struct PyPetscMatObject *__pyx_v_result = 0;
PyObject *__pyx_v_fill = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_result,&__pyx_n_s_fill,0};
PyObject* values[3] = {0,0,0};
values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "transposeMatMult") < 0)) __PYX_ERR(45, 1506, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
__pyx_v_result = ((struct PyPetscMatObject *)values[1]);
__pyx_v_fill = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("transposeMatMult", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1506, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.transposeMatMult", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(45, 1506, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(45, 1506, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_338transposeMatMult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_result, __pyx_v_fill);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_338transposeMatMult(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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscReal __pyx_t_4;
PetscErrorCode __pyx_t_5;
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":1507
*
* def transposeMatMult(self, Mat mat, Mat result=None, fill=None):
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<<
* cdef PetscReal rval = 2
* if result is None:
*/
__pyx_v_reuse = MAT_INITIAL_MATRIX;
/* "petsc4py/PETSc/Mat.pyx":1508
* def transposeMatMult(self, Mat mat, Mat result=None, fill=None):
* 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":1509
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1510
* cdef PetscReal rval = 2
* if result is None:
* result = Mat() # <<<<<<<<<<<<<<
* elif result.mat != NULL:
* reuse = MAT_REUSE_MATRIX
*/
__pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1510, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_3));
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1509
* 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":1511
* if result is None:
* result = Mat()
* elif result.mat != NULL: # <<<<<<<<<<<<<<
* reuse = MAT_REUSE_MATRIX
* if fill is not None: rval = asReal(fill)
*/
__pyx_t_2 = ((__pyx_v_result->mat != NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1512
* 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":1511
* 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":1513
* 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_2 = (__pyx_v_fill != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(45, 1513, __pyx_L1_error)
__pyx_v_rval = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":1514
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1514, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1515
* if fill is not None: rval = asReal(fill)
* CHKERR( MatTransposeMatMult(self.mat, mat.mat, reuse, rval, &result.mat) )
* return result # <<<<<<<<<<<<<<
*
* def ptap(self, Mat P, Mat result=None, fill=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1506
* return result
*
* def transposeMatMult(self, Mat mat, Mat result=None, fill=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* cdef PetscReal rval = 2
*/
/* function exit code */
__pyx_L1_error:;
__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":1517
* return result
*
* def ptap(self, Mat P, Mat result=None, fill=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* cdef PetscReal cfill = PETSC_DEFAULT
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_341ptap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_340ptap[] = "Mat.ptap(self, Mat P, Mat result=None, fill=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_341ptap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_P = 0;
struct PyPetscMatObject *__pyx_v_result = 0;
PyObject *__pyx_v_fill = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_P,&__pyx_n_s_result,&__pyx_n_s_fill,0};
PyObject* values[3] = {0,0,0};
values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ptap") < 0)) __PYX_ERR(45, 1517, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_P = ((struct PyPetscMatObject *)values[0]);
__pyx_v_result = ((struct PyPetscMatObject *)values[1]);
__pyx_v_fill = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("ptap", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1517, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.ptap", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "P", 0))) __PYX_ERR(45, 1517, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(45, 1517, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_340ptap(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_P, __pyx_v_result, __pyx_v_fill);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_340ptap(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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscReal __pyx_t_4;
PetscErrorCode __pyx_t_5;
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":1518
*
* def ptap(self, Mat P, Mat result=None, fill=None):
* 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":1519
* def ptap(self, Mat P, Mat result=None, fill=None):
* 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":1520
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1521
* cdef PetscReal cfill = PETSC_DEFAULT
* if result is None:
* result = Mat() # <<<<<<<<<<<<<<
* elif result.mat != NULL:
* reuse = MAT_REUSE_MATRIX
*/
__pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1521, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_3));
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1520
* 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":1522
* if result is None:
* result = Mat()
* elif result.mat != NULL: # <<<<<<<<<<<<<<
* reuse = MAT_REUSE_MATRIX
* if fill is not None: cfill = asReal(fill)
*/
__pyx_t_2 = ((__pyx_v_result->mat != NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1523
* 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":1522
* 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":1524
* 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_2 = (__pyx_v_fill != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(45, 1524, __pyx_L1_error)
__pyx_v_cfill = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":1525
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1525, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1526
* if fill is not None: cfill = asReal(fill)
* CHKERR( MatPtAP(self.mat, P.mat, reuse, cfill, &result.mat) )
* return result # <<<<<<<<<<<<<<
*
* def rart(self, Mat R, Mat result=None, fill=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1517
* return result
*
* def ptap(self, Mat P, Mat result=None, fill=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* cdef PetscReal cfill = PETSC_DEFAULT
*/
/* function exit code */
__pyx_L1_error:;
__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":1528
* return result
*
* def rart(self, Mat R, Mat result=None, fill=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* cdef PetscReal cfill = PETSC_DEFAULT
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_343rart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_342rart[] = "Mat.rart(self, Mat R, Mat result=None, fill=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_343rart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_R = 0;
struct PyPetscMatObject *__pyx_v_result = 0;
PyObject *__pyx_v_fill = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_result,&__pyx_n_s_fill,0};
PyObject* values[3] = {0,0,0};
values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rart") < 0)) __PYX_ERR(45, 1528, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_R = ((struct PyPetscMatObject *)values[0]);
__pyx_v_result = ((struct PyPetscMatObject *)values[1]);
__pyx_v_fill = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("rart", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1528, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.rart", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_R), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "R", 0))) __PYX_ERR(45, 1528, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(45, 1528, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_342rart(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_result, __pyx_v_fill);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_342rart(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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscReal __pyx_t_4;
PetscErrorCode __pyx_t_5;
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":1529
*
* def rart(self, Mat R, Mat result=None, fill=None):
* 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":1530
* def rart(self, Mat R, Mat result=None, fill=None):
* 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":1531
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1532
* cdef PetscReal cfill = PETSC_DEFAULT
* if result is None:
* result = Mat() # <<<<<<<<<<<<<<
* elif result.mat != NULL:
* reuse = MAT_REUSE_MATRIX
*/
__pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1532, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_3));
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1531
* 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":1533
* if result is None:
* result = Mat()
* elif result.mat != NULL: # <<<<<<<<<<<<<<
* reuse = MAT_REUSE_MATRIX
* if fill is not None: cfill = asReal(fill)
*/
__pyx_t_2 = ((__pyx_v_result->mat != NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1534
* 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":1533
* 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":1535
* 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_2 = (__pyx_v_fill != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(45, 1535, __pyx_L1_error)
__pyx_v_cfill = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":1536
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1536, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1537
* if fill is not None: cfill = asReal(fill)
* CHKERR( MatRARt(self.mat, R.mat, reuse, cfill, &result.mat) )
* return result # <<<<<<<<<<<<<<
*
* def matMatMult(self, Mat B, Mat C, Mat result=None, fill=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1528
* return result
*
* def rart(self, Mat R, Mat result=None, fill=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* cdef PetscReal cfill = PETSC_DEFAULT
*/
/* function exit code */
__pyx_L1_error:;
__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":1539
* return result
*
* def matMatMult(self, Mat B, Mat C, Mat result=None, fill=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* cdef PetscReal cfill = PETSC_DEFAULT
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_345matMatMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_344matMatMult[] = "Mat.matMatMult(self, Mat B, Mat C, Mat result=None, fill=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_345matMatMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_B = 0;
struct PyPetscMatObject *__pyx_v_C = 0;
struct PyPetscMatObject *__pyx_v_result = 0;
PyObject *__pyx_v_fill = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_B,&__pyx_n_s_C,&__pyx_n_s_result,&__pyx_n_s_fill,0};
PyObject* values[4] = {0,0,0,0};
values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("matMatMult", 0, 2, 4, 1); __PYX_ERR(45, 1539, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matMatMult") < 0)) __PYX_ERR(45, 1539, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_B = ((struct PyPetscMatObject *)values[0]);
__pyx_v_C = ((struct PyPetscMatObject *)values[1]);
__pyx_v_result = ((struct PyPetscMatObject *)values[2]);
__pyx_v_fill = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("matMatMult", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1539, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.matMatMult", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_B), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(45, 1539, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_C), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "C", 0))) __PYX_ERR(45, 1539, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(45, 1539, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_344matMatMult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_B, __pyx_v_C, __pyx_v_result, __pyx_v_fill);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_344matMatMult(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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscReal __pyx_t_4;
PetscErrorCode __pyx_t_5;
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":1540
*
* def matMatMult(self, Mat B, Mat C, Mat result=None, fill=None):
* 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":1541
* def matMatMult(self, Mat B, Mat C, Mat result=None, fill=None):
* 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":1542
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1543
* cdef PetscReal cfill = PETSC_DEFAULT
* if result is None:
* result = Mat() # <<<<<<<<<<<<<<
* elif result.mat != NULL:
* reuse = MAT_REUSE_MATRIX
*/
__pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1543, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_3));
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1542
* 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":1544
* if result is None:
* result = Mat()
* elif result.mat != NULL: # <<<<<<<<<<<<<<
* reuse = MAT_REUSE_MATRIX
* if fill is not None: cfill = asReal(fill)
*/
__pyx_t_2 = ((__pyx_v_result->mat != NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1545
* 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":1544
* 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":1546
* 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_2 = (__pyx_v_fill != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(45, 1546, __pyx_L1_error)
__pyx_v_cfill = __pyx_t_4;
}
/* "petsc4py/PETSc/Mat.pyx":1547
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1547, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1548
* if fill is not None: cfill = asReal(fill)
* CHKERR( MatMatMatMult(self.mat, B.mat, C.mat, reuse, cfill, &result.mat) )
* return result # <<<<<<<<<<<<<<
*
* def kron(self, Mat mat, Mat result=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1539
* return result
*
* def matMatMult(self, Mat B, Mat C, Mat result=None, fill=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* cdef PetscReal cfill = PETSC_DEFAULT
*/
/* function exit code */
__pyx_L1_error:;
__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":1550
* return result
*
* def kron(self, Mat mat, Mat result=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* if result is None:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_347kron(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_346kron[] = "Mat.kron(self, Mat mat, Mat result=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_347kron(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 0;
struct PyPetscMatObject *__pyx_v_result = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_result,0};
PyObject* values[2] = {0,0};
values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "kron") < 0)) __PYX_ERR(45, 1550, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
__pyx_v_result = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("kron", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1550, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.kron", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(45, 1550, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(45, 1550, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_346kron(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_result);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_346kron(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;
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("kron", 0);
__Pyx_INCREF((PyObject *)__pyx_v_result);
/* "petsc4py/PETSc/Mat.pyx":1551
*
* def kron(self, Mat mat, Mat result=None):
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<<
* if result is None:
* result = Mat()
*/
__pyx_v_reuse = MAT_INITIAL_MATRIX;
/* "petsc4py/PETSc/Mat.pyx":1552
* def kron(self, Mat mat, Mat result=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1553
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* if result is None:
* result = Mat() # <<<<<<<<<<<<<<
* elif result.mat != NULL:
* reuse = MAT_REUSE_MATRIX
*/
__pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1553, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_3));
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1552
* def kron(self, Mat mat, Mat result=None):
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* if result is None: # <<<<<<<<<<<<<<
* result = Mat()
* elif result.mat != NULL:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Mat.pyx":1554
* 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_2 = ((__pyx_v_result->mat != NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1555
* 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":1554
* 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":1556
* elif result.mat != NULL:
* reuse = MAT_REUSE_MATRIX
* CHKERR( MatSeqAIJKron(self.mat, mat.mat, reuse, &result.mat) ) # <<<<<<<<<<<<<<
* return result
*
*/
__pyx_t_4 = __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_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1556, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1557
* reuse = MAT_REUSE_MATRIX
* CHKERR( MatSeqAIJKron(self.mat, mat.mat, reuse, &result.mat) )
* return result # <<<<<<<<<<<<<<
*
* def bindToCPU(self, flg):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1550
* return result
*
* def kron(self, Mat mat, Mat result=None): # <<<<<<<<<<<<<<
* cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
* if result is None:
*/
/* function exit code */
__pyx_L1_error:;
__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":1559
* return result
*
* def bindToCPU(self, flg): # <<<<<<<<<<<<<<
* cdef PetscBool bindFlg = asBool(flg)
* CHKERR( MatBindToCPU(self.mat, bindFlg) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_349bindToCPU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_348bindToCPU[] = "Mat.bindToCPU(self, flg)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_349bindToCPU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flg = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flg,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flg)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bindToCPU") < 0)) __PYX_ERR(45, 1559, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flg = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("bindToCPU", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1559, __pyx_L3_error)
__pyx_L3_error:;
__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_348bindToCPU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_flg);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_348bindToCPU(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":1560
*
* def bindToCPU(self, flg):
* 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(45, 1560, __pyx_L1_error)
__pyx_v_bindFlg = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1561
* def bindToCPU(self, flg):
* cdef PetscBool bindFlg = asBool(flg)
* CHKERR( MatBindToCPU(self.mat, bindFlg) ) # <<<<<<<<<<<<<<
*
* def boundToCPU(self):
*/
__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(45, 1561, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1559
* return result
*
* def bindToCPU(self, flg): # <<<<<<<<<<<<<<
* cdef PetscBool bindFlg = asBool(flg)
* CHKERR( MatBindToCPU(self.mat, bindFlg) )
*/
/* 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":1563
* CHKERR( MatBindToCPU(self.mat, bindFlg) )
*
* def boundToCPU(self): # <<<<<<<<<<<<<<
* cdef PetscBool flg = PETSC_TRUE
* CHKERR( MatBoundToCPU(self.mat, &flg) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_351boundToCPU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_350boundToCPU[] = "Mat.boundToCPU(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_351boundToCPU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("boundToCPU (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("boundToCPU", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "boundToCPU", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_350boundToCPU(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_350boundToCPU(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":1564
*
* def boundToCPU(self):
* cdef PetscBool flg = PETSC_TRUE # <<<<<<<<<<<<<<
* CHKERR( MatBoundToCPU(self.mat, &flg) )
* return toBool(flg)
*/
__pyx_v_flg = PETSC_TRUE;
/* "petsc4py/PETSc/Mat.pyx":1565
* def boundToCPU(self):
* 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(45, 1565, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1566
* 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(45, 1566, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1563
* CHKERR( MatBindToCPU(self.mat, bindFlg) )
*
* def boundToCPU(self): # <<<<<<<<<<<<<<
* cdef PetscBool flg = PETSC_TRUE
* CHKERR( MatBoundToCPU(self.mat, &flg) )
*/
/* 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":1570
* # XXX factorization
*
* def getOrdering(self, ord_type): # <<<<<<<<<<<<<<
* cdef PetscMatOrderingType cval = NULL
* ord_type = str2bytes(ord_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_353getOrdering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_352getOrdering[] = "Mat.getOrdering(self, ord_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_353getOrdering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ord_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ord_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ord_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getOrdering") < 0)) __PYX_ERR(45, 1570, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_ord_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getOrdering", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1570, __pyx_L3_error)
__pyx_L3_error:;
__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_352getOrdering(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_ord_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_352getOrdering(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ord_type) {
MatOrderingType __pyx_v_cval;
struct PyPetscISObject *__pyx_v_rp = 0;
struct PyPetscISObject *__pyx_v_cp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getOrdering", 0);
__Pyx_INCREF(__pyx_v_ord_type);
/* "petsc4py/PETSc/Mat.pyx":1571
*
* def getOrdering(self, ord_type):
* cdef PetscMatOrderingType cval = NULL # <<<<<<<<<<<<<<
* ord_type = str2bytes(ord_type, &cval)
* cdef IS rp = IS(), cp = IS()
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/Mat.pyx":1572
* def getOrdering(self, ord_type):
* 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(45, 1572, __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":1573
* cdef PetscMatOrderingType cval = NULL
* ord_type = str2bytes(ord_type, &cval)
* cdef IS rp = IS(), cp = IS() # <<<<<<<<<<<<<<
* CHKERR( MatGetOrdering(self.mat, cval, &rp.iset, &cp.iset) )
* return (rp, cp)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_rp = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_cp = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1574
* ord_type = str2bytes(ord_type, &cval)
* cdef IS rp = IS(), cp = IS()
* CHKERR( MatGetOrdering(self.mat, cval, &rp.iset, &cp.iset) ) # <<<<<<<<<<<<<<
* return (rp, cp)
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOrdering(__pyx_v_self->mat, __pyx_v_cval, (&__pyx_v_rp->iset), (&__pyx_v_cp->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1574, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1575
* cdef IS rp = IS(), cp = IS()
* CHKERR( MatGetOrdering(self.mat, cval, &rp.iset, &cp.iset) )
* return (rp, cp) # <<<<<<<<<<<<<<
*
* def reorderForNonzeroDiagonal(self, IS isrow, IS iscol, atol=0):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1575, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_rp));
__Pyx_GIVEREF(((PyObject *)__pyx_v_rp));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_rp));
__Pyx_INCREF(((PyObject *)__pyx_v_cp));
__Pyx_GIVEREF(((PyObject *)__pyx_v_cp));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_cp));
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1570
* # XXX factorization
*
* def getOrdering(self, ord_type): # <<<<<<<<<<<<<<
* cdef PetscMatOrderingType cval = NULL
* ord_type = str2bytes(ord_type, &cval)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getOrdering", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_rp);
__Pyx_XDECREF((PyObject *)__pyx_v_cp);
__Pyx_XDECREF(__pyx_v_ord_type);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1577
* return (rp, cp)
*
* def reorderForNonzeroDiagonal(self, IS isrow, IS iscol, atol=0): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(atol)
* cdef PetscIS rp = isrow.iset, cp = iscol.iset
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_355reorderForNonzeroDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_354reorderForNonzeroDiagonal[] = "Mat.reorderForNonzeroDiagonal(self, IS isrow, IS iscol, atol=0)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_355reorderForNonzeroDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_isrow = 0;
struct PyPetscISObject *__pyx_v_iscol = 0;
PyObject *__pyx_v_atol = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_atol,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)__pyx_int_0);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("reorderForNonzeroDiagonal", 0, 2, 3, 1); __PYX_ERR(45, 1577, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_atol);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reorderForNonzeroDiagonal") < 0)) __PYX_ERR(45, 1577, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_isrow = ((struct PyPetscISObject *)values[0]);
__pyx_v_iscol = ((struct PyPetscISObject *)values[1]);
__pyx_v_atol = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("reorderForNonzeroDiagonal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1577, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.reorderForNonzeroDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(45, 1577, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(45, 1577, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_354reorderForNonzeroDiagonal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_atol);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_354reorderForNonzeroDiagonal(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":1578
*
* def reorderForNonzeroDiagonal(self, IS isrow, IS iscol, atol=0):
* 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(45, 1578, __pyx_L1_error)
__pyx_v_rval = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1579
* def reorderForNonzeroDiagonal(self, IS isrow, IS iscol, atol=0):
* 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":1580
* cdef PetscReal rval = asReal(atol)
* cdef PetscIS rp = isrow.iset, cp = iscol.iset
* CHKERR( MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp) ) # <<<<<<<<<<<<<<
*
* def factorLU(self, IS isrow, IS iscol, options=None):
*/
__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(45, 1580, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1577
* return (rp, cp)
*
* def reorderForNonzeroDiagonal(self, IS isrow, IS iscol, atol=0): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(atol)
* cdef PetscIS rp = isrow.iset, cp = iscol.iset
*/
/* 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":1582
* CHKERR( MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp) )
*
* def factorLU(self, IS isrow, IS iscol, options=None): # <<<<<<<<<<<<<<
* cdef PetscMatFactorInfo info
* matfactorinfo(PETSC_FALSE, PETSC_FALSE, options, &info)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_357factorLU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_356factorLU[] = "Mat.factorLU(self, IS isrow, IS iscol, options=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_357factorLU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_isrow = 0;
struct PyPetscISObject *__pyx_v_iscol = 0;
PyObject *__pyx_v_options = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_options,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("factorLU", 0, 2, 3, 1); __PYX_ERR(45, 1582, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorLU") < 0)) __PYX_ERR(45, 1582, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_isrow = ((struct PyPetscISObject *)values[0]);
__pyx_v_iscol = ((struct PyPetscISObject *)values[1]);
__pyx_v_options = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("factorLU", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1582, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.factorLU", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(45, 1582, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(45, 1582, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_356factorLU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_options);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_356factorLU(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":1584
* def factorLU(self, IS isrow, IS iscol, options=None):
* 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):
*/
__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(45, 1584, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1585
* 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):
* <void>self; <void>mat; <void>isrow; <void>iscol; <void>options; # unused
*/
__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(45, 1585, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1582
* CHKERR( MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp) )
*
* def factorLU(self, IS isrow, IS iscol, options=None): # <<<<<<<<<<<<<<
* cdef PetscMatFactorInfo info
* matfactorinfo(PETSC_FALSE, PETSC_FALSE, options, &info)
*/
/* 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":1586
* 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): # <<<<<<<<<<<<<<
* <void>self; <void>mat; <void>isrow; <void>iscol; <void>options; # unused
* raise NotImplementedError
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_359factorSymbolicLU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_358factorSymbolicLU[] = "Mat.factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_359factorSymbolicLU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 0;
struct PyPetscISObject *__pyx_v_isrow = 0;
struct PyPetscISObject *__pyx_v_iscol = 0;
PyObject *__pyx_v_options = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_options,0};
PyObject* values[4] = {0,0,0,0};
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("factorSymbolicLU", 0, 3, 4, 1); __PYX_ERR(45, 1586, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("factorSymbolicLU", 0, 3, 4, 2); __PYX_ERR(45, 1586, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorSymbolicLU") < 0)) __PYX_ERR(45, 1586, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
__pyx_v_isrow = ((struct PyPetscISObject *)values[1]);
__pyx_v_iscol = ((struct PyPetscISObject *)values[2]);
__pyx_v_options = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("factorSymbolicLU", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1586, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicLU", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(45, 1586, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(45, 1586, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(45, 1586, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_358factorSymbolicLU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_isrow, __pyx_v_iscol, __pyx_v_options);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_358factorSymbolicLU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, 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":1587
* CHKERR( MatLUFactor(self.mat, isrow.iset, iscol.iset, &info) )
* def factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None):
* <void>self; <void>mat; <void>isrow; <void>iscol; <void>options; # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
* def factorNumericLU(self, Mat mat, options=None):
*/
((void)__pyx_v_self);
((void)__pyx_v_mat);
((void)__pyx_v_isrow);
((void)__pyx_v_iscol);
((void)__pyx_v_options);
/* "petsc4py/PETSc/Mat.pyx":1588
* def factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None):
* <void>self; <void>mat; <void>isrow; <void>iscol; <void>options; # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
* def factorNumericLU(self, Mat mat, options=None):
* <void>self; <void>mat; <void>options; # unused
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(45, 1588, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1586
* 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): # <<<<<<<<<<<<<<
* <void>self; <void>mat; <void>isrow; <void>iscol; <void>options; # unused
* 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":1589
* <void>self; <void>mat; <void>isrow; <void>iscol; <void>options; # unused
* raise NotImplementedError
* def factorNumericLU(self, Mat mat, options=None): # <<<<<<<<<<<<<<
* <void>self; <void>mat; <void>options; # unused
* raise NotImplementedError
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_361factorNumericLU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_360factorNumericLU[] = "Mat.factorNumericLU(self, Mat mat, options=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_361factorNumericLU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 0;
PyObject *__pyx_v_options = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_options,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorNumericLU") < 0)) __PYX_ERR(45, 1589, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
__pyx_v_options = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("factorNumericLU", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1589, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.factorNumericLU", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(45, 1589, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_360factorNumericLU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_options);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_360factorNumericLU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, 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":1590
* raise NotImplementedError
* def factorNumericLU(self, Mat mat, options=None):
* <void>self; <void>mat; <void>options; # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
* def factorILU(self, IS isrow, IS iscol, options=None):
*/
((void)__pyx_v_self);
((void)__pyx_v_mat);
((void)__pyx_v_options);
/* "petsc4py/PETSc/Mat.pyx":1591
* def factorNumericLU(self, Mat mat, options=None):
* <void>self; <void>mat; <void>options; # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
* def factorILU(self, IS isrow, IS iscol, options=None):
* cdef PetscMatFactorInfo info
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(45, 1591, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1589
* <void>self; <void>mat; <void>isrow; <void>iscol; <void>options; # unused
* raise NotImplementedError
* def factorNumericLU(self, Mat mat, options=None): # <<<<<<<<<<<<<<
* <void>self; <void>mat; <void>options; # unused
* 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":1592
* <void>self; <void>mat; <void>options; # unused
* raise NotImplementedError
* def factorILU(self, IS isrow, IS iscol, options=None): # <<<<<<<<<<<<<<
* cdef PetscMatFactorInfo info
* matfactorinfo(PETSC_TRUE, PETSC_FALSE, options, &info)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_363factorILU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_362factorILU[] = "Mat.factorILU(self, IS isrow, IS iscol, options=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_363factorILU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_isrow = 0;
struct PyPetscISObject *__pyx_v_iscol = 0;
PyObject *__pyx_v_options = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_options,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("factorILU", 0, 2, 3, 1); __PYX_ERR(45, 1592, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorILU") < 0)) __PYX_ERR(45, 1592, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_isrow = ((struct PyPetscISObject *)values[0]);
__pyx_v_iscol = ((struct PyPetscISObject *)values[1]);
__pyx_v_options = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("factorILU", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1592, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.factorILU", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(45, 1592, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(45, 1592, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_362factorILU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_options);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_362factorILU(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":1594
* def factorILU(self, IS isrow, IS iscol, options=None):
* 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):
*/
__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(45, 1594, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1595
* 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):
* <void>self; <void>isrow; <void>iscol; <void>options; # unused
*/
__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(45, 1595, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1592
* <void>self; <void>mat; <void>options; # unused
* raise NotImplementedError
* def factorILU(self, IS isrow, IS iscol, options=None): # <<<<<<<<<<<<<<
* cdef PetscMatFactorInfo info
* matfactorinfo(PETSC_TRUE, PETSC_FALSE, options, &info)
*/
/* 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":1596
* 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): # <<<<<<<<<<<<<<
* <void>self; <void>isrow; <void>iscol; <void>options; # unused
* raise NotImplementedError
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_365factorSymbolicILU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_364factorSymbolicILU[] = "Mat.factorSymbolicILU(self, IS isrow, IS iscol, options=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_365factorSymbolicILU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_isrow = 0;
struct PyPetscISObject *__pyx_v_iscol = 0;
PyObject *__pyx_v_options = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_options,0};
PyObject* values[3] = {0,0,0};
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("factorSymbolicILU", 0, 2, 3, 1); __PYX_ERR(45, 1596, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorSymbolicILU") < 0)) __PYX_ERR(45, 1596, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_isrow = ((struct PyPetscISObject *)values[0]);
__pyx_v_iscol = ((struct PyPetscISObject *)values[1]);
__pyx_v_options = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("factorSymbolicILU", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1596, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicILU", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(45, 1596, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(45, 1596, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_364factorSymbolicILU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_options);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_364factorSymbolicILU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, 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":1597
* CHKERR( MatILUFactor(self.mat, isrow.iset, iscol.iset, &info) )
* def factorSymbolicILU(self, IS isrow, IS iscol, options=None):
* <void>self; <void>isrow; <void>iscol; <void>options; # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
*
*/
((void)__pyx_v_self);
((void)__pyx_v_isrow);
((void)__pyx_v_iscol);
((void)__pyx_v_options);
/* "petsc4py/PETSc/Mat.pyx":1598
* def factorSymbolicILU(self, IS isrow, IS iscol, options=None):
* <void>self; <void>isrow; <void>iscol; <void>options; # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
*
* def factorCholesky(self, IS isperm, options=None):
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(45, 1598, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1596
* 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): # <<<<<<<<<<<<<<
* <void>self; <void>isrow; <void>iscol; <void>options; # unused
* 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":1600
* raise NotImplementedError
*
* def factorCholesky(self, IS isperm, options=None): # <<<<<<<<<<<<<<
* cdef PetscMatFactorInfo info
* matfactorinfo(PETSC_FALSE, PETSC_TRUE, options, &info)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_367factorCholesky(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_366factorCholesky[] = "Mat.factorCholesky(self, IS isperm, options=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_367factorCholesky(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_isperm = 0;
PyObject *__pyx_v_options = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isperm,&__pyx_n_s_options,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isperm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorCholesky") < 0)) __PYX_ERR(45, 1600, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_isperm = ((struct PyPetscISObject *)values[0]);
__pyx_v_options = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("factorCholesky", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1600, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.factorCholesky", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isperm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(45, 1600, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_366factorCholesky(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_366factorCholesky(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":1602
* def factorCholesky(self, IS isperm, options=None):
* cdef PetscMatFactorInfo info
* matfactorinfo(PETSC_FALSE, PETSC_TRUE, options, &info) # <<<<<<<<<<<<<<
* CHKERR( MatCholeskyFactor(self.mat, isperm.iset, &info) )
* def factorSymbolicCholesky(self, IS isperm, options=None):
*/
__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(45, 1602, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1603
* cdef PetscMatFactorInfo info
* matfactorinfo(PETSC_FALSE, PETSC_TRUE, options, &info)
* CHKERR( MatCholeskyFactor(self.mat, isperm.iset, &info) ) # <<<<<<<<<<<<<<
* def factorSymbolicCholesky(self, IS isperm, options=None):
* <void>self; <void>isperm; <void>options; # unused
*/
__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(45, 1603, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1600
* raise NotImplementedError
*
* def factorCholesky(self, IS isperm, options=None): # <<<<<<<<<<<<<<
* cdef PetscMatFactorInfo info
* matfactorinfo(PETSC_FALSE, PETSC_TRUE, options, &info)
*/
/* 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":1604
* matfactorinfo(PETSC_FALSE, PETSC_TRUE, options, &info)
* CHKERR( MatCholeskyFactor(self.mat, isperm.iset, &info) )
* def factorSymbolicCholesky(self, IS isperm, options=None): # <<<<<<<<<<<<<<
* <void>self; <void>isperm; <void>options; # unused
* raise NotImplementedError
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_369factorSymbolicCholesky(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_368factorSymbolicCholesky[] = "Mat.factorSymbolicCholesky(self, IS isperm, options=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_369factorSymbolicCholesky(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_isperm = 0;
PyObject *__pyx_v_options = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isperm,&__pyx_n_s_options,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isperm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorSymbolicCholesky") < 0)) __PYX_ERR(45, 1604, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_isperm = ((struct PyPetscISObject *)values[0]);
__pyx_v_options = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("factorSymbolicCholesky", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1604, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicCholesky", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isperm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(45, 1604, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_368factorSymbolicCholesky(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_368factorSymbolicCholesky(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, 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":1605
* CHKERR( MatCholeskyFactor(self.mat, isperm.iset, &info) )
* def factorSymbolicCholesky(self, IS isperm, options=None):
* <void>self; <void>isperm; <void>options; # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
* def factorNumericCholesky(self, Mat mat, options=None):
*/
((void)__pyx_v_self);
((void)__pyx_v_isperm);
((void)__pyx_v_options);
/* "petsc4py/PETSc/Mat.pyx":1606
* def factorSymbolicCholesky(self, IS isperm, options=None):
* <void>self; <void>isperm; <void>options; # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
* def factorNumericCholesky(self, Mat mat, options=None):
* <void>self; <void>mat; <void>options; # unused
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(45, 1606, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1604
* matfactorinfo(PETSC_FALSE, PETSC_TRUE, options, &info)
* CHKERR( MatCholeskyFactor(self.mat, isperm.iset, &info) )
* def factorSymbolicCholesky(self, IS isperm, options=None): # <<<<<<<<<<<<<<
* <void>self; <void>isperm; <void>options; # unused
* 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":1607
* <void>self; <void>isperm; <void>options; # unused
* raise NotImplementedError
* def factorNumericCholesky(self, Mat mat, options=None): # <<<<<<<<<<<<<<
* <void>self; <void>mat; <void>options; # unused
* raise NotImplementedError
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_371factorNumericCholesky(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_370factorNumericCholesky[] = "Mat.factorNumericCholesky(self, Mat mat, options=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_371factorNumericCholesky(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 0;
PyObject *__pyx_v_options = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_options,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorNumericCholesky") < 0)) __PYX_ERR(45, 1607, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
__pyx_v_options = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("factorNumericCholesky", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1607, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.factorNumericCholesky", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(45, 1607, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_370factorNumericCholesky(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_options);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_370factorNumericCholesky(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, 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":1608
* raise NotImplementedError
* def factorNumericCholesky(self, Mat mat, options=None):
* <void>self; <void>mat; <void>options; # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
* def factorICC(self, IS isperm, options=None):
*/
((void)__pyx_v_self);
((void)__pyx_v_mat);
((void)__pyx_v_options);
/* "petsc4py/PETSc/Mat.pyx":1609
* def factorNumericCholesky(self, Mat mat, options=None):
* <void>self; <void>mat; <void>options; # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
* def factorICC(self, IS isperm, options=None):
* cdef PetscMatFactorInfo info
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(45, 1609, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1607
* <void>self; <void>isperm; <void>options; # unused
* raise NotImplementedError
* def factorNumericCholesky(self, Mat mat, options=None): # <<<<<<<<<<<<<<
* <void>self; <void>mat; <void>options; # unused
* 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":1610
* <void>self; <void>mat; <void>options; # unused
* raise NotImplementedError
* def factorICC(self, IS isperm, options=None): # <<<<<<<<<<<<<<
* cdef PetscMatFactorInfo info
* matfactorinfo(PETSC_TRUE, PETSC_TRUE, options, &info)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_373factorICC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_372factorICC[] = "Mat.factorICC(self, IS isperm, options=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_373factorICC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_isperm = 0;
PyObject *__pyx_v_options = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isperm,&__pyx_n_s_options,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isperm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorICC") < 0)) __PYX_ERR(45, 1610, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_isperm = ((struct PyPetscISObject *)values[0]);
__pyx_v_options = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("factorICC", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1610, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.factorICC", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isperm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(45, 1610, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_372factorICC(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_372factorICC(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":1612
* def factorICC(self, IS isperm, options=None):
* cdef PetscMatFactorInfo info
* matfactorinfo(PETSC_TRUE, PETSC_TRUE, options, &info) # <<<<<<<<<<<<<<
* CHKERR( MatICCFactor(self.mat, isperm.iset, &info) )
* def factorSymbolicICC(self, IS isperm, options=None):
*/
__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(45, 1612, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1613
* cdef PetscMatFactorInfo info
* matfactorinfo(PETSC_TRUE, PETSC_TRUE, options, &info)
* CHKERR( MatICCFactor(self.mat, isperm.iset, &info) ) # <<<<<<<<<<<<<<
* def factorSymbolicICC(self, IS isperm, options=None):
* <void>self; <void>isperm; <void>options; # unused
*/
__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(45, 1613, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1610
* <void>self; <void>mat; <void>options; # unused
* raise NotImplementedError
* def factorICC(self, IS isperm, options=None): # <<<<<<<<<<<<<<
* cdef PetscMatFactorInfo info
* matfactorinfo(PETSC_TRUE, PETSC_TRUE, options, &info)
*/
/* 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":1614
* matfactorinfo(PETSC_TRUE, PETSC_TRUE, options, &info)
* CHKERR( MatICCFactor(self.mat, isperm.iset, &info) )
* def factorSymbolicICC(self, IS isperm, options=None): # <<<<<<<<<<<<<<
* <void>self; <void>isperm; <void>options; # unused
* raise NotImplementedError
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_375factorSymbolicICC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_374factorSymbolicICC[] = "Mat.factorSymbolicICC(self, IS isperm, options=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_375factorSymbolicICC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_isperm = 0;
PyObject *__pyx_v_options = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isperm,&__pyx_n_s_options,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isperm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorSymbolicICC") < 0)) __PYX_ERR(45, 1614, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_isperm = ((struct PyPetscISObject *)values[0]);
__pyx_v_options = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("factorSymbolicICC", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1614, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicICC", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isperm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(45, 1614, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_374factorSymbolicICC(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_374factorSymbolicICC(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, 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":1615
* CHKERR( MatICCFactor(self.mat, isperm.iset, &info) )
* def factorSymbolicICC(self, IS isperm, options=None):
* <void>self; <void>isperm; <void>options; # unused # <<<<<<<<<<<<<<
* raise NotImplementedError
*
*/
((void)__pyx_v_self);
((void)__pyx_v_isperm);
((void)__pyx_v_options);
/* "petsc4py/PETSc/Mat.pyx":1616
* def factorSymbolicICC(self, IS isperm, options=None):
* <void>self; <void>isperm; <void>options; # unused
* raise NotImplementedError # <<<<<<<<<<<<<<
*
* def getInertia(self):
*/
__Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
__PYX_ERR(45, 1616, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1614
* matfactorinfo(PETSC_TRUE, PETSC_TRUE, options, &info)
* CHKERR( MatICCFactor(self.mat, isperm.iset, &info) )
* def factorSymbolicICC(self, IS isperm, options=None): # <<<<<<<<<<<<<<
* <void>self; <void>isperm; <void>options; # unused
* 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":1618
* raise NotImplementedError
*
* def getInertia(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = 0, ival2 = 0, ival3 = 0
* CHKERR( MatGetInertia(self.mat, &ival1, &ival2, &ival3) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_377getInertia(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_376getInertia[] = "Mat.getInertia(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_377getInertia(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getInertia (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getInertia", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInertia", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_376getInertia(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_376getInertia(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":1619
*
* def getInertia(self):
* 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":1620
* def getInertia(self):
* 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(45, 1620, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1621
* 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):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival1); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1621, __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(45, 1621, __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(45, 1621, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 1621, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
__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":1618
* raise NotImplementedError
*
* def getInertia(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = 0, ival2 = 0, ival3 = 0
* CHKERR( MatGetInertia(self.mat, &ival1, &ival2, &ival3) )
*/
/* 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":1623
* return (toInt(ival1), toInt(ival2), toInt(ival3))
*
* def setUnfactored(self): # <<<<<<<<<<<<<<
* CHKERR( MatSetUnfactored(self.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_379setUnfactored(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_378setUnfactored[] = "Mat.setUnfactored(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_379setUnfactored(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setUnfactored (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setUnfactored", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUnfactored", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_378setUnfactored(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_378setUnfactored(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":1624
*
* def setUnfactored(self):
* 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(45, 1624, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1623
* return (toInt(ival1), toInt(ival2), toInt(ival3))
*
* def setUnfactored(self): # <<<<<<<<<<<<<<
* CHKERR( MatSetUnfactored(self.mat) )
*
*/
/* 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":1628
* # IS
*
* def fixISLocalEmpty(self, fix): # <<<<<<<<<<<<<<
* cdef PetscBool cfix = asBool(fix)
* CHKERR( MatISFixLocalEmpty(self.mat, cfix) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_381fixISLocalEmpty(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_380fixISLocalEmpty[] = "Mat.fixISLocalEmpty(self, fix)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_381fixISLocalEmpty(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_fix = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fix,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fix)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fixISLocalEmpty") < 0)) __PYX_ERR(45, 1628, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_fix = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("fixISLocalEmpty", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1628, __pyx_L3_error)
__pyx_L3_error:;
__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_380fixISLocalEmpty(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_fix);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_380fixISLocalEmpty(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":1629
*
* def fixISLocalEmpty(self, fix):
* 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(45, 1629, __pyx_L1_error)
__pyx_v_cfix = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1630
* def fixISLocalEmpty(self, fix):
* cdef PetscBool cfix = asBool(fix)
* CHKERR( MatISFixLocalEmpty(self.mat, cfix) ) # <<<<<<<<<<<<<<
*
* def getISLocalMat(self):
*/
__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(45, 1630, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1628
* # IS
*
* def fixISLocalEmpty(self, fix): # <<<<<<<<<<<<<<
* cdef PetscBool cfix = asBool(fix)
* CHKERR( MatISFixLocalEmpty(self.mat, cfix) )
*/
/* 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":1632
* CHKERR( MatISFixLocalEmpty(self.mat, cfix) )
*
* def getISLocalMat(self): # <<<<<<<<<<<<<<
* cdef Mat local = Mat()
* CHKERR( MatISGetLocalMat(self.mat, &local.mat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_383getISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_382getISLocalMat[] = "Mat.getISLocalMat(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_383getISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getISLocalMat (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getISLocalMat", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getISLocalMat", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_382getISLocalMat(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_382getISLocalMat(struct PyPetscMatObject *__pyx_v_self) {
struct PyPetscMatObject *__pyx_v_local = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getISLocalMat", 0);
/* "petsc4py/PETSc/Mat.pyx":1633
*
* def getISLocalMat(self):
* cdef Mat local = Mat() # <<<<<<<<<<<<<<
* CHKERR( MatISGetLocalMat(self.mat, &local.mat) )
* PetscINCREF(local.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1633, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_local = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1634
* def getISLocalMat(self):
* cdef Mat local = Mat()
* CHKERR( MatISGetLocalMat(self.mat, &local.mat) ) # <<<<<<<<<<<<<<
* PetscINCREF(local.obj)
* return local
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISGetLocalMat(__pyx_v_self->mat, (&__pyx_v_local->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1634, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1635
* cdef Mat local = Mat()
* CHKERR( MatISGetLocalMat(self.mat, &local.mat) )
* PetscINCREF(local.obj) # <<<<<<<<<<<<<<
* return local
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_local->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1636
* CHKERR( MatISGetLocalMat(self.mat, &local.mat) )
* PetscINCREF(local.obj)
* return local # <<<<<<<<<<<<<<
*
* def restoreISLocalMat(self, Mat local not None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_local));
__pyx_r = ((PyObject *)__pyx_v_local);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1632
* CHKERR( MatISFixLocalEmpty(self.mat, cfix) )
*
* def getISLocalMat(self): # <<<<<<<<<<<<<<
* cdef Mat local = Mat()
* CHKERR( MatISGetLocalMat(self.mat, &local.mat) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getISLocalMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_local);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1638
* return local
*
* def restoreISLocalMat(self, Mat local not None): # <<<<<<<<<<<<<<
* CHKERR( MatISRestoreLocalMat(self.mat, &local.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_385restoreISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_384restoreISLocalMat[] = "Mat.restoreISLocalMat(self, Mat local)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_385restoreISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_local = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_local,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_local)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restoreISLocalMat") < 0)) __PYX_ERR(45, 1638, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_local = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("restoreISLocalMat", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1638, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreISLocalMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_local), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "local", 0))) __PYX_ERR(45, 1638, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_384restoreISLocalMat(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_local);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_384restoreISLocalMat(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":1639
*
* def restoreISLocalMat(self, Mat local not None):
* CHKERR( MatISRestoreLocalMat(self.mat, &local.mat) ) # <<<<<<<<<<<<<<
*
* def setISLocalMat(self, Mat local not 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(45, 1639, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1638
* return local
*
* def restoreISLocalMat(self, Mat local not None): # <<<<<<<<<<<<<<
* CHKERR( MatISRestoreLocalMat(self.mat, &local.mat) )
*
*/
/* 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":1641
* CHKERR( MatISRestoreLocalMat(self.mat, &local.mat) )
*
* def setISLocalMat(self, Mat local not None): # <<<<<<<<<<<<<<
* CHKERR( MatISSetLocalMat(self.mat, local.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_387setISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_386setISLocalMat[] = "Mat.setISLocalMat(self, Mat local)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_387setISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_local = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_local,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_local)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setISLocalMat") < 0)) __PYX_ERR(45, 1641, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_local = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setISLocalMat", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1641, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.setISLocalMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_local), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "local", 0))) __PYX_ERR(45, 1641, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_386setISLocalMat(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_local);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_386setISLocalMat(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":1642
*
* def setISLocalMat(self, Mat local not None):
* CHKERR( MatISSetLocalMat(self.mat, local.mat) ) # <<<<<<<<<<<<<<
*
* def setISPreallocation(self, nnz, onnz):
*/
__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(45, 1642, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1641
* CHKERR( MatISRestoreLocalMat(self.mat, &local.mat) )
*
* def setISLocalMat(self, Mat local not None): # <<<<<<<<<<<<<<
* CHKERR( MatISSetLocalMat(self.mat, local.mat) )
*
*/
/* 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":1644
* CHKERR( MatISSetLocalMat(self.mat, local.mat) )
*
* def setISPreallocation(self, nnz, onnz): # <<<<<<<<<<<<<<
* cdef PetscInt *cnnz = NULL
* cdef PetscInt *connz = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_389setISPreallocation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_388setISPreallocation[] = "Mat.setISPreallocation(self, nnz, onnz)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_389setISPreallocation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_nnz = 0;
PyObject *__pyx_v_onnz = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nnz,&__pyx_n_s_onnz,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_onnz)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setISPreallocation", 1, 2, 2, 1); __PYX_ERR(45, 1644, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setISPreallocation") < 0)) __PYX_ERR(45, 1644, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_nnz = values[0];
__pyx_v_onnz = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setISPreallocation", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1644, __pyx_L3_error)
__pyx_L3_error:;
__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_388setISPreallocation(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nnz, __pyx_v_onnz);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_388setISPreallocation(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":1645
*
* def setISPreallocation(self, nnz, onnz):
* cdef PetscInt *cnnz = NULL # <<<<<<<<<<<<<<
* cdef PetscInt *connz = NULL
* nnz = iarray_i(nnz, NULL, &cnnz)
*/
__pyx_v_cnnz = NULL;
/* "petsc4py/PETSc/Mat.pyx":1646
* def setISPreallocation(self, nnz, onnz):
* 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":1647
* 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(45, 1647, __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":1648
* 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(45, 1648, __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":1649
* 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(45, 1649, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1650
* 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":1644
* CHKERR( MatISSetLocalMat(self.mat, local.mat) )
*
* def setISPreallocation(self, nnz, onnz): # <<<<<<<<<<<<<<
* cdef PetscInt *cnnz = NULL
* cdef PetscInt *connz = NULL
*/
/* 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":1654
* # LRC
*
* def getLRCMats(self): # <<<<<<<<<<<<<<
* cdef Mat A = Mat()
* cdef Mat U = Mat()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_391getLRCMats(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_390getLRCMats[] = "Mat.getLRCMats(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_391getLRCMats(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getLRCMats (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getLRCMats", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLRCMats", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_390getLRCMats(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_390getLRCMats(struct PyPetscMatObject *__pyx_v_self) {
struct PyPetscMatObject *__pyx_v_A = 0;
struct PyPetscMatObject *__pyx_v_U = 0;
struct PyPetscVecObject *__pyx_v_c = 0;
struct PyPetscMatObject *__pyx_v_V = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getLRCMats", 0);
/* "petsc4py/PETSc/Mat.pyx":1655
*
* def getLRCMats(self):
* cdef Mat A = Mat() # <<<<<<<<<<<<<<
* cdef Mat U = Mat()
* cdef Vec c = Vec()
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1655, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_A = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1656
* def getLRCMats(self):
* cdef Mat A = Mat()
* cdef Mat U = Mat() # <<<<<<<<<<<<<<
* cdef Vec c = Vec()
* cdef Mat V = Mat()
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1656, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_U = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1657
* cdef Mat A = Mat()
* cdef Mat U = Mat()
* cdef Vec c = Vec() # <<<<<<<<<<<<<<
* cdef Mat V = Mat()
* CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) )
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1657, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1658
* cdef Mat U = Mat()
* cdef Vec c = Vec()
* cdef Mat V = Mat() # <<<<<<<<<<<<<<
* CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) )
* PetscINCREF(A.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1658, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_V = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1659
* cdef Vec c = Vec()
* cdef Mat V = Mat()
* CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) ) # <<<<<<<<<<<<<<
* PetscINCREF(A.obj)
* PetscINCREF(U.obj)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatLRCGetMats(__pyx_v_self->mat, (&__pyx_v_A->mat), (&__pyx_v_U->mat), (&__pyx_v_c->vec), (&__pyx_v_V->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1659, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1660
* cdef Mat V = Mat()
* CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) )
* PetscINCREF(A.obj) # <<<<<<<<<<<<<<
* PetscINCREF(U.obj)
* PetscINCREF(c.obj)
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1661
* CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) )
* PetscINCREF(A.obj)
* PetscINCREF(U.obj) # <<<<<<<<<<<<<<
* PetscINCREF(c.obj)
* PetscINCREF(V.obj)
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_U->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1662
* PetscINCREF(A.obj)
* PetscINCREF(U.obj)
* PetscINCREF(c.obj) # <<<<<<<<<<<<<<
* PetscINCREF(V.obj)
* return (A, U, c, V)
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_c->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1663
* PetscINCREF(U.obj)
* PetscINCREF(c.obj)
* PetscINCREF(V.obj) # <<<<<<<<<<<<<<
* return (A, U, c, V)
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_V->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1664
* PetscINCREF(c.obj)
* PetscINCREF(V.obj)
* return (A, U, c, V) # <<<<<<<<<<<<<<
*
* # H2Opus
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1664, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_A));
__Pyx_GIVEREF(((PyObject *)__pyx_v_A));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_A));
__Pyx_INCREF(((PyObject *)__pyx_v_U));
__Pyx_GIVEREF(((PyObject *)__pyx_v_U));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_U));
__Pyx_INCREF(((PyObject *)__pyx_v_c));
__Pyx_GIVEREF(((PyObject *)__pyx_v_c));
PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_c));
__Pyx_INCREF(((PyObject *)__pyx_v_V));
__Pyx_GIVEREF(((PyObject *)__pyx_v_V));
PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_V));
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1654
* # LRC
*
* def getLRCMats(self): # <<<<<<<<<<<<<<
* cdef Mat A = Mat()
* cdef Mat U = Mat()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getLRCMats", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_A);
__Pyx_XDECREF((PyObject *)__pyx_v_U);
__Pyx_XDECREF((PyObject *)__pyx_v_c);
__Pyx_XDECREF((PyObject *)__pyx_v_V);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1668
* # H2Opus
*
* def H2OpusOrthogonalize(self): # <<<<<<<<<<<<<<
* CHKERR( MatH2OpusOrthogonalize(self.mat) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_393H2OpusOrthogonalize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_392H2OpusOrthogonalize[] = "Mat.H2OpusOrthogonalize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_393H2OpusOrthogonalize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("H2OpusOrthogonalize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("H2OpusOrthogonalize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "H2OpusOrthogonalize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_392H2OpusOrthogonalize(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_392H2OpusOrthogonalize(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":1669
*
* def H2OpusOrthogonalize(self):
* 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(45, 1669, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1670
* def H2OpusOrthogonalize(self):
* CHKERR( MatH2OpusOrthogonalize(self.mat) )
* return self # <<<<<<<<<<<<<<
*
* def H2OpusCompress(self, tol):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1668
* # H2Opus
*
* def H2OpusOrthogonalize(self): # <<<<<<<<<<<<<<
* CHKERR( MatH2OpusOrthogonalize(self.mat) )
* return self
*/
/* 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":1672
* return self
*
* def H2OpusCompress(self, tol): # <<<<<<<<<<<<<<
* cdef PetscReal _tol = asReal(tol)
* CHKERR( MatH2OpusCompress(self.mat, _tol) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_395H2OpusCompress(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_394H2OpusCompress[] = "Mat.H2OpusCompress(self, tol)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_395H2OpusCompress(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tol = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "H2OpusCompress") < 0)) __PYX_ERR(45, 1672, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_tol = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("H2OpusCompress", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1672, __pyx_L3_error)
__pyx_L3_error:;
__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_394H2OpusCompress(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_tol);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_394H2OpusCompress(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":1673
*
* def H2OpusCompress(self, tol):
* 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(45, 1673, __pyx_L1_error)
__pyx_v__tol = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1674
* def H2OpusCompress(self, tol):
* 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(45, 1674, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1675
* cdef PetscReal _tol = asReal(tol)
* CHKERR( MatH2OpusCompress(self.mat, _tol) )
* return self # <<<<<<<<<<<<<<
*
* def H2OpusLowRankUpdate(self, Mat U, Mat V=None, s = 1.0):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1672
* return self
*
* def H2OpusCompress(self, tol): # <<<<<<<<<<<<<<
* cdef PetscReal _tol = asReal(tol)
* CHKERR( MatH2OpusCompress(self.mat, _tol) )
*/
/* 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":1677
* return self
*
* def H2OpusLowRankUpdate(self, Mat U, Mat V=None, s = 1.0): # <<<<<<<<<<<<<<
* cdef PetscScalar _s = asScalar(s)
* cdef PetscMat vmat = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_397H2OpusLowRankUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_396H2OpusLowRankUpdate[] = "Mat.H2OpusLowRankUpdate(self, Mat U, Mat V=None, s=1.0)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_397H2OpusLowRankUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_U = 0;
struct PyPetscMatObject *__pyx_v_V = 0;
PyObject *__pyx_v_s = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_U,&__pyx_n_s_V,&__pyx_n_s_s_2,0};
PyObject* values[3] = {0,0,0};
values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None);
values[2] = ((PyObject *)__pyx_float_1_0);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_s_2);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "H2OpusLowRankUpdate") < 0)) __PYX_ERR(45, 1677, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_U = ((struct PyPetscMatObject *)values[0]);
__pyx_v_V = ((struct PyPetscMatObject *)values[1]);
__pyx_v_s = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("H2OpusLowRankUpdate", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1677, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.H2OpusLowRankUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_U), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "U", 0))) __PYX_ERR(45, 1677, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_V), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "V", 0))) __PYX_ERR(45, 1677, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_396H2OpusLowRankUpdate(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_U, __pyx_v_V, __pyx_v_s);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_396H2OpusLowRankUpdate(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;
int __pyx_t_3;
Mat __pyx_t_4;
PetscErrorCode __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("H2OpusLowRankUpdate", 0);
/* "petsc4py/PETSc/Mat.pyx":1678
*
* def H2OpusLowRankUpdate(self, Mat U, Mat V=None, s = 1.0):
* cdef PetscScalar _s = asScalar(s) # <<<<<<<<<<<<<<
* cdef PetscMat vmat = NULL
* if V is not None:
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_s); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(45, 1678, __pyx_L1_error)
__pyx_v__s = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1679
* def H2OpusLowRankUpdate(self, Mat U, Mat V=None, s = 1.0):
* 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":1680
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/Mat.pyx":1681
* cdef PetscMat vmat = NULL
* if V is not None:
* vmat = V.mat # <<<<<<<<<<<<<<
* CHKERR( MatH2OpusLowRankUpdate(self.mat, U.mat, vmat, _s) )
* return self
*/
__pyx_t_4 = __pyx_v_V->mat;
__pyx_v_vmat = __pyx_t_4;
/* "petsc4py/PETSc/Mat.pyx":1680
* 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":1682
* if V is not None:
* vmat = V.mat
* CHKERR( MatH2OpusLowRankUpdate(self.mat, U.mat, vmat, _s) ) # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatH2OpusLowRankUpdate(__pyx_v_self->mat, __pyx_v_U->mat, __pyx_v_vmat, __pyx_v__s)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1682, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1683
* vmat = V.mat
* CHKERR( MatH2OpusLowRankUpdate(self.mat, U.mat, vmat, _s) )
* return self # <<<<<<<<<<<<<<
*
* # MUMPS
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1677
* return self
*
* def H2OpusLowRankUpdate(self, Mat U, Mat V=None, s = 1.0): # <<<<<<<<<<<<<<
* cdef PetscScalar _s = asScalar(s)
* cdef PetscMat vmat = NULL
*/
/* 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":1687
* # MUMPS
*
* def setMumpsIcntl(self, icntl, ival): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscInt _ival = asInt(ival)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_399setMumpsIcntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_398setMumpsIcntl[] = "Mat.setMumpsIcntl(self, icntl, ival)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_399setMumpsIcntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_icntl = 0;
PyObject *__pyx_v_ival = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,&__pyx_n_s_ival,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ival)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setMumpsIcntl", 1, 2, 2, 1); __PYX_ERR(45, 1687, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMumpsIcntl") < 0)) __PYX_ERR(45, 1687, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_icntl = values[0];
__pyx_v_ival = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMumpsIcntl", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1687, __pyx_L3_error)
__pyx_L3_error:;
__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_398setMumpsIcntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl, __pyx_v_ival);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_398setMumpsIcntl(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":1688
*
* def setMumpsIcntl(self, icntl, ival):
* 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(45, 1688, __pyx_L1_error)
__pyx_v__icntl = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1689
* def setMumpsIcntl(self, icntl, ival):
* 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(45, 1689, __pyx_L1_error)
__pyx_v__ival = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1690
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscInt _ival = asInt(ival)
* CHKERR( MatMumpsSetIcntl(self.mat, _icntl, _ival) ); # <<<<<<<<<<<<<<
*
* def getMumpsIcntl(self, icntl):
*/
__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(45, 1690, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1687
* # MUMPS
*
* def setMumpsIcntl(self, icntl, ival): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscInt _ival = asInt(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":1692
* CHKERR( MatMumpsSetIcntl(self.mat, _icntl, _ival) );
*
* def getMumpsIcntl(self, icntl): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscInt ival = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_401getMumpsIcntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_400getMumpsIcntl[] = "Mat.getMumpsIcntl(self, icntl)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_401getMumpsIcntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_icntl = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMumpsIcntl") < 0)) __PYX_ERR(45, 1692, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_icntl = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getMumpsIcntl", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1692, __pyx_L3_error)
__pyx_L3_error:;
__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_400getMumpsIcntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_400getMumpsIcntl(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":1693
*
* def getMumpsIcntl(self, icntl):
* 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(45, 1693, __pyx_L1_error)
__pyx_v__icntl = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1694
* def getMumpsIcntl(self, icntl):
* 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":1695
* 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(45, 1695, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1696
* cdef PetscInt ival = 0
* CHKERR( MatMumpsGetIcntl(self.mat, _icntl, &ival) );
* return toInt(ival) # <<<<<<<<<<<<<<
*
* def setMumpsCntl(self, icntl, val):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1696, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1692
* CHKERR( MatMumpsSetIcntl(self.mat, _icntl, _ival) );
*
* def getMumpsIcntl(self, icntl): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscInt ival = 0
*/
/* 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":1698
* return toInt(ival)
*
* def setMumpsCntl(self, icntl, val): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscReal _val = asReal(val)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_403setMumpsCntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_402setMumpsCntl[] = "Mat.setMumpsCntl(self, icntl, val)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_403setMumpsCntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_icntl = 0;
PyObject *__pyx_v_val = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,&__pyx_n_s_val,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setMumpsCntl", 1, 2, 2, 1); __PYX_ERR(45, 1698, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMumpsCntl") < 0)) __PYX_ERR(45, 1698, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_icntl = values[0];
__pyx_v_val = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMumpsCntl", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1698, __pyx_L3_error)
__pyx_L3_error:;
__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_402setMumpsCntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl, __pyx_v_val);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_402setMumpsCntl(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":1699
*
* def setMumpsCntl(self, icntl, val):
* 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(45, 1699, __pyx_L1_error)
__pyx_v__icntl = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1700
* def setMumpsCntl(self, icntl, val):
* 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(45, 1700, __pyx_L1_error)
__pyx_v__val = __pyx_t_2;
/* "petsc4py/PETSc/Mat.pyx":1701
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscReal _val = asReal(val)
* CHKERR( MatMumpsSetCntl(self.mat, _icntl, _val) ); # <<<<<<<<<<<<<<
*
* def getMumpsCntl(self, icntl):
*/
__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(45, 1701, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1698
* return toInt(ival)
*
* def setMumpsCntl(self, icntl, val): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscReal _val = asReal(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":1703
* CHKERR( MatMumpsSetCntl(self.mat, _icntl, _val) );
*
* def getMumpsCntl(self, icntl): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscReal val = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_405getMumpsCntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_404getMumpsCntl[] = "Mat.getMumpsCntl(self, icntl)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_405getMumpsCntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_icntl = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMumpsCntl") < 0)) __PYX_ERR(45, 1703, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_icntl = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getMumpsCntl", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1703, __pyx_L3_error)
__pyx_L3_error:;
__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_404getMumpsCntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_404getMumpsCntl(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":1704
*
* def getMumpsCntl(self, icntl):
* 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(45, 1704, __pyx_L1_error)
__pyx_v__icntl = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1705
* def getMumpsCntl(self, icntl):
* 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":1706
* 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(45, 1706, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1707
* cdef PetscReal val = 0
* CHKERR( MatMumpsGetCntl(self.mat, _icntl, &val) );
* return toReal(val) # <<<<<<<<<<<<<<
*
* def getMumpsInfo(self, icntl):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1707, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1703
* CHKERR( MatMumpsSetCntl(self.mat, _icntl, _val) );
*
* def getMumpsCntl(self, icntl): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscReal val = 0
*/
/* 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":1709
* return toReal(val)
*
* def getMumpsInfo(self, icntl): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscInt ival = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_407getMumpsInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_406getMumpsInfo[] = "Mat.getMumpsInfo(self, icntl)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_407getMumpsInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_icntl = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMumpsInfo") < 0)) __PYX_ERR(45, 1709, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_icntl = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getMumpsInfo", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1709, __pyx_L3_error)
__pyx_L3_error:;
__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_406getMumpsInfo(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_406getMumpsInfo(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":1710
*
* def getMumpsInfo(self, icntl):
* 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(45, 1710, __pyx_L1_error)
__pyx_v__icntl = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1711
* def getMumpsInfo(self, icntl):
* 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":1712
* 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(45, 1712, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1713
* cdef PetscInt ival = 0
* CHKERR( MatMumpsGetInfo(self.mat, _icntl, &ival) );
* return toInt(ival) # <<<<<<<<<<<<<<
*
* def getMumpsInfog(self, icntl):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1713, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1709
* return toReal(val)
*
* def getMumpsInfo(self, icntl): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscInt ival = 0
*/
/* 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":1715
* return toInt(ival)
*
* def getMumpsInfog(self, icntl): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscInt ival = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_409getMumpsInfog(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_408getMumpsInfog[] = "Mat.getMumpsInfog(self, icntl)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_409getMumpsInfog(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_icntl = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMumpsInfog") < 0)) __PYX_ERR(45, 1715, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_icntl = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getMumpsInfog", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1715, __pyx_L3_error)
__pyx_L3_error:;
__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_408getMumpsInfog(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_408getMumpsInfog(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":1716
*
* def getMumpsInfog(self, icntl):
* 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(45, 1716, __pyx_L1_error)
__pyx_v__icntl = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1717
* def getMumpsInfog(self, icntl):
* 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":1718
* 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(45, 1718, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1719
* cdef PetscInt ival = 0
* CHKERR( MatMumpsGetInfog(self.mat, _icntl, &ival) );
* return toInt(ival) # <<<<<<<<<<<<<<
*
* def getMumpsRinfo(self, icntl):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1719, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1715
* return toInt(ival)
*
* def getMumpsInfog(self, icntl): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscInt ival = 0
*/
/* 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":1721
* return toInt(ival)
*
* def getMumpsRinfo(self, icntl): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscReal val = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_411getMumpsRinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_410getMumpsRinfo[] = "Mat.getMumpsRinfo(self, icntl)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_411getMumpsRinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_icntl = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMumpsRinfo") < 0)) __PYX_ERR(45, 1721, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_icntl = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getMumpsRinfo", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1721, __pyx_L3_error)
__pyx_L3_error:;
__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_410getMumpsRinfo(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_410getMumpsRinfo(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":1722
*
* def getMumpsRinfo(self, icntl):
* 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(45, 1722, __pyx_L1_error)
__pyx_v__icntl = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1723
* def getMumpsRinfo(self, icntl):
* 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":1724
* 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(45, 1724, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1725
* cdef PetscReal val = 0
* CHKERR( MatMumpsGetRinfo(self.mat, _icntl, &val) );
* return toReal(val) # <<<<<<<<<<<<<<
*
* def getMumpsRinfog(self, icntl):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1725, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1721
* return toInt(ival)
*
* def getMumpsRinfo(self, icntl): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscReal val = 0
*/
/* 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":1727
* return toReal(val)
*
* def getMumpsRinfog(self, icntl): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscReal val = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_413getMumpsRinfog(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_412getMumpsRinfog[] = "Mat.getMumpsRinfog(self, icntl)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_413getMumpsRinfog(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_icntl = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMumpsRinfog") < 0)) __PYX_ERR(45, 1727, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_icntl = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getMumpsRinfog", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1727, __pyx_L3_error)
__pyx_L3_error:;
__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_412getMumpsRinfog(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_412getMumpsRinfog(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":1728
*
* def getMumpsRinfog(self, icntl):
* 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(45, 1728, __pyx_L1_error)
__pyx_v__icntl = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1729
* def getMumpsRinfog(self, icntl):
* 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":1730
* 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(45, 1730, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1731
* 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(45, 1731, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1727
* return toReal(val)
*
* def getMumpsRinfog(self, icntl): # <<<<<<<<<<<<<<
* cdef PetscInt _icntl = asInt(icntl)
* cdef PetscReal val = 0
*/
/* 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":1735
* # solve
*
* def solveForward(self, Vec b, Vec x): # <<<<<<<<<<<<<<
* CHKERR( MatForwardSolve(self.mat, b.vec, x.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_415solveForward(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_414solveForward[] = "Mat.solveForward(self, Vec b, Vec x)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_415solveForward(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_b = 0;
struct PyPetscVecObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("solveForward", 1, 2, 2, 1); __PYX_ERR(45, 1735, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solveForward") < 0)) __PYX_ERR(45, 1735, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_b = ((struct PyPetscVecObject *)values[0]);
__pyx_v_x = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("solveForward", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1735, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.solveForward", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(45, 1735, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(45, 1735, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_414solveForward(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_414solveForward(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":1736
*
* def solveForward(self, Vec b, Vec x):
* CHKERR( MatForwardSolve(self.mat, b.vec, x.vec) ) # <<<<<<<<<<<<<<
*
* def solveBackward(self, Vec b, Vec x):
*/
__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(45, 1736, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1735
* # solve
*
* def solveForward(self, Vec b, Vec x): # <<<<<<<<<<<<<<
* CHKERR( MatForwardSolve(self.mat, b.vec, x.vec) )
*
*/
/* 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":1738
* CHKERR( MatForwardSolve(self.mat, b.vec, x.vec) )
*
* def solveBackward(self, Vec b, Vec x): # <<<<<<<<<<<<<<
* CHKERR( MatBackwardSolve(self.mat, b.vec, x.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_417solveBackward(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_416solveBackward[] = "Mat.solveBackward(self, Vec b, Vec x)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_417solveBackward(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_b = 0;
struct PyPetscVecObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("solveBackward", 1, 2, 2, 1); __PYX_ERR(45, 1738, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solveBackward") < 0)) __PYX_ERR(45, 1738, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_b = ((struct PyPetscVecObject *)values[0]);
__pyx_v_x = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("solveBackward", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1738, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.solveBackward", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(45, 1738, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(45, 1738, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_416solveBackward(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_416solveBackward(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":1739
*
* def solveBackward(self, Vec b, Vec x):
* CHKERR( MatBackwardSolve(self.mat, b.vec, x.vec) ) # <<<<<<<<<<<<<<
*
* def solve(self, Vec b, Vec x):
*/
__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(45, 1739, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1738
* CHKERR( MatForwardSolve(self.mat, b.vec, x.vec) )
*
* def solveBackward(self, Vec b, Vec x): # <<<<<<<<<<<<<<
* CHKERR( MatBackwardSolve(self.mat, b.vec, x.vec) )
*
*/
/* 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":1741
* CHKERR( MatBackwardSolve(self.mat, b.vec, x.vec) )
*
* def solve(self, Vec b, Vec x): # <<<<<<<<<<<<<<
* CHKERR( MatSolve(self.mat, b.vec, x.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_419solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_418solve[] = "Mat.solve(self, Vec b, Vec x)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_419solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_b = 0;
struct PyPetscVecObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, 1); __PYX_ERR(45, 1741, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solve") < 0)) __PYX_ERR(45, 1741, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_b = ((struct PyPetscVecObject *)values[0]);
__pyx_v_x = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1741, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(45, 1741, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(45, 1741, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_418solve(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_418solve(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":1742
*
* def solve(self, Vec b, Vec x):
* CHKERR( MatSolve(self.mat, b.vec, x.vec) ) # <<<<<<<<<<<<<<
*
* def solveTranspose(self, Vec b, Vec x):
*/
__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(45, 1742, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1741
* CHKERR( MatBackwardSolve(self.mat, b.vec, x.vec) )
*
* def solve(self, Vec b, Vec x): # <<<<<<<<<<<<<<
* CHKERR( MatSolve(self.mat, b.vec, x.vec) )
*
*/
/* 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":1744
* CHKERR( MatSolve(self.mat, b.vec, x.vec) )
*
* def solveTranspose(self, Vec b, Vec x): # <<<<<<<<<<<<<<
* CHKERR( MatSolveTranspose(self.mat, b.vec, x.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_421solveTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_420solveTranspose[] = "Mat.solveTranspose(self, Vec b, Vec x)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_421solveTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_b = 0;
struct PyPetscVecObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("solveTranspose", 1, 2, 2, 1); __PYX_ERR(45, 1744, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solveTranspose") < 0)) __PYX_ERR(45, 1744, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_b = ((struct PyPetscVecObject *)values[0]);
__pyx_v_x = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("solveTranspose", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1744, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.solveTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(45, 1744, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(45, 1744, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_420solveTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_420solveTranspose(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":1745
*
* def solveTranspose(self, Vec b, Vec x):
* CHKERR( MatSolveTranspose(self.mat, b.vec, x.vec) ) # <<<<<<<<<<<<<<
*
* def solveAdd(self, Vec b, Vec y, Vec x):
*/
__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(45, 1745, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1744
* CHKERR( MatSolve(self.mat, b.vec, x.vec) )
*
* def solveTranspose(self, Vec b, Vec x): # <<<<<<<<<<<<<<
* CHKERR( MatSolveTranspose(self.mat, b.vec, x.vec) )
*
*/
/* 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":1747
* CHKERR( MatSolveTranspose(self.mat, b.vec, x.vec) )
*
* def solveAdd(self, Vec b, Vec y, Vec x): # <<<<<<<<<<<<<<
* CHKERR( MatSolveAdd(self.mat, b.vec, y.vec, x.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_423solveAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_422solveAdd[] = "Mat.solveAdd(self, Vec b, Vec y, Vec x)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_423solveAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_b = 0;
struct PyPetscVecObject *__pyx_v_y = 0;
struct PyPetscVecObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_y,&__pyx_n_s_x,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("solveAdd", 1, 3, 3, 1); __PYX_ERR(45, 1747, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("solveAdd", 1, 3, 3, 2); __PYX_ERR(45, 1747, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solveAdd") < 0)) __PYX_ERR(45, 1747, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_b = ((struct PyPetscVecObject *)values[0]);
__pyx_v_y = ((struct PyPetscVecObject *)values[1]);
__pyx_v_x = ((struct PyPetscVecObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("solveAdd", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1747, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.solveAdd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(45, 1747, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(45, 1747, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(45, 1747, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_422solveAdd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_y, __pyx_v_x);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_422solveAdd(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":1748
*
* def solveAdd(self, Vec b, Vec y, Vec x):
* CHKERR( MatSolveAdd(self.mat, b.vec, y.vec, x.vec) ) # <<<<<<<<<<<<<<
*
* def solveTransposeAdd(self, Vec b, Vec y, Vec x):
*/
__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(45, 1748, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1747
* CHKERR( MatSolveTranspose(self.mat, b.vec, x.vec) )
*
* def solveAdd(self, Vec b, Vec y, Vec x): # <<<<<<<<<<<<<<
* CHKERR( MatSolveAdd(self.mat, b.vec, y.vec, x.vec) )
*
*/
/* 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":1750
* CHKERR( MatSolveAdd(self.mat, b.vec, y.vec, x.vec) )
*
* def solveTransposeAdd(self, Vec b, Vec y, Vec x): # <<<<<<<<<<<<<<
* CHKERR( MatSolveTransposeAdd(self.mat, b.vec, y.vec, x.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_425solveTransposeAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_424solveTransposeAdd[] = "Mat.solveTransposeAdd(self, Vec b, Vec y, Vec x)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_425solveTransposeAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_b = 0;
struct PyPetscVecObject *__pyx_v_y = 0;
struct PyPetscVecObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_y,&__pyx_n_s_x,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("solveTransposeAdd", 1, 3, 3, 1); __PYX_ERR(45, 1750, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("solveTransposeAdd", 1, 3, 3, 2); __PYX_ERR(45, 1750, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solveTransposeAdd") < 0)) __PYX_ERR(45, 1750, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_b = ((struct PyPetscVecObject *)values[0]);
__pyx_v_y = ((struct PyPetscVecObject *)values[1]);
__pyx_v_x = ((struct PyPetscVecObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("solveTransposeAdd", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1750, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.solveTransposeAdd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(45, 1750, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(45, 1750, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(45, 1750, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_424solveTransposeAdd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_y, __pyx_v_x);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_424solveTransposeAdd(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":1751
*
* def solveTransposeAdd(self, Vec b, Vec y, Vec x):
* CHKERR( MatSolveTransposeAdd(self.mat, b.vec, y.vec, x.vec) ) # <<<<<<<<<<<<<<
*
* def matSolve(self, Mat B, Mat X):
*/
__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(45, 1751, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1750
* CHKERR( MatSolveAdd(self.mat, b.vec, y.vec, x.vec) )
*
* def solveTransposeAdd(self, Vec b, Vec y, Vec x): # <<<<<<<<<<<<<<
* CHKERR( MatSolveTransposeAdd(self.mat, b.vec, y.vec, x.vec) )
*
*/
/* 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":1753
* CHKERR( MatSolveTransposeAdd(self.mat, b.vec, y.vec, x.vec) )
*
* def matSolve(self, Mat B, Mat X): # <<<<<<<<<<<<<<
* CHKERR( MatMatSolve(self.mat, B.mat, X.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_427matSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_426matSolve[] = "Mat.matSolve(self, Mat B, Mat X)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_427matSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_B = 0;
struct PyPetscMatObject *__pyx_v_X = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_B,&__pyx_n_s_X,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("matSolve", 1, 2, 2, 1); __PYX_ERR(45, 1753, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matSolve") < 0)) __PYX_ERR(45, 1753, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_B = ((struct PyPetscMatObject *)values[0]);
__pyx_v_X = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("matSolve", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1753, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.matSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_B), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(45, 1753, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(45, 1753, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_426matSolve(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_B, __pyx_v_X);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_426matSolve(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":1754
*
* def matSolve(self, Mat B, Mat X):
* 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(45, 1754, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1753
* CHKERR( MatSolveTransposeAdd(self.mat, b.vec, y.vec, x.vec) )
*
* def matSolve(self, Mat B, Mat X): # <<<<<<<<<<<<<<
* CHKERR( MatMatSolve(self.mat, B.mat, X.mat) )
*
*/
/* 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":1758
* # dense matrices
*
* def setDenseLDA(self, lda): # <<<<<<<<<<<<<<
* cdef PetscInt _ilda = asInt(lda)
* CHKERR( MatDenseSetLDA(self.mat, _ilda) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_429setDenseLDA(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_428setDenseLDA[] = "Mat.setDenseLDA(self, lda)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_429setDenseLDA(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_lda = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lda,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDenseLDA") < 0)) __PYX_ERR(45, 1758, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_lda = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDenseLDA", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1758, __pyx_L3_error)
__pyx_L3_error:;
__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_428setDenseLDA(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_lda);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_428setDenseLDA(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":1759
*
* def setDenseLDA(self, lda):
* 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(45, 1759, __pyx_L1_error)
__pyx_v__ilda = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1760
* def setDenseLDA(self, lda):
* cdef PetscInt _ilda = asInt(lda)
* CHKERR( MatDenseSetLDA(self.mat, _ilda) ) # <<<<<<<<<<<<<<
*
* def getDenseLDA(self):
*/
__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(45, 1760, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1758
* # dense matrices
*
* def setDenseLDA(self, lda): # <<<<<<<<<<<<<<
* cdef PetscInt _ilda = asInt(lda)
* CHKERR( MatDenseSetLDA(self.mat, _ilda) )
*/
/* 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":1762
* CHKERR( MatDenseSetLDA(self.mat, _ilda) )
*
* def getDenseLDA(self): # <<<<<<<<<<<<<<
* cdef PetscInt lda=0
* CHKERR( MatDenseGetLDA(self.mat, &lda) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_431getDenseLDA(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_430getDenseLDA[] = "Mat.getDenseLDA(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_431getDenseLDA(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDenseLDA (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDenseLDA", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDenseLDA", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_430getDenseLDA(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_430getDenseLDA(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":1763
*
* def getDenseLDA(self):
* cdef PetscInt lda=0 # <<<<<<<<<<<<<<
* CHKERR( MatDenseGetLDA(self.mat, &lda) )
* return toInt(lda)
*/
__pyx_v_lda = 0;
/* "petsc4py/PETSc/Mat.pyx":1764
* def getDenseLDA(self):
* 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(45, 1764, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1765
* cdef PetscInt lda=0
* CHKERR( MatDenseGetLDA(self.mat, &lda) )
* return toInt(lda) # <<<<<<<<<<<<<<
*
* def getDenseArray(self,readonly=False):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_lda); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1765, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1762
* CHKERR( MatDenseSetLDA(self.mat, _ilda) )
*
* def getDenseLDA(self): # <<<<<<<<<<<<<<
* cdef PetscInt lda=0
* CHKERR( MatDenseGetLDA(self.mat, &lda) )
*/
/* 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":1767
* return toInt(lda)
*
* def getDenseArray(self,readonly=False): # <<<<<<<<<<<<<<
* cdef PetscInt m=0, N=0, lda=0
* cdef PetscScalar *data = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_433getDenseArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_432getDenseArray[] = "Mat.getDenseArray(self, readonly=False)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_433getDenseArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_readonly = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_readonly,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_False);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_readonly);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getDenseArray") < 0)) __PYX_ERR(45, 1767, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_readonly = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getDenseArray", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1767, __pyx_L3_error)
__pyx_L3_error:;
__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_432getDenseArray(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_readonly);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_432getDenseArray(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_readonly) {
PetscInt __pyx_v_m;
PetscInt __pyx_v_N;
PetscInt __pyx_v_lda;
PetscScalar *__pyx_v_data;
int __pyx_v_typenum;
int __pyx_v_itemsize;
int __pyx_v_flags;
npy_intp __pyx_v_dims[2];
npy_intp __pyx_v_strides[2];
PyObject *__pyx_v_array = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDenseArray", 0);
/* "petsc4py/PETSc/Mat.pyx":1768
*
* def getDenseArray(self,readonly=False):
* 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":1769
* def getDenseArray(self,readonly=False):
* 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":1770
* 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(45, 1770, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1771
* 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(45, 1771, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1772
* 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(45, 1772, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1773
* 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(45, 1773, __pyx_L1_error)
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1774
* 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(45, 1774, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1773
* 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":1776
* 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(45, 1776, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/Mat.pyx":1777
* else:
* CHKERR( MatDenseGetArray(self.mat, &data) )
* cdef int typenum = NPY_PETSC_SCALAR # <<<<<<<<<<<<<<
* cdef int itemsize = <int>sizeof(PetscScalar)
* cdef int flags = NPY_ARRAY_FARRAY
*/
__pyx_v_typenum = NPY_PETSC_SCALAR;
/* "petsc4py/PETSc/Mat.pyx":1778
* CHKERR( MatDenseGetArray(self.mat, &data) )
* cdef int typenum = NPY_PETSC_SCALAR
* cdef int itemsize = <int>sizeof(PetscScalar) # <<<<<<<<<<<<<<
* cdef int flags = NPY_ARRAY_FARRAY
* cdef npy_intp dims[2], strides[2]
*/
__pyx_v_itemsize = ((int)(sizeof(PetscScalar)));
/* "petsc4py/PETSc/Mat.pyx":1779
* cdef int typenum = NPY_PETSC_SCALAR
* cdef int itemsize = <int>sizeof(PetscScalar)
* cdef int flags = NPY_ARRAY_FARRAY # <<<<<<<<<<<<<<
* cdef npy_intp dims[2], strides[2]
* dims[0] = <npy_intp>m; strides[0] = <npy_intp>sizeof(PetscScalar);
*/
__pyx_v_flags = NPY_ARRAY_FARRAY;
/* "petsc4py/PETSc/Mat.pyx":1781
* cdef int flags = 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));
* array = <object>PyArray_New(<PyTypeObject*>ndarray, 2, dims, typenum,
*/
(__pyx_v_dims[0]) = ((npy_intp)__pyx_v_m);
(__pyx_v_strides[0]) = ((npy_intp)(sizeof(PetscScalar)));
/* "petsc4py/PETSc/Mat.pyx":1782
* 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)); # <<<<<<<<<<<<<<
* array = <object>PyArray_New(<PyTypeObject*>ndarray, 2, dims, typenum,
* strides, data, itemsize, flags, NULL)
*/
(__pyx_v_dims[1]) = ((npy_intp)__pyx_v_N);
(__pyx_v_strides[1]) = ((npy_intp)(__pyx_v_lda * (sizeof(PetscScalar))));
/* "petsc4py/PETSc/Mat.pyx":1783
* dims[0] = <npy_intp>m; strides[0] = <npy_intp>sizeof(PetscScalar);
* dims[1] = <npy_intp>N; strides[1] = <npy_intp>(lda*sizeof(PetscScalar));
* array = <object>PyArray_New(<PyTypeObject*>ndarray, 2, dims, typenum, # <<<<<<<<<<<<<<
* strides, data, itemsize, flags, NULL)
* if readonly:
*/
__pyx_t_3 = ((PyObject *)PyArray_New(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc_ndarray), 2, __pyx_v_dims, __pyx_v_typenum, __pyx_v_strides, __pyx_v_data, __pyx_v_itemsize, __pyx_v_flags, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1783, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __pyx_t_3;
__Pyx_INCREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_array = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/Mat.pyx":1785
* array = <object>PyArray_New(<PyTypeObject*>ndarray, 2, dims, typenum,
* strides, data, itemsize, flags, NULL)
* 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(45, 1785, __pyx_L1_error)
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1786
* strides, data, itemsize, flags, NULL)
* 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(45, 1786, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1785
* array = <object>PyArray_New(<PyTypeObject*>ndarray, 2, dims, typenum,
* strides, data, itemsize, flags, NULL)
* if readonly: # <<<<<<<<<<<<<<
* CHKERR( MatDenseRestoreArrayRead(self.mat, <const PetscScalar**>&data) )
* else:
*/
goto __pyx_L4;
}
/* "petsc4py/PETSc/Mat.pyx":1788
* 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(45, 1788, __pyx_L1_error)
}
__pyx_L4:;
/* "petsc4py/PETSc/Mat.pyx":1789
* else:
* CHKERR( MatDenseRestoreArray(self.mat, &data) )
* return array # <<<<<<<<<<<<<<
*
* def getDenseLocalMatrix(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_array);
__pyx_r = __pyx_v_array;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1767
* return toInt(lda)
*
* def getDenseArray(self,readonly=False): # <<<<<<<<<<<<<<
* cdef PetscInt m=0, N=0, lda=0
* cdef PetscScalar *data = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getDenseArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_array);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1791
* return array
*
* def getDenseLocalMatrix(self): # <<<<<<<<<<<<<<
* cdef Mat mat = type(self)()
* CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_435getDenseLocalMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_434getDenseLocalMatrix[] = "Mat.getDenseLocalMatrix(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_435getDenseLocalMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDenseLocalMatrix (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDenseLocalMatrix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDenseLocalMatrix", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_434getDenseLocalMatrix(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_434getDenseLocalMatrix(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;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDenseLocalMatrix", 0);
/* "petsc4py/PETSc/Mat.pyx":1792
*
* def getDenseLocalMatrix(self):
* cdef Mat mat = type(self)() # <<<<<<<<<<<<<<
* CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) )
* PetscINCREF(mat.obj)
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1792, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(45, 1792, __pyx_L1_error)
__pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1793
* def getDenseLocalMatrix(self):
* cdef Mat mat = type(self)()
* CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) ) # <<<<<<<<<<<<<<
* PetscINCREF(mat.obj)
* return mat
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetLocalMatrix(__pyx_v_self->mat, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1793, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1794
* cdef Mat mat = type(self)()
* CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) )
* PetscINCREF(mat.obj) # <<<<<<<<<<<<<<
* return mat
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1795
* CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) )
* PetscINCREF(mat.obj)
* return mat # <<<<<<<<<<<<<<
*
* def getDenseColumnVec(self, i, mode='rw'):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_mat));
__pyx_r = ((PyObject *)__pyx_v_mat);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1791
* return array
*
* def getDenseLocalMatrix(self): # <<<<<<<<<<<<<<
* cdef Mat mat = type(self)()
* CHKERR( MatDenseGetLocalMatrix(self.mat, &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.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":1797
* return mat
*
* def getDenseColumnVec(self, i, mode='rw'): # <<<<<<<<<<<<<<
* if mode is None: mode = 'rw'
* if mode not in ['rw', 'r', 'w']:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_437getDenseColumnVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_436getDenseColumnVec[] = "Mat.getDenseColumnVec(self, i, mode='rw')";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_437getDenseColumnVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_i = 0;
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_mode,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)__pyx_n_s_rw);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getDenseColumnVec") < 0)) __PYX_ERR(45, 1797, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_i = values[0];
__pyx_v_mode = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getDenseColumnVec", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1797, __pyx_L3_error)
__pyx_L3_error:;
__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_436getDenseColumnVec(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_i, __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_436getDenseColumnVec(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;
int __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("getDenseColumnVec", 0);
__Pyx_INCREF(__pyx_v_mode);
/* "petsc4py/PETSc/Mat.pyx":1798
*
* def getDenseColumnVec(self, i, 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_n_s_rw);
__Pyx_DECREF_SET(__pyx_v_mode, __pyx_n_s_rw);
}
/* "petsc4py/PETSc/Mat.pyx":1799
* def getDenseColumnVec(self, i, mode='rw'):
* 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_3 = __pyx_v_mode;
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_rw, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1799, __pyx_L1_error)
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_r, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1799, __pyx_L1_error)
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_w, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1799, __pyx_L1_error)
__pyx_t_2 = __pyx_t_1;
__pyx_L5_bool_binop_done:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_1 = (__pyx_t_2 != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/Mat.pyx":1800
* 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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1800, __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(45, 1800, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1799
* def getDenseColumnVec(self, i, mode='rw'):
* 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":1801
* 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_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1801, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_v = ((struct PyPetscVecObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1802
* raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")
* cdef Vec v = Vec()
* cdef PetscInt _i = asInt(i) # <<<<<<<<<<<<<<
* if mode == 'rw':
* CHKERR( MatDenseGetColumnVec(self.mat, _i, &v.vec) )
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_i); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 1802, __pyx_L1_error)
__pyx_v__i = __pyx_t_4;
/* "petsc4py/PETSc/Mat.pyx":1803
* cdef Vec v = Vec()
* cdef PetscInt _i = asInt(i)
* if mode == 'rw': # <<<<<<<<<<<<<<
* CHKERR( MatDenseGetColumnVec(self.mat, _i, &v.vec) )
* elif mode == 'r':
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_rw, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1803, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Mat.pyx":1804
* cdef PetscInt _i = asInt(i)
* if mode == 'rw':
* CHKERR( MatDenseGetColumnVec(self.mat, _i, &v.vec) ) # <<<<<<<<<<<<<<
* elif mode == 'r':
* CHKERR( MatDenseGetColumnVecRead(self.mat, _i, &v.vec) )
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetColumnVec(__pyx_v_self->mat, __pyx_v__i, (&__pyx_v_v->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1804, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1803
* 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":1805
* if mode == 'rw':
* CHKERR( MatDenseGetColumnVec(self.mat, _i, &v.vec) )
* elif mode == 'r': # <<<<<<<<<<<<<<
* CHKERR( MatDenseGetColumnVecRead(self.mat, _i, &v.vec) )
* else:
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1805, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Mat.pyx":1806
* CHKERR( MatDenseGetColumnVec(self.mat, _i, &v.vec) )
* elif mode == 'r':
* CHKERR( MatDenseGetColumnVecRead(self.mat, _i, &v.vec) ) # <<<<<<<<<<<<<<
* else:
* CHKERR( MatDenseGetColumnVecWrite(self.mat, _i, &v.vec) )
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetColumnVecRead(__pyx_v_self->mat, __pyx_v__i, (&__pyx_v_v->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1806, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1805
* 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":1808
* CHKERR( MatDenseGetColumnVecRead(self.mat, _i, &v.vec) )
* else:
* CHKERR( MatDenseGetColumnVecWrite(self.mat, _i, &v.vec) ) # <<<<<<<<<<<<<<
* PetscINCREF(v.obj)
* return v
*/
/*else*/ {
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetColumnVecWrite(__pyx_v_self->mat, __pyx_v__i, (&__pyx_v_v->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1808, __pyx_L1_error)
}
__pyx_L8:;
/* "petsc4py/PETSc/Mat.pyx":1809
* else:
* CHKERR( MatDenseGetColumnVecWrite(self.mat, _i, &v.vec) )
* PetscINCREF(v.obj) # <<<<<<<<<<<<<<
* return v
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_v->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1810
* CHKERR( MatDenseGetColumnVecWrite(self.mat, _i, &v.vec) )
* PetscINCREF(v.obj)
* return v # <<<<<<<<<<<<<<
*
* def restoreDenseColumnVec(self, i, mode='rw'):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_v));
__pyx_r = ((PyObject *)__pyx_v_v);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1797
* return mat
*
* def getDenseColumnVec(self, i, mode='rw'): # <<<<<<<<<<<<<<
* if mode is None: mode = 'rw'
* if mode not in ['rw', 'r', 'w']:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":1812
* return v
*
* def restoreDenseColumnVec(self, i, mode='rw'): # <<<<<<<<<<<<<<
* cdef PetscInt _i = asInt(i)
* if mode == 'rw':
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_439restoreDenseColumnVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_438restoreDenseColumnVec[] = "Mat.restoreDenseColumnVec(self, i, mode='rw')";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_439restoreDenseColumnVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_i = 0;
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_mode,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)__pyx_n_s_rw);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restoreDenseColumnVec") < 0)) __PYX_ERR(45, 1812, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_i = values[0];
__pyx_v_mode = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("restoreDenseColumnVec", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1812, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreDenseColumnVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_438restoreDenseColumnVec(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_i, __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_438restoreDenseColumnVec(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_mode) {
PetscInt __pyx_v__i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
int __pyx_t_2;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("restoreDenseColumnVec", 0);
/* "petsc4py/PETSc/Mat.pyx":1813
*
* def restoreDenseColumnVec(self, i, mode='rw'):
* cdef PetscInt _i = asInt(i) # <<<<<<<<<<<<<<
* if mode == 'rw':
* CHKERR( MatDenseRestoreColumnVec(self.mat, _i, NULL) )
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_i); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 1813, __pyx_L1_error)
__pyx_v__i = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":1814
* def restoreDenseColumnVec(self, i, mode='rw'):
* cdef PetscInt _i = asInt(i)
* if mode == 'rw': # <<<<<<<<<<<<<<
* CHKERR( MatDenseRestoreColumnVec(self.mat, _i, NULL) )
* elif mode == 'r':
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_rw, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(45, 1814, __pyx_L1_error)
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1815
* cdef PetscInt _i = asInt(i)
* if mode == 'rw':
* CHKERR( MatDenseRestoreColumnVec(self.mat, _i, NULL) ) # <<<<<<<<<<<<<<
* elif mode == 'r':
* CHKERR( MatDenseRestoreColumnVecRead(self.mat, _i, NULL) )
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreColumnVec(__pyx_v_self->mat, __pyx_v__i, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1815, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1814
* def restoreDenseColumnVec(self, i, mode='rw'):
* cdef PetscInt _i = asInt(i)
* if mode == 'rw': # <<<<<<<<<<<<<<
* CHKERR( MatDenseRestoreColumnVec(self.mat, _i, NULL) )
* elif mode == 'r':
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Mat.pyx":1816
* if mode == 'rw':
* CHKERR( MatDenseRestoreColumnVec(self.mat, _i, NULL) )
* elif mode == 'r': # <<<<<<<<<<<<<<
* CHKERR( MatDenseRestoreColumnVecRead(self.mat, _i, NULL) )
* else:
*/
__pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(45, 1816, __pyx_L1_error)
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":1817
* CHKERR( MatDenseRestoreColumnVec(self.mat, _i, NULL) )
* elif mode == 'r':
* CHKERR( MatDenseRestoreColumnVecRead(self.mat, _i, NULL) ) # <<<<<<<<<<<<<<
* else:
* CHKERR( MatDenseRestoreColumnVecWrite(self.mat, _i, NULL) )
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreColumnVecRead(__pyx_v_self->mat, __pyx_v__i, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1817, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1816
* if mode == 'rw':
* CHKERR( MatDenseRestoreColumnVec(self.mat, _i, NULL) )
* elif mode == 'r': # <<<<<<<<<<<<<<
* CHKERR( MatDenseRestoreColumnVecRead(self.mat, _i, NULL) )
* else:
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Mat.pyx":1819
* CHKERR( MatDenseRestoreColumnVecRead(self.mat, _i, NULL) )
* else:
* CHKERR( MatDenseRestoreColumnVecWrite(self.mat, _i, NULL) ) # <<<<<<<<<<<<<<
*
* # Nest
*/
/*else*/ {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreColumnVecWrite(__pyx_v_self->mat, __pyx_v__i, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1819, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/Mat.pyx":1812
* return v
*
* def restoreDenseColumnVec(self, i, mode='rw'): # <<<<<<<<<<<<<<
* cdef PetscInt _i = asInt(i)
* if mode == 'rw':
*/
/* 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":1823
* # Nest
*
* def getNestSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt nrows, ncols
* CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_441getNestSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_440getNestSize[] = "Mat.getNestSize(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_441getNestSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNestSize (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNestSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNestSize", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_440getNestSize(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_440getNestSize(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":1825
* def getNestSize(self):
* cdef PetscInt nrows, ncols
* CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) # <<<<<<<<<<<<<<
* return toInt(nrows), toInt(ncols)
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetSize(__pyx_v_self->mat, (&__pyx_v_nrows), (&__pyx_v_ncols))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1825, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1826
* cdef PetscInt nrows, ncols
* CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) )
* return toInt(nrows), toInt(ncols) # <<<<<<<<<<<<<<
*
* def getNestISs(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nrows); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1826, __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(45, 1826, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 1826, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1823
* # Nest
*
* def getNestSize(self): # <<<<<<<<<<<<<<
* cdef PetscInt nrows, ncols
* CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) )
*/
/* 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":1828
* return toInt(nrows), toInt(ncols)
*
* def getNestISs(self): # <<<<<<<<<<<<<<
* cdef PetscInt i, nrows =0, ncols = 0
* cdef PetscIS *cisrows = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_443getNestISs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_442getNestISs[] = "Mat.getNestISs(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_443getNestISs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNestISs (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNestISs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNestISs", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_442getNestISs(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_442getNestISs(struct PyPetscMatObject *__pyx_v_self) {
PetscInt __pyx_v_nrows;
PetscInt __pyx_v_ncols;
IS *__pyx_v_cisrows;
IS *__pyx_v_ciscols;
CYTHON_UNUSED PyObject *__pyx_v_tmpr = 0;
CYTHON_UNUSED PyObject *__pyx_v_tmpc = 0;
PyObject *__pyx_v_isetsrows = 0;
PyObject *__pyx_v_isetscols = 0;
PetscInt __pyx_8genexpr4__pyx_v_i;
PetscInt __pyx_8genexpr5__pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PetscInt __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNestISs", 0);
/* "petsc4py/PETSc/Mat.pyx":1829
*
* def getNestISs(self):
* cdef PetscInt i, nrows =0, ncols = 0 # <<<<<<<<<<<<<<
* cdef PetscIS *cisrows = NULL
* cdef PetscIS *ciscols = NULL
*/
__pyx_v_nrows = 0;
__pyx_v_ncols = 0;
/* "petsc4py/PETSc/Mat.pyx":1830
* def getNestISs(self):
* cdef PetscInt i, nrows =0, ncols = 0
* cdef PetscIS *cisrows = NULL # <<<<<<<<<<<<<<
* cdef PetscIS *ciscols = NULL
* CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) )
*/
__pyx_v_cisrows = NULL;
/* "petsc4py/PETSc/Mat.pyx":1831
* cdef PetscInt i, nrows =0, ncols = 0
* cdef PetscIS *cisrows = NULL
* cdef PetscIS *ciscols = NULL # <<<<<<<<<<<<<<
* CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) )
* cdef object tmpr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
*/
__pyx_v_ciscols = NULL;
/* "petsc4py/PETSc/Mat.pyx":1832
* cdef PetscIS *cisrows = NULL
* cdef PetscIS *ciscols = NULL
* CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) # <<<<<<<<<<<<<<
* cdef object tmpr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
* cdef object tmpc = 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(45, 1832, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1833
* cdef PetscIS *ciscols = NULL
* CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) )
* cdef object tmpr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows) # <<<<<<<<<<<<<<
* cdef object tmpc = 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(45, 1833, __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(45, 1833, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_tmpr = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1834
* CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) )
* cdef object tmpr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
* cdef object tmpc = oarray_p(empty_p(ncols), NULL, <void**>&ciscols) # <<<<<<<<<<<<<<
* CHKERR( MatNestGetISs(self.mat, cisrows, ciscols) )
* cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]
*/
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ncols)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1834, __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(45, 1834, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_tmpc = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Mat.pyx":1835
* cdef object tmpr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
* cdef object tmpc = oarray_p(empty_p(ncols), NULL, <void**>&ciscols)
* CHKERR( MatNestGetISs(self.mat, cisrows, ciscols) ) # <<<<<<<<<<<<<<
* cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]
* cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols]
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetISs(__pyx_v_self->mat, __pyx_v_cisrows, __pyx_v_ciscols)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1835, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1836
* cdef object tmpc = oarray_p(empty_p(ncols), NULL, <void**>&ciscols)
* CHKERR( MatNestGetISs(self.mat, cisrows, ciscols) )
* cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] # <<<<<<<<<<<<<<
* cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols]
* return isetsrows, isetscols
*/
{ /* enter inner scope */
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1836, __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(45, 1836, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(45, 1836, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
} /* exit inner scope */
__pyx_v_isetsrows = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Mat.pyx":1837
* CHKERR( MatNestGetISs(self.mat, cisrows, ciscols) )
* cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]
* cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] # <<<<<<<<<<<<<<
* return isetsrows, isetscols
*
*/
{ /* enter inner scope */
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1837, __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(45, 1837, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(45, 1837, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
} /* exit inner scope */
__pyx_v_isetscols = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Mat.pyx":1838
* cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]
* cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols]
* return isetsrows, isetscols # <<<<<<<<<<<<<<
*
* def getNestLocalISs(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1838, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_isetsrows);
__Pyx_GIVEREF(__pyx_v_isetsrows);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_isetsrows);
__Pyx_INCREF(__pyx_v_isetscols);
__Pyx_GIVEREF(__pyx_v_isetscols);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_isetscols);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1828
* return toInt(nrows), toInt(ncols)
*
* def getNestISs(self): # <<<<<<<<<<<<<<
* cdef PetscInt i, nrows =0, ncols = 0
* cdef PetscIS *cisrows = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getNestISs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmpr);
__Pyx_XDECREF(__pyx_v_tmpc);
__Pyx_XDECREF(__pyx_v_isetsrows);
__Pyx_XDECREF(__pyx_v_isetscols);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1840
* return isetsrows, isetscols
*
* def getNestLocalISs(self): # <<<<<<<<<<<<<<
* cdef PetscInt i, nrows =0, ncols = 0
* cdef PetscIS *cisrows = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_445getNestLocalISs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_444getNestLocalISs[] = "Mat.getNestLocalISs(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_445getNestLocalISs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNestLocalISs (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNestLocalISs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNestLocalISs", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_444getNestLocalISs(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_444getNestLocalISs(struct PyPetscMatObject *__pyx_v_self) {
PetscInt __pyx_v_nrows;
PetscInt __pyx_v_ncols;
IS *__pyx_v_cisrows;
IS *__pyx_v_ciscols;
CYTHON_UNUSED PyObject *__pyx_v_tmpr = 0;
CYTHON_UNUSED PyObject *__pyx_v_tmpc = 0;
PyObject *__pyx_v_isetsrows = 0;
PyObject *__pyx_v_isetscols = 0;
PetscInt __pyx_8genexpr6__pyx_v_i;
PetscInt __pyx_8genexpr7__pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PetscInt __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNestLocalISs", 0);
/* "petsc4py/PETSc/Mat.pyx":1841
*
* def getNestLocalISs(self):
* cdef PetscInt i, nrows =0, ncols = 0 # <<<<<<<<<<<<<<
* cdef PetscIS *cisrows = NULL
* cdef PetscIS *ciscols = NULL
*/
__pyx_v_nrows = 0;
__pyx_v_ncols = 0;
/* "petsc4py/PETSc/Mat.pyx":1842
* def getNestLocalISs(self):
* cdef PetscInt i, nrows =0, ncols = 0
* cdef PetscIS *cisrows = NULL # <<<<<<<<<<<<<<
* cdef PetscIS *ciscols = NULL
* CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) )
*/
__pyx_v_cisrows = NULL;
/* "petsc4py/PETSc/Mat.pyx":1843
* cdef PetscInt i, nrows =0, ncols = 0
* cdef PetscIS *cisrows = NULL
* cdef PetscIS *ciscols = NULL # <<<<<<<<<<<<<<
* CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) )
* cdef object tmpr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
*/
__pyx_v_ciscols = NULL;
/* "petsc4py/PETSc/Mat.pyx":1844
* cdef PetscIS *cisrows = NULL
* cdef PetscIS *ciscols = NULL
* CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) # <<<<<<<<<<<<<<
* cdef object tmpr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
* cdef object tmpc = 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(45, 1844, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1845
* cdef PetscIS *ciscols = NULL
* CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) )
* cdef object tmpr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows) # <<<<<<<<<<<<<<
* cdef object tmpc = 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(45, 1845, __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(45, 1845, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_tmpr = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1846
* CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) )
* cdef object tmpr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
* cdef object tmpc = oarray_p(empty_p(ncols), NULL, <void**>&ciscols) # <<<<<<<<<<<<<<
* CHKERR( MatNestGetLocalISs(self.mat, cisrows, ciscols) )
* cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]
*/
__pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ncols)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1846, __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(45, 1846, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_tmpc = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Mat.pyx":1847
* cdef object tmpr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
* cdef object tmpc = oarray_p(empty_p(ncols), NULL, <void**>&ciscols)
* CHKERR( MatNestGetLocalISs(self.mat, cisrows, ciscols) ) # <<<<<<<<<<<<<<
* cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]
* cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols]
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetLocalISs(__pyx_v_self->mat, __pyx_v_cisrows, __pyx_v_ciscols)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1847, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1848
* cdef object tmpc = oarray_p(empty_p(ncols), NULL, <void**>&ciscols)
* CHKERR( MatNestGetLocalISs(self.mat, cisrows, ciscols) )
* cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] # <<<<<<<<<<<<<<
* cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols]
* return isetsrows, isetscols
*/
{ /* enter inner scope */
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1848, __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(45, 1848, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(45, 1848, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
} /* exit inner scope */
__pyx_v_isetsrows = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Mat.pyx":1849
* CHKERR( MatNestGetLocalISs(self.mat, cisrows, ciscols) )
* cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]
* cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] # <<<<<<<<<<<<<<
* return isetsrows, isetscols
*
*/
{ /* enter inner scope */
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1849, __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(45, 1849, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(45, 1849, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
} /* exit inner scope */
__pyx_v_isetscols = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Mat.pyx":1850
* cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]
* cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols]
* return isetsrows, isetscols # <<<<<<<<<<<<<<
*
* def getNestSubMatrix(self, i, j):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1850, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_isetsrows);
__Pyx_GIVEREF(__pyx_v_isetsrows);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_isetsrows);
__Pyx_INCREF(__pyx_v_isetscols);
__Pyx_GIVEREF(__pyx_v_isetscols);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_isetscols);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1840
* return isetsrows, isetscols
*
* def getNestLocalISs(self): # <<<<<<<<<<<<<<
* cdef PetscInt i, nrows =0, ncols = 0
* cdef PetscIS *cisrows = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getNestLocalISs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmpr);
__Pyx_XDECREF(__pyx_v_tmpc);
__Pyx_XDECREF(__pyx_v_isetsrows);
__Pyx_XDECREF(__pyx_v_isetscols);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1852
* return isetsrows, isetscols
*
* def getNestSubMatrix(self, i, j): # <<<<<<<<<<<<<<
* cdef Mat submat = Mat()
* cdef PetscInt idxm = asInt(i)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_447getNestSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_446getNestSubMatrix[] = "Mat.getNestSubMatrix(self, i, j)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_447getNestSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_i = 0;
PyObject *__pyx_v_j = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_j,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_j)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("getNestSubMatrix", 1, 2, 2, 1); __PYX_ERR(45, 1852, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getNestSubMatrix") < 0)) __PYX_ERR(45, 1852, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_i = values[0];
__pyx_v_j = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getNestSubMatrix", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1852, __pyx_L3_error)
__pyx_L3_error:;
__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_446getNestSubMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_i, __pyx_v_j);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_446getNestSubMatrix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_j) {
struct PyPetscMatObject *__pyx_v_submat = 0;
PetscInt __pyx_v_idxm;
PetscInt __pyx_v_jdxm;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscInt __pyx_t_2;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNestSubMatrix", 0);
/* "petsc4py/PETSc/Mat.pyx":1853
*
* def getNestSubMatrix(self, i, j):
* cdef Mat submat = Mat() # <<<<<<<<<<<<<<
* cdef PetscInt idxm = asInt(i)
* cdef PetscInt jdxm = asInt(j)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1853, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_submat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1854
* def getNestSubMatrix(self, i, j):
* cdef Mat submat = Mat()
* cdef PetscInt idxm = asInt(i) # <<<<<<<<<<<<<<
* cdef PetscInt jdxm = asInt(j)
* CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) )
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_i); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 1854, __pyx_L1_error)
__pyx_v_idxm = __pyx_t_2;
/* "petsc4py/PETSc/Mat.pyx":1855
* cdef Mat submat = Mat()
* cdef PetscInt idxm = asInt(i)
* cdef PetscInt jdxm = asInt(j) # <<<<<<<<<<<<<<
* CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) )
* PetscINCREF(submat.obj)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_j); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 1855, __pyx_L1_error)
__pyx_v_jdxm = __pyx_t_2;
/* "petsc4py/PETSc/Mat.pyx":1856
* cdef PetscInt idxm = asInt(i)
* cdef PetscInt jdxm = asInt(j)
* CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) ) # <<<<<<<<<<<<<<
* PetscINCREF(submat.obj)
* return submat
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetSubMat(__pyx_v_self->mat, __pyx_v_idxm, __pyx_v_jdxm, (&__pyx_v_submat->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1856, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1857
* cdef PetscInt jdxm = asInt(j)
* CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) )
* PetscINCREF(submat.obj) # <<<<<<<<<<<<<<
* return submat
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_submat->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1858
* CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) )
* PetscINCREF(submat.obj)
* return submat # <<<<<<<<<<<<<<
*
* # MatIS
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_submat));
__pyx_r = ((PyObject *)__pyx_v_submat);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1852
* return isetsrows, isetscols
*
* def getNestSubMatrix(self, i, j): # <<<<<<<<<<<<<<
* cdef Mat submat = Mat()
* cdef PetscInt idxm = asInt(i)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getNestSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_submat);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1862
* # MatIS
*
* def getISLocalMat(self): # <<<<<<<<<<<<<<
* cdef Mat localmat = type(self)()
* CHKERR( MatISGetLocalMat(self.mat, &localmat.mat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_449getISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_448getISLocalMat[] = "Mat.getISLocalMat(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_449getISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getISLocalMat (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getISLocalMat", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getISLocalMat", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_448getISLocalMat(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_448getISLocalMat(struct PyPetscMatObject *__pyx_v_self) {
struct PyPetscMatObject *__pyx_v_localmat = 0;
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_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getISLocalMat", 0);
/* "petsc4py/PETSc/Mat.pyx":1863
*
* def getISLocalMat(self):
* cdef Mat localmat = type(self)() # <<<<<<<<<<<<<<
* CHKERR( MatISGetLocalMat(self.mat, &localmat.mat) )
* PetscINCREF(localmat.obj)
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
__pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1863, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(45, 1863, __pyx_L1_error)
__pyx_v_localmat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1864
* def getISLocalMat(self):
* cdef Mat localmat = type(self)()
* CHKERR( MatISGetLocalMat(self.mat, &localmat.mat) ) # <<<<<<<<<<<<<<
* PetscINCREF(localmat.obj)
* return localmat
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISGetLocalMat(__pyx_v_self->mat, (&__pyx_v_localmat->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1864, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1865
* cdef Mat localmat = type(self)()
* CHKERR( MatISGetLocalMat(self.mat, &localmat.mat) )
* PetscINCREF(localmat.obj) # <<<<<<<<<<<<<<
* return localmat
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_localmat->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1866
* CHKERR( MatISGetLocalMat(self.mat, &localmat.mat) )
* PetscINCREF(localmat.obj)
* return localmat # <<<<<<<<<<<<<<
*
* # DM
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_localmat));
__pyx_r = ((PyObject *)__pyx_v_localmat);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1862
* # MatIS
*
* def getISLocalMat(self): # <<<<<<<<<<<<<<
* cdef Mat localmat = type(self)()
* CHKERR( MatISGetLocalMat(self.mat, &localmat.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.getISLocalMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_localmat);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1870
* # DM
*
* def getDM(self): # <<<<<<<<<<<<<<
* cdef PetscDM newdm = NULL
* CHKERR( MatGetDM(self.mat, &newdm) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_451getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_450getDM[] = "Mat.getDM(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_451getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDM (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_450getDM(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_450getDM(struct PyPetscMatObject *__pyx_v_self) {
DM __pyx_v_newdm;
struct PyPetscDMObject *__pyx_v_dm = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDM", 0);
/* "petsc4py/PETSc/Mat.pyx":1871
*
* def getDM(self):
* cdef PetscDM newdm = NULL # <<<<<<<<<<<<<<
* CHKERR( MatGetDM(self.mat, &newdm) )
* cdef DM dm = subtype_DM(newdm)()
*/
__pyx_v_newdm = NULL;
/* "petsc4py/PETSc/Mat.pyx":1872
* def getDM(self):
* 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(45, 1872, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1873
* cdef PetscDM newdm = NULL
* CHKERR( MatGetDM(self.mat, &newdm) )
* cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<<
* dm.dm = newdm
* PetscINCREF(dm.obj)
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1873, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1873, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(45, 1873, __pyx_L1_error)
__pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1874
* CHKERR( MatGetDM(self.mat, &newdm) )
* cdef DM dm = subtype_DM(newdm)()
* dm.dm = newdm # <<<<<<<<<<<<<<
* PetscINCREF(dm.obj)
* return dm
*/
__pyx_v_dm->dm = __pyx_v_newdm;
/* "petsc4py/PETSc/Mat.pyx":1875
* cdef DM dm = subtype_DM(newdm)()
* dm.dm = newdm
* PetscINCREF(dm.obj) # <<<<<<<<<<<<<<
* return dm
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":1876
* dm.dm = newdm
* PetscINCREF(dm.obj)
* return dm # <<<<<<<<<<<<<<
*
* def setDM(self, DM dm):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_dm));
__pyx_r = ((PyObject *)__pyx_v_dm);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1870
* # DM
*
* def getDM(self): # <<<<<<<<<<<<<<
* cdef PetscDM newdm = NULL
* CHKERR( MatGetDM(self.mat, &newdm) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_dm);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1878
* return dm
*
* def setDM(self, DM dm): # <<<<<<<<<<<<<<
* CHKERR( MatSetDM(self.mat, dm.dm) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_453setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_452setDM[] = "Mat.setDM(self, DM dm)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_453setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscDMObject *__pyx_v_dm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDM") < 0)) __PYX_ERR(45, 1878, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_dm = ((struct PyPetscDMObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1878, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.Mat.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(45, 1878, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_452setDM(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_dm);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_452setDM(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":1879
*
* def setDM(self, DM dm):
* 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(45, 1879, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1878
* return dm
*
* def setDM(self, DM dm): # <<<<<<<<<<<<<<
* CHKERR( MatSetDM(self.mat, dm.dm) )
*
*/
/* 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":1888
*
* property sizes:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getSizes()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_5sizes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_5sizes_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_5sizes___get__(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_5sizes___get__(struct PyPetscMatObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Mat.pyx":1889
* property sizes:
* def __get__(self):
* return self.getSizes() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setSizes(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1889, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1889, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1888
*
* property sizes:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getSizes()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1890
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_5sizes_2__set__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3Mat_5sizes_2__set__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/Mat.pyx":1891
* return self.getSizes()
* def __set__(self, value):
* self.setSizes(value) # <<<<<<<<<<<<<<
*
* property size:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1891, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1891, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":1890
* def __get__(self):
* return self.getSizes()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setSizes(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.sizes.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1894
*
* property size:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_4size___get__(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_4size___get__(struct PyPetscMatObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Mat.pyx":1895
* property size:
* def __get__(self):
* return self.getSize() # <<<<<<<<<<<<<<
*
* property local_size:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1895, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1895, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1894
*
* property size:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getSize()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1898
*
* property local_size:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_10local_size___get__(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10local_size___get__(struct PyPetscMatObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Mat.pyx":1899
* property local_size:
* def __get__(self):
* return self.getLocalSize() # <<<<<<<<<<<<<<
*
* property block_size:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getLocalSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1899, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1898
*
* property local_size:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getLocalSize()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.local_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1902
*
* property block_size:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_10block_size___get__(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10block_size___get__(struct PyPetscMatObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Mat.pyx":1903
* property block_size:
* def __get__(self):
* return self.getBlockSize() # <<<<<<<<<<<<<<
*
* property block_sizes:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1903, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1903, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1902
*
* property block_size:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getBlockSize()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.block_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1906
*
* property block_sizes:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_11block_sizes___get__(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_11block_sizes___get__(struct PyPetscMatObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Mat.pyx":1907
* property block_sizes:
* def __get__(self):
* return self.getBlockSizes() # <<<<<<<<<<<<<<
*
* property owner_range:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1907, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1907, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1906
*
* property block_sizes:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getBlockSizes()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.block_sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1910
*
* property owner_range:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_11owner_range___get__(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_11owner_range___get__(struct PyPetscMatObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Mat.pyx":1911
* property owner_range:
* def __get__(self):
* return self.getOwnershipRange() # <<<<<<<<<<<<<<
*
* property owner_ranges:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOwnershipRange); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1911, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1911, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1910
*
* property owner_range:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getOwnershipRange()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.owner_range.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1914
*
* property owner_ranges:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_12owner_ranges___get__(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_12owner_ranges___get__(struct PyPetscMatObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Mat.pyx":1915
* property owner_ranges:
* def __get__(self):
* return self.getOwnershipRanges() # <<<<<<<<<<<<<<
*
* #
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOwnershipRanges); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1915, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1915, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1914
*
* property owner_ranges:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getOwnershipRanges()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.owner_ranges.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1920
*
* property assembled:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_9assembled___get__(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_9assembled___get__(struct PyPetscMatObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Mat.pyx":1921
* property assembled:
* def __get__(self):
* return self.isAssembled() # <<<<<<<<<<<<<<
* property symmetric:
* def __get__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isAssembled); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1921, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1921, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1920
*
* property assembled:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.isAssembled()
* property symmetric:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.assembled.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1923
* return self.isAssembled()
* property symmetric:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_9symmetric___get__(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_9symmetric___get__(struct PyPetscMatObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Mat.pyx":1924
* property symmetric:
* def __get__(self):
* return self.isSymmetric() # <<<<<<<<<<<<<<
* property hermitian:
* def __get__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isSymmetric); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1924, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1924, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1923
* return self.isAssembled()
* property symmetric:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.isSymmetric()
* property hermitian:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.symmetric.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1926
* return self.isSymmetric()
* property hermitian:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_9hermitian___get__(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_9hermitian___get__(struct PyPetscMatObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Mat.pyx":1927
* property hermitian:
* def __get__(self):
* return self.isHermitian() # <<<<<<<<<<<<<<
* property structsymm:
* def __get__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isHermitian); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1927, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1927, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1926
* return self.isSymmetric()
* property hermitian:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.isHermitian()
* property structsymm:
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.hermitian.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1929
* return self.isHermitian()
* property structsymm:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_10structsymm___get__(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10structsymm___get__(struct PyPetscMatObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/Mat.pyx":1930
* property structsymm:
* def __get__(self):
* return self.isStructurallySymmetric() # <<<<<<<<<<<<<<
*
* # TODO Stream
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isStructurallySymmetric); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1930, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1930, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1929
* return self.isHermitian()
* property structsymm:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.isStructurallySymmetric()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.structsymm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1933
*
* # TODO Stream
* def __dlpack__(self, stream=-1): # <<<<<<<<<<<<<<
* return self.toDLPack('rw')
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_455__dlpack__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_454__dlpack__[] = "Mat.__dlpack__(self, stream=-1)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_455__dlpack__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED PyObject *__pyx_v_stream = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stream,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)__pyx_int_neg_1);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stream);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__dlpack__") < 0)) __PYX_ERR(45, 1933, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_stream = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__dlpack__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1933, __pyx_L3_error)
__pyx_L3_error:;
__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_454__dlpack__(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_stream);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_454__dlpack__(struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_stream) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__dlpack__", 0);
/* "petsc4py/PETSc/Mat.pyx":1934
* # TODO Stream
* def __dlpack__(self, stream=-1):
* return self.toDLPack('rw') # <<<<<<<<<<<<<<
*
* def __dlpack_device__(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_toDLPack); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 1934, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_n_s_rw) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_rw);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1934, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1933
*
* # TODO Stream
* def __dlpack__(self, stream=-1): # <<<<<<<<<<<<<<
* return self.toDLPack('rw')
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.Mat.__dlpack__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":1936
* 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_457__dlpack_device__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_456__dlpack_device__[] = "Mat.__dlpack_device__(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_457__dlpack_device__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dlpack_device__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__dlpack_device__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__dlpack_device__", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_456__dlpack_device__(((struct PyPetscMatObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_456__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":1937
*
* 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(45, 1937, __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(45, 1937, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 3);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 4);
} else {
__pyx_t_2 = PyList_GET_ITEM(sequence, 0);
__pyx_t_3 = PyList_GET_ITEM(sequence, 1);
__pyx_t_4 = PyList_GET_ITEM(sequence, 2);
__pyx_t_5 = PyList_GET_ITEM(sequence, 3);
__pyx_t_6 = PyList_GET_ITEM(sequence, 4);
}
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
{
Py_ssize_t i;
PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6};
for (i=0; i < 5; i++) {
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(45, 1937, __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(45, 1937, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
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(45, 1937, __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(45, 1937, __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":1938
* def __dlpack_device__(self):
* (dltype, devId, _, _, _) = mat_get_dlpack_ctx(self)
* return (dltype, devId) # <<<<<<<<<<<<<<
*
* def toDLPack(self, mode='rw'):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 1938, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_dltype);
__Pyx_GIVEREF(__pyx_v_dltype);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dltype);
__Pyx_INCREF(__pyx_v_devId);
__Pyx_GIVEREF(__pyx_v_devId);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_devId);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1936
* 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":1940
* return (dltype, devId)
*
* def toDLPack(self, mode='rw'): # <<<<<<<<<<<<<<
* if mode is None: mode = 'rw'
* if mode not in ['rw', 'r', 'w']:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_459toDLPack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3Mat_458toDLPack[] = "Mat.toDLPack(self, mode='rw')";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_459toDLPack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_mode = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)__pyx_n_s_rw);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "toDLPack") < 0)) __PYX_ERR(45, 1940, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mode = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("toDLPack", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 1940, __pyx_L3_error)
__pyx_L3_error:;
__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_458toDLPack(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_458toDLPack(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;
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)(PyObject *);
int64_t __pyx_t_11;
PetscErrorCode __pyx_t_12;
enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType __pyx_t_13;
int __pyx_t_14;
Py_ssize_t __pyx_t_15;
PyObject *(*__pyx_t_16)(PyObject *);
Py_ssize_t __pyx_t_17;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("toDLPack", 0);
__Pyx_INCREF(__pyx_v_mode);
/* "petsc4py/PETSc/Mat.pyx":1941
*
* def toDLPack(self, 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_n_s_rw);
__Pyx_DECREF_SET(__pyx_v_mode, __pyx_n_s_rw);
}
/* "petsc4py/PETSc/Mat.pyx":1942
* def toDLPack(self, 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_3 = __pyx_v_mode;
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_rw, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1942, __pyx_L1_error)
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_r, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1942, __pyx_L1_error)
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_w, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1942, __pyx_L1_error)
__pyx_t_2 = __pyx_t_1;
__pyx_L5_bool_binop_done:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_1 = (__pyx_t_2 != 0);
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/Mat.pyx":1943
* 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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1943, __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(45, 1943, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1942
* def toDLPack(self, 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":1945
* 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":1946
*
* cdef int64_t ndim = 0
* (device_type, device_id, ndim, shape, strides) = mat_get_dlpack_ctx(self) # <<<<<<<<<<<<<<
* hostmem = (device_type == kDLCPU)
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_mat_get_dlpack_ctx(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1946, __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 != 5)) {
if (size > 5) __Pyx_RaiseTooManyValuesError(5);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(45, 1946, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 3);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 4);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
__pyx_t_6 = PyList_GET_ITEM(sequence, 2);
__pyx_t_7 = PyList_GET_ITEM(sequence, 3);
__pyx_t_8 = PyList_GET_ITEM(sequence, 4);
}
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
#else
{
Py_ssize_t i;
PyObject** temps[5] = {&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
for (i=0; i < 5; i++) {
PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(45, 1946, __pyx_L1_error)
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
}
#endif
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
Py_ssize_t index = -1;
PyObject** temps[5] = {&__pyx_t_4,&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8};
__pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(45, 1946, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
for (index=0; index < 5; index++) {
PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 5) < 0) __PYX_ERR(45, 1946, __pyx_L1_error)
__pyx_t_10 = NULL;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L9_unpacking_done;
__pyx_L8_unpacking_failed:;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_10 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
__PYX_ERR(45, 1946, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_6); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(45, 1946, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_device_type = __pyx_t_4;
__pyx_t_4 = 0;
__pyx_v_device_id = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_ndim = __pyx_t_11;
__pyx_v_shape = __pyx_t_7;
__pyx_t_7 = 0;
__pyx_v_strides = __pyx_t_8;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/Mat.pyx":1947
* 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_3 = __Pyx_PyInt_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1947, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_8 = PyObject_RichCompare(__pyx_v_device_type, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(45, 1947, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_hostmem = __pyx_t_8;
__pyx_t_8 = 0;
/* "petsc4py/PETSc/Mat.pyx":1949
* 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":1950
*
* 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":1951
* 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":1952
* 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":1953
* 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":1959
* # 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_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1959, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Mat.pyx":1960
* # 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_1 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1960, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Mat.pyx":1961
* if mode == 'w':
* if hostmem:
* CHKERR( MatDenseGetArrayWrite(self.mat, <PetscScalar**>&a) ) # <<<<<<<<<<<<<<
* CHKERR( MatDenseRestoreArrayWrite(self.mat, NULL) )
* else:
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetArrayWrite(__pyx_v_self->mat, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1961, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1962
* if hostmem:
* CHKERR( MatDenseGetArrayWrite(self.mat, <PetscScalar**>&a) )
* CHKERR( MatDenseRestoreArrayWrite(self.mat, NULL) ) # <<<<<<<<<<<<<<
* else:
* CHKERR( MatDenseCUDAGetArrayWrite(self.mat, <PetscScalar**>&a) )
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreArrayWrite(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1962, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1960
* # 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_L11;
}
/* "petsc4py/PETSc/Mat.pyx":1964
* CHKERR( MatDenseRestoreArrayWrite(self.mat, NULL) )
* else:
* CHKERR( MatDenseCUDAGetArrayWrite(self.mat, <PetscScalar**>&a) ) # <<<<<<<<<<<<<<
* CHKERR( MatDenseCUDARestoreArrayWrite(self.mat, NULL) )
* elif mode == 'r':
*/
/*else*/ {
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseCUDAGetArrayWrite(__pyx_v_self->mat, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1964, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1965
* else:
* CHKERR( MatDenseCUDAGetArrayWrite(self.mat, <PetscScalar**>&a) )
* CHKERR( MatDenseCUDARestoreArrayWrite(self.mat, NULL) ) # <<<<<<<<<<<<<<
* elif mode == 'r':
* if hostmem:
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseCUDARestoreArrayWrite(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1965, __pyx_L1_error)
}
__pyx_L11:;
/* "petsc4py/PETSc/Mat.pyx":1959
* # 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_L10;
}
/* "petsc4py/PETSc/Mat.pyx":1966
* CHKERR( MatDenseCUDAGetArrayWrite(self.mat, <PetscScalar**>&a) )
* CHKERR( MatDenseCUDARestoreArrayWrite(self.mat, NULL) )
* elif mode == 'r': # <<<<<<<<<<<<<<
* if hostmem:
* CHKERR( MatDenseGetArrayRead(self.mat, <const PetscScalar**>&a) )
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1966, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Mat.pyx":1967
* CHKERR( MatDenseCUDARestoreArrayWrite(self.mat, NULL) )
* elif mode == 'r':
* if hostmem: # <<<<<<<<<<<<<<
* CHKERR( MatDenseGetArrayRead(self.mat, <const PetscScalar**>&a) )
* CHKERR( MatDenseRestoreArrayRead(self.mat, NULL) )
*/
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1967, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Mat.pyx":1968
* elif mode == 'r':
* if hostmem:
* CHKERR( MatDenseGetArrayRead(self.mat, <const PetscScalar**>&a) ) # <<<<<<<<<<<<<<
* CHKERR( MatDenseRestoreArrayRead(self.mat, NULL) )
* else:
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetArrayRead(__pyx_v_self->mat, ((PetscScalar const **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1968, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1969
* if hostmem:
* CHKERR( MatDenseGetArrayRead(self.mat, <const PetscScalar**>&a) )
* CHKERR( MatDenseRestoreArrayRead(self.mat, NULL) ) # <<<<<<<<<<<<<<
* else:
* CHKERR( MatDenseCUDAGetArrayRead(self.mat, <const PetscScalar**>&a) )
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreArrayRead(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1969, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1967
* CHKERR( MatDenseCUDARestoreArrayWrite(self.mat, NULL) )
* elif mode == 'r':
* if hostmem: # <<<<<<<<<<<<<<
* CHKERR( MatDenseGetArrayRead(self.mat, <const PetscScalar**>&a) )
* CHKERR( MatDenseRestoreArrayRead(self.mat, NULL) )
*/
goto __pyx_L12;
}
/* "petsc4py/PETSc/Mat.pyx":1971
* CHKERR( MatDenseRestoreArrayRead(self.mat, NULL) )
* else:
* CHKERR( MatDenseCUDAGetArrayRead(self.mat, <const PetscScalar**>&a) ) # <<<<<<<<<<<<<<
* CHKERR( MatDenseCUDARestoreArrayRead(self.mat, NULL) )
* else:
*/
/*else*/ {
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseCUDAGetArrayRead(__pyx_v_self->mat, ((PetscScalar const **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1971, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1972
* else:
* CHKERR( MatDenseCUDAGetArrayRead(self.mat, <const PetscScalar**>&a) )
* CHKERR( MatDenseCUDARestoreArrayRead(self.mat, NULL) ) # <<<<<<<<<<<<<<
* else:
* if hostmem:
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseCUDARestoreArrayRead(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1972, __pyx_L1_error)
}
__pyx_L12:;
/* "petsc4py/PETSc/Mat.pyx":1966
* CHKERR( MatDenseCUDAGetArrayWrite(self.mat, <PetscScalar**>&a) )
* CHKERR( MatDenseCUDARestoreArrayWrite(self.mat, NULL) )
* elif mode == 'r': # <<<<<<<<<<<<<<
* if hostmem:
* CHKERR( MatDenseGetArrayRead(self.mat, <const PetscScalar**>&a) )
*/
goto __pyx_L10;
}
/* "petsc4py/PETSc/Mat.pyx":1974
* CHKERR( MatDenseCUDARestoreArrayRead(self.mat, NULL) )
* else:
* if hostmem: # <<<<<<<<<<<<<<
* CHKERR( MatDenseGetArray(self.mat, <PetscScalar**>&a) )
* CHKERR( MatDenseRestoreArray(self.mat, NULL) )
*/
/*else*/ {
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(45, 1974, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/Mat.pyx":1975
* else:
* if hostmem:
* CHKERR( MatDenseGetArray(self.mat, <PetscScalar**>&a) ) # <<<<<<<<<<<<<<
* CHKERR( MatDenseRestoreArray(self.mat, NULL) )
* else:
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetArray(__pyx_v_self->mat, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1975, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1976
* if hostmem:
* CHKERR( MatDenseGetArray(self.mat, <PetscScalar**>&a) )
* CHKERR( MatDenseRestoreArray(self.mat, NULL) ) # <<<<<<<<<<<<<<
* else:
* CHKERR( MatDenseCUDAGetArray(self.mat, <PetscScalar**>&a) )
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreArray(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1976, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1974
* CHKERR( MatDenseCUDARestoreArrayRead(self.mat, NULL) )
* else:
* if hostmem: # <<<<<<<<<<<<<<
* CHKERR( MatDenseGetArray(self.mat, <PetscScalar**>&a) )
* CHKERR( MatDenseRestoreArray(self.mat, NULL) )
*/
goto __pyx_L13;
}
/* "petsc4py/PETSc/Mat.pyx":1978
* CHKERR( MatDenseRestoreArray(self.mat, NULL) )
* else:
* CHKERR( MatDenseCUDAGetArray(self.mat, <PetscScalar**>&a) ) # <<<<<<<<<<<<<<
* CHKERR( MatDenseCUDARestoreArray(self.mat, NULL) )
* dl_tensor.data = <void *>a
*/
/*else*/ {
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseCUDAGetArray(__pyx_v_self->mat, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1978, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":1979
* else:
* CHKERR( MatDenseCUDAGetArray(self.mat, <PetscScalar**>&a) )
* CHKERR( MatDenseCUDARestoreArray(self.mat, NULL) ) # <<<<<<<<<<<<<<
* dl_tensor.data = <void *>a
*
*/
__pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseCUDARestoreArray(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 1979, __pyx_L1_error)
}
__pyx_L13:;
}
__pyx_L10:;
/* "petsc4py/PETSc/Mat.pyx":1980
* CHKERR( MatDenseCUDAGetArray(self.mat, <PetscScalar**>&a) )
* CHKERR( MatDenseCUDARestoreArray(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":1982
* 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":1983
*
* 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_13 = ((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)__Pyx_PyInt_As_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_v_device_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 1983, __pyx_L1_error)
__pyx_v_ctx->device_type = __pyx_t_13;
/* "petsc4py/PETSc/Mat.pyx":1984
* 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_14 = __Pyx_PyInt_As_int(__pyx_v_device_id); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(45, 1984, __pyx_L1_error)
__pyx_v_ctx->device_id = __pyx_t_14;
/* "petsc4py/PETSc/Mat.pyx":1985
* 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":1986
* 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_8 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(45, 1986, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1986, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
__pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0;
__pyx_t_16 = NULL;
} else {
__pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(45, 1986, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(45, 1986, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
for (;;) {
if (likely(!__pyx_t_16)) {
if (likely(PyList_CheckExact(__pyx_t_8))) {
if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(45, 1986, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1986, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
} else {
if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(45, 1986, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1986, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
}
} else {
__pyx_t_3 = __pyx_t_16(__pyx_t_8);
if (unlikely(!__pyx_t_3)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(45, 1986, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_3);
}
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1987
* 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_3 = __Pyx_PyObject_GetItem(__pyx_v_shape, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1987, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(45, 1987, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(45, 1987, __pyx_L1_error)
(__pyx_v_shape_strides[__pyx_t_17]) = __pyx_t_11;
/* "petsc4py/PETSc/Mat.pyx":1986
* 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":1988
* for i in range(ndim):
* shape_strides[i] = shape[i]
* for i in range(ndim): # <<<<<<<<<<<<<<
* shape_strides[i+ndim] = strides[i]
* dl_tensor.ndim = ndim
*/
__pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(45, 1988, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1988, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
__pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0;
__pyx_t_16 = NULL;
} else {
__pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(45, 1988, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(45, 1988, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
for (;;) {
if (likely(!__pyx_t_16)) {
if (likely(PyList_CheckExact(__pyx_t_8))) {
if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(45, 1988, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1988, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
} else {
if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_3); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(45, 1988, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1988, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
}
} else {
__pyx_t_3 = __pyx_t_16(__pyx_t_8);
if (unlikely(!__pyx_t_3)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(45, 1988, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_3);
}
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/Mat.pyx":1989
* shape_strides[i] = shape[i]
* for i in range(ndim):
* shape_strides[i+ndim] = strides[i] # <<<<<<<<<<<<<<
* dl_tensor.ndim = ndim
* dl_tensor.shape = shape_strides
*/
__pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_strides, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1989, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(45, 1989, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 1989, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_7 = PyNumber_Add(__pyx_v_i, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 1989, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(45, 1989, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
(__pyx_v_shape_strides[__pyx_t_17]) = __pyx_t_11;
/* "petsc4py/PETSc/Mat.pyx":1988
* for i in range(ndim):
* shape_strides[i] = shape[i]
* for i in range(ndim): # <<<<<<<<<<<<<<
* shape_strides[i+ndim] = strides[i]
* dl_tensor.ndim = ndim
*/
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "petsc4py/PETSc/Mat.pyx":1990
* for i in range(ndim):
* shape_strides[i+ndim] = strides[i]
* dl_tensor.ndim = ndim # <<<<<<<<<<<<<<
* dl_tensor.shape = shape_strides
* dl_tensor.strides = shape_strides + ndim
*/
__pyx_v_dl_tensor->ndim = __pyx_v_ndim;
/* "petsc4py/PETSc/Mat.pyx":1991
* shape_strides[i+ndim] = strides[i]
* dl_tensor.ndim = ndim
* dl_tensor.shape = shape_strides # <<<<<<<<<<<<<<
* dl_tensor.strides = shape_strides + ndim
*
*/
__pyx_v_dl_tensor->shape = __pyx_v_shape_strides;
/* "petsc4py/PETSc/Mat.pyx":1992
* dl_tensor.ndim = ndim
* dl_tensor.shape = shape_strides
* dl_tensor.strides = shape_strides + ndim # <<<<<<<<<<<<<<
*
* cdef DLDataType* dtype = &dl_tensor.dtype
*/
__pyx_v_dl_tensor->strides = (__pyx_v_shape_strides + __pyx_v_ndim);
/* "petsc4py/PETSc/Mat.pyx":1994
* 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":1995
*
* 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":1996
* 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_1 = (((sizeof(PetscScalar)) == 8) != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/Mat.pyx":1997
* 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":1996
* 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_L18;
}
/* "petsc4py/PETSc/Mat.pyx":1998
* if sizeof(PetscScalar) == 8:
* dtype.bits = <uint8_t>64
* elif sizeof(PetscScalar) == 4: # <<<<<<<<<<<<<<
* dtype.bits = <uint8_t>32
* else:
*/
__pyx_t_1 = (((sizeof(PetscScalar)) == 4) != 0);
if (likely(__pyx_t_1)) {
/* "petsc4py/PETSc/Mat.pyx":1999
* 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":1998
* if sizeof(PetscScalar) == 8:
* dtype.bits = <uint8_t>64
* elif sizeof(PetscScalar) == 4: # <<<<<<<<<<<<<<
* dtype.bits = <uint8_t>32
* else:
*/
goto __pyx_L18;
}
/* "petsc4py/PETSc/Mat.pyx":2001
* 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_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(45, 2001, __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(45, 2001, __pyx_L1_error)
}
__pyx_L18:;
/* "petsc4py/PETSc/Mat.pyx":2002
* 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":2003
* 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":2004
* 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_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectReference(((PetscObject)__pyx_v_self->mat))); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 2004, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":2005
* 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":2006
* 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":2007
* 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_8 = PyCapsule_New(__pyx_v_dlm_tensor, ((char const *)"dltensor"), __pyx_f_8petsc4py_5PETSc_pycapsule_deleter); if (unlikely(!__pyx_t_8)) __PYX_ERR(45, 2007, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_r = __pyx_t_8;
__pyx_t_8 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":1940
* return (dltype, devId)
*
* def toDLPack(self, mode='rw'): # <<<<<<<<<<<<<<
* if mode is None: mode = 'rw'
* if mode not in ['rw', 'r', 'w']:
*/
/* 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.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":2015
* #
*
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace___cinit__(((struct PyPetscNullSpaceObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_9NullSpace___cinit__(struct PyPetscNullSpaceObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/Mat.pyx":2016
*
* 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":2017
* def __cinit__(self):
* self.obj = <PetscObject*> &self.nsp
* self.nsp = NULL # <<<<<<<<<<<<<<
*
* def __call__(self, vec):
*/
__pyx_v_self->nsp = NULL;
/* "petsc4py/PETSc/Mat.pyx":2015
* #
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.nsp
* self.nsp = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":2019
* 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(45, 2019, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 2019, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_2__call__(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_vec) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__call__", 0);
/* "petsc4py/PETSc/Mat.pyx":2020
*
* def __call__(self, vec):
* self.remove(vec) # <<<<<<<<<<<<<<
*
* #
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 2020, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_vec) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_vec);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 2020, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/Mat.pyx":2019
* self.nsp = NULL
*
* def __call__(self, vec): # <<<<<<<<<<<<<<
* self.remove(vec)
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.NullSpace.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":2024
* #
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_4view[] = "NullSpace.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(45, 2024, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 2024, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.NullSpace.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(45, 2024, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_4view(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/Mat.pyx":2025
*
* def view(self, Viewer viewer=None):
* 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":2026
* def view(self, Viewer viewer=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
}
/* "petsc4py/PETSc/Mat.pyx":2027
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
* CHKERR( MatNullSpaceView(self.nsp, vwr) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceView(__pyx_v_self->nsp, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 2027, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":2024
* #
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.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":2029
* CHKERR( MatNullSpaceView(self.nsp, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( MatNullSpaceDestroy(&self.nsp) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_6destroy[] = "NullSpace.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_6destroy(((struct PyPetscNullSpaceObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_6destroy(struct PyPetscNullSpaceObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/Mat.pyx":2030
*
* def destroy(self):
* 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(45, 2030, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":2031
* def destroy(self):
* CHKERR( MatNullSpaceDestroy(&self.nsp) )
* return self # <<<<<<<<<<<<<<
*
* def create(self, constant=False, vectors=(), comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":2029
* CHKERR( MatNullSpaceView(self.nsp, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( MatNullSpaceDestroy(&self.nsp) )
* return self
*/
/* 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":2033
* return self
*
* def create(self, constant=False, vectors=(), comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscBool has_const = PETSC_FALSE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_8create[] = "NullSpace.create(self, constant=False, vectors=(), comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_constant = 0;
PyObject *__pyx_v_vectors = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_constant,&__pyx_n_s_vectors,&__pyx_n_s_comm,0};
PyObject* values[3] = {0,0,0};
values[0] = ((PyObject *)Py_False);
values[1] = ((PyObject *)__pyx_empty_tuple);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_constant);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vectors);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(45, 2033, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_constant = values[0];
__pyx_v_vectors = values[1];
__pyx_v_comm = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 2033, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_8create(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_constant, PyObject *__pyx_v_vectors, PyObject *__pyx_v_comm) {
MPI_Comm __pyx_v_ccomm;
PetscBool __pyx_v_has_const;
PetscInt __pyx_v_i;
PetscInt __pyx_v_nv;
Vec *__pyx_v_v;
CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0;
MatNullSpace __pyx_v_newnsp;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
MPI_Comm __pyx_t_1;
int __pyx_t_2;
Py_ssize_t __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PetscInt __pyx_t_6;
Vec __pyx_t_7;
PetscErrorCode __pyx_t_8;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("create", 0);
/* "petsc4py/PETSc/Mat.pyx":2034
*
* def create(self, constant=False, vectors=(), comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(45, 2034, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/Mat.pyx":2035
* def create(self, constant=False, vectors=(), comm=None):
* 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":2036
* 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(45, 2036, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_v_has_const = PETSC_TRUE;
}
/* "petsc4py/PETSc/Mat.pyx":2037
* 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 tmp2 = 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(45, 2037, __pyx_L1_error)
__pyx_v_nv = ((PetscInt)__pyx_t_3);
/* "petsc4py/PETSc/Mat.pyx":2038
* if constant: has_const = PETSC_TRUE
* cdef PetscInt i = 0, nv = <PetscInt>len(vectors)
* cdef PetscVec *v = NULL # <<<<<<<<<<<<<<
* cdef object tmp2 = oarray_p(empty_p(nv), NULL, <void**>&v)
* for i from 0 <= i < nv:
*/
__pyx_v_v = NULL;
/* "petsc4py/PETSc/Mat.pyx":2039
* cdef PetscInt i = 0, nv = <PetscInt>len(vectors)
* cdef PetscVec *v = NULL
* cdef object tmp2 = 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(45, 2039, __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(45, 2039, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_tmp2 = __pyx_t_5;
__pyx_t_5 = 0;
/* "petsc4py/PETSc/Mat.pyx":2040
* cdef PetscVec *v = NULL
* cdef object tmp2 = 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":2041
* cdef object tmp2 = 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, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 2041, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(45, 2041, __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":2042
* 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) )
* PetscCLEAR(self.obj); self.nsp = newnsp
*/
__pyx_v_newnsp = NULL;
/* "petsc4py/PETSc/Mat.pyx":2043
* v[i] = (<Vec?>(vectors[<Py_ssize_t>i])).vec
* cdef PetscNullSpace newnsp = NULL
* CHKERR( MatNullSpaceCreate(ccomm, has_const, nv, v, &newnsp) ) # <<<<<<<<<<<<<<
* 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(45, 2043, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":2044
* cdef PetscNullSpace newnsp = NULL
* CHKERR( MatNullSpaceCreate(ccomm, has_const, nv, v, &newnsp) )
* PetscCLEAR(self.obj); self.nsp = newnsp # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->nsp = __pyx_v_newnsp;
/* "petsc4py/PETSc/Mat.pyx":2045
* CHKERR( MatNullSpaceCreate(ccomm, has_const, nv, v, &newnsp) )
* PetscCLEAR(self.obj); self.nsp = newnsp
* return self # <<<<<<<<<<<<<<
*
* def createRigidBody(self, Vec coords):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":2033
* return self
*
* def create(self, constant=False, vectors=(), comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscBool has_const = PETSC_FALSE
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("petsc4py.PETSc.NullSpace.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmp2);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":2047
* return self
*
* def createRigidBody(self, Vec coords): # <<<<<<<<<<<<<<
* cdef PetscNullSpace newnsp = NULL
* CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_11createRigidBody(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_10createRigidBody[] = "NullSpace.createRigidBody(self, Vec coords)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_11createRigidBody(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_coords = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coords,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createRigidBody") < 0)) __PYX_ERR(45, 2047, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_coords = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createRigidBody", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 2047, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.NullSpace.createRigidBody", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "coords", 0))) __PYX_ERR(45, 2047, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_10createRigidBody(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_coords);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":2048
*
* def createRigidBody(self, Vec coords):
* cdef PetscNullSpace newnsp = NULL # <<<<<<<<<<<<<<
* CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) )
* PetscCLEAR(self.obj); self.nsp = newnsp
*/
__pyx_v_newnsp = NULL;
/* "petsc4py/PETSc/Mat.pyx":2049
* def createRigidBody(self, Vec coords):
* cdef PetscNullSpace newnsp = NULL
* CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) ) # <<<<<<<<<<<<<<
* 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(45, 2049, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":2050
* cdef PetscNullSpace newnsp = NULL
* CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) )
* PetscCLEAR(self.obj); self.nsp = newnsp # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->nsp = __pyx_v_newnsp;
/* "petsc4py/PETSc/Mat.pyx":2051
* CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) )
* PetscCLEAR(self.obj); self.nsp = newnsp
* return self # <<<<<<<<<<<<<<
*
* def setFunction(self, function, args=None, kargs=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":2047
* return self
*
* def createRigidBody(self, Vec coords): # <<<<<<<<<<<<<<
* cdef PetscNullSpace newnsp = NULL
* CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) )
*/
/* 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":2053
* return self
*
* def setFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<<
* if function is not None:
* CHKERR( MatNullSpaceSetFunction(
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_13setFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_12setFunction[] = "NullSpace.setFunction(self, function, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_13setFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_function = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFunction") < 0)) __PYX_ERR(45, 2053, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_function = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFunction", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 2053, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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;
int __pyx_t_2;
PetscErrorCode __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("setFunction", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/Mat.pyx":2054
*
* def setFunction(self, function, args=None, kargs=None):
* if function is not None: # <<<<<<<<<<<<<<
* CHKERR( MatNullSpaceSetFunction(
* self.nsp, NullSpace_Function, NULL) )
*/
__pyx_t_1 = (__pyx_v_function != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/Mat.pyx":2055
* def setFunction(self, function, args=None, kargs=None):
* if function is not None:
* CHKERR( MatNullSpaceSetFunction( # <<<<<<<<<<<<<<
* self.nsp, NullSpace_Function, NULL) )
* if args is None: args = ()
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceSetFunction(__pyx_v_self->nsp, __pyx_f_8petsc4py_5PETSc_NullSpace_Function, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 2055, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":2057
* 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_2 = (__pyx_v_args == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/Mat.pyx":2058
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 2058, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4);
__pyx_t_4 = 0;
}
/* "petsc4py/PETSc/Mat.pyx":2059
* 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_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 2059, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_function);
__Pyx_GIVEREF(__pyx_v_function);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_function);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs);
__pyx_t_5 = ((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_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 2059, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/Mat.pyx":2054
*
* def setFunction(self, function, args=None, kargs=None):
* if function is not None: # <<<<<<<<<<<<<<
* CHKERR( MatNullSpaceSetFunction(
* self.nsp, NullSpace_Function, NULL) )
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/Mat.pyx":2061
* self.set_attr('__function__', (function, args, kargs))
* else:
* CHKERR( MatNullSpaceSetFunction(self.nsp, NULL, NULL) ) # <<<<<<<<<<<<<<
* self.set_attr('__function__', None)
* #
*/
/*else*/ {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceSetFunction(__pyx_v_self->nsp, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 2061, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":2062
* else:
* CHKERR( MatNullSpaceSetFunction(self.nsp, NULL, NULL) )
* self.set_attr('__function__', None) # <<<<<<<<<<<<<<
* #
*
*/
__pyx_t_5 = ((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_5)) __PYX_ERR(45, 2062, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__pyx_L3:;
/* "petsc4py/PETSc/Mat.pyx":2053
* return self
*
* def setFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<<
* if function is not None:
* CHKERR( MatNullSpaceSetFunction(
*/
/* 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.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":2065
* #
*
* def hasConstant(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatNullSpaceGetVecs(self.nsp, &flag, NULL, NULL) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_15hasConstant(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_14hasConstant[] = "NullSpace.hasConstant(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_15hasConstant(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("hasConstant (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("hasConstant", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "hasConstant", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_14hasConstant(((struct PyPetscNullSpaceObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_14hasConstant(struct PyPetscNullSpaceObject *__pyx_v_self) {
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("hasConstant", 0);
/* "petsc4py/PETSc/Mat.pyx":2066
*
* def hasConstant(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( MatNullSpaceGetVecs(self.nsp, &flag, NULL, NULL) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/Mat.pyx":2067
* def hasConstant(self):
* 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(45, 2067, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":2068
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatNullSpaceGetVecs(self.nsp, &flag, NULL, NULL) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def getVecs(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 2068, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":2065
* #
*
* def hasConstant(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatNullSpaceGetVecs(self.nsp, &flag, NULL, NULL) )
*/
/* 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":2070
* return toBool(flag)
*
* def getVecs(self): # <<<<<<<<<<<<<<
* cdef PetscInt i = 0, nv = 0
* cdef const PetscVec *v = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_17getVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_16getVecs[] = "NullSpace.getVecs(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_17getVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getVecs (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getVecs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVecs", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_16getVecs(((struct PyPetscNullSpaceObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_16getVecs(struct PyPetscNullSpaceObject *__pyx_v_self) {
PetscInt __pyx_v_i;
PetscInt __pyx_v_nv;
Vec const *__pyx_v_v;
struct PyPetscVecObject *__pyx_v_vec = 0;
PyObject *__pyx_v_vectors = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscInt __pyx_t_3;
int __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getVecs", 0);
/* "petsc4py/PETSc/Mat.pyx":2071
*
* def getVecs(self):
* 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":2072
* def getVecs(self):
* 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":2073
* 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(45, 2073, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":2074
* 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":2075
* 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(45, 2075, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_vectors = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Mat.pyx":2076
* 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":2077
* cdef list vectors = []
* for i from 0 <= i < nv:
* vec = Vec() # <<<<<<<<<<<<<<
* vec.vec = v[i]
* PetscINCREF(vec.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 2077, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_vec, ((struct PyPetscVecObject *)__pyx_t_2));
__pyx_t_2 = 0;
/* "petsc4py/PETSc/Mat.pyx":2078
* for i from 0 <= i < nv:
* vec = Vec()
* vec.vec = v[i] # <<<<<<<<<<<<<<
* PetscINCREF(vec.obj)
* vectors.append(vec)
*/
__pyx_v_vec->vec = (__pyx_v_v[__pyx_v_i]);
/* "petsc4py/PETSc/Mat.pyx":2079
* vec = Vec()
* vec.vec = v[i]
* PetscINCREF(vec.obj) # <<<<<<<<<<<<<<
* vectors.append(vec)
* return vectors
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj));
/* "petsc4py/PETSc/Mat.pyx":2080
* vec.vec = v[i]
* PetscINCREF(vec.obj)
* vectors.append(vec) # <<<<<<<<<<<<<<
* return vectors
*
*/
__pyx_t_4 = __Pyx_PyList_Append(__pyx_v_vectors, ((PyObject *)__pyx_v_vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(45, 2080, __pyx_L1_error)
}
/* "petsc4py/PETSc/Mat.pyx":2081
* PetscINCREF(vec.obj)
* vectors.append(vec)
* return vectors # <<<<<<<<<<<<<<
*
* def getFunction(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_vectors);
__pyx_r = __pyx_v_vectors;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":2070
* return toBool(flag)
*
* def getVecs(self): # <<<<<<<<<<<<<<
* cdef PetscInt i = 0, nv = 0
* cdef const PetscVec *v = NULL
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.NullSpace.getVecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_vec);
__Pyx_XDECREF(__pyx_v_vectors);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/Mat.pyx":2083
* return vectors
*
* def getFunction(self): # <<<<<<<<<<<<<<
* return self.get_attr('__function__')
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_19getFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_18getFunction[] = "NullSpace.getFunction(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_19getFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFunction (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFunction", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFunction", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_18getFunction(((struct PyPetscNullSpaceObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_18getFunction(struct PyPetscNullSpaceObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFunction", 0);
/* "petsc4py/PETSc/Mat.pyx":2084
*
* def getFunction(self):
* 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(45, 2084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":2083
* return vectors
*
* def getFunction(self): # <<<<<<<<<<<<<<
* return self.get_attr('__function__')
*
*/
/* 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":2088
* #
*
* def remove(self, Vec vec): # <<<<<<<<<<<<<<
* CHKERR( MatNullSpaceRemove(self.nsp, vec.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_21remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_20remove[] = "NullSpace.remove(self, Vec vec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_21remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove") < 0)) __PYX_ERR(45, 2088, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("remove", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 2088, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.NullSpace.remove", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(45, 2088, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_20remove(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_vec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":2089
*
* def remove(self, Vec vec):
* CHKERR( MatNullSpaceRemove(self.nsp, vec.vec) ) # <<<<<<<<<<<<<<
*
* def test(self, Mat mat):
*/
__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(45, 2089, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":2088
* #
*
* def remove(self, Vec vec): # <<<<<<<<<<<<<<
* CHKERR( MatNullSpaceRemove(self.nsp, vec.vec) )
*
*/
/* 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":2091
* CHKERR( MatNullSpaceRemove(self.nsp, vec.vec) )
*
* def test(self, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatNullSpaceTest(self.nsp, mat.mat, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_23test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_22test[] = "NullSpace.test(self, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_23test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test") < 0)) __PYX_ERR(45, 2091, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("test", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 2091, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.NullSpace.test", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(45, 2091, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_22test(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":2092
*
* def test(self, Mat mat):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( MatNullSpaceTest(self.nsp, mat.mat, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/Mat.pyx":2093
* def test(self, Mat mat):
* 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(45, 2093, __pyx_L1_error)
/* "petsc4py/PETSc/Mat.pyx":2094
* 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(45, 2094, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/Mat.pyx":2091
* CHKERR( MatNullSpaceRemove(self.nsp, vec.vec) )
*
* def test(self, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( MatNullSpaceTest(self.nsp, mat.mat, &flag) )
*/
/* 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":19
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning___cinit__(((struct PyPetscMatPartitioningObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_15MatPartitioning___cinit__(struct PyPetscMatPartitioningObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/MatPartitioning.pyx":20
*
* 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":21
* def __cinit__(self):
* self.obj = <PetscObject*> &self.part
* self.part = NULL # <<<<<<<<<<<<<<
*
* def __call__(self):
*/
__pyx_v_self->part = NULL;
/* "petsc4py/PETSc/MatPartitioning.pyx":19
* Type = MatPartitioningType
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.part
* self.part = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/MatPartitioning.pyx":23
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__call__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_2__call__(((struct PyPetscMatPartitioningObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_2__call__(struct PyPetscMatPartitioningObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__call__", 0);
/* "petsc4py/PETSc/MatPartitioning.pyx":24
*
* def __call__(self):
* return self.getValue() # <<<<<<<<<<<<<<
*
* def view(self, Viewer viewer=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 24, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/MatPartitioning.pyx":23
* self.part = NULL
*
* def __call__(self): # <<<<<<<<<<<<<<
* return self.getValue()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/MatPartitioning.pyx":26
* return self.getValue()
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* assert self.obj != NULL
* cdef PetscViewer vwr = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_4view[] = "MatPartitioning.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(46, 26, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(46, 26, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(46, 26, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_4view(((struct PyPetscMatPartitioningObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/MatPartitioning.pyx":27
*
* def view(self, Viewer viewer=None):
* 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())) {
if (unlikely(!((__pyx_v_self->__pyx_base.obj != NULL) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(46, 27, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/MatPartitioning.pyx":28
* def view(self, Viewer viewer=None):
* 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":29
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
}
/* "petsc4py/PETSc/MatPartitioning.pyx":30
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
* CHKERR( MatPartitioningView(self.part, vwr) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPartitioningView(__pyx_v_self->part, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 30, __pyx_L1_error)
/* "petsc4py/PETSc/MatPartitioning.pyx":26
* return self.getValue()
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* assert self.obj != NULL
* cdef PetscViewer vwr = NULL
*/
/* 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":32
* CHKERR( MatPartitioningView(self.part, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( MatPartitioningDestroy(&self.part) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_6destroy[] = "MatPartitioning.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_6destroy(((struct PyPetscMatPartitioningObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_6destroy(struct PyPetscMatPartitioningObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/MatPartitioning.pyx":33
*
* def destroy(self):
* 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(46, 33, __pyx_L1_error)
/* "petsc4py/PETSc/MatPartitioning.pyx":34
* def destroy(self):
* CHKERR( MatPartitioningDestroy(&self.part) )
* return self # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/MatPartitioning.pyx":32
* CHKERR( MatPartitioningView(self.part, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( MatPartitioningDestroy(&self.part) )
* return self
*/
/* 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":36
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* CHKERR( MatPartitioningCreate(ccomm, &self.part) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_8create[] = "MatPartitioning.create(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(46, 36, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(46, 36, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":37
*
* def create(self, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(46, 37, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/MatPartitioning.pyx":38
* def create(self, comm=None):
* 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(46, 38, __pyx_L1_error)
/* "petsc4py/PETSc/MatPartitioning.pyx":39
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* CHKERR( MatPartitioningCreate(ccomm, &self.part) )
* return self # <<<<<<<<<<<<<<
*
* def setType(self, matpartitioning_type):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/MatPartitioning.pyx":36
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* CHKERR( MatPartitioningCreate(ccomm, &self.part) )
*/
/* 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":41
* return self
*
* def setType(self, matpartitioning_type): # <<<<<<<<<<<<<<
* cdef PetscMatPartitioningType cval = NULL
* matpartitioning_type = str2bytes(matpartitioning_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_10setType[] = "MatPartitioning.setType(self, matpartitioning_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_matpartitioning_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_matpartitioning_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_matpartitioning_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(46, 41, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_matpartitioning_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(46, 41, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":42
*
* def setType(self, matpartitioning_type):
* cdef PetscMatPartitioningType cval = NULL # <<<<<<<<<<<<<<
* matpartitioning_type = str2bytes(matpartitioning_type, &cval)
* CHKERR( MatPartitioningSetType(self.part, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/MatPartitioning.pyx":43
* def setType(self, matpartitioning_type):
* 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(46, 43, __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":44
* cdef PetscMatPartitioningType cval = NULL
* matpartitioning_type = str2bytes(matpartitioning_type, &cval)
* CHKERR( MatPartitioningSetType(self.part, cval) ) # <<<<<<<<<<<<<<
*
* def getType(self):
*/
__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(46, 44, __pyx_L1_error)
/* "petsc4py/PETSc/MatPartitioning.pyx":41
* return self
*
* def setType(self, matpartitioning_type): # <<<<<<<<<<<<<<
* cdef PetscMatPartitioningType cval = NULL
* matpartitioning_type = str2bytes(matpartitioning_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":46
* CHKERR( MatPartitioningSetType(self.part, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscMatPartitioningType cval = NULL
* CHKERR( MatPartitioningGetType(self.part, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_12getType[] = "MatPartitioning.getType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_12getType(((struct PyPetscMatPartitioningObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_12getType(struct PyPetscMatPartitioningObject *__pyx_v_self) {
MatPartitioningType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getType", 0);
/* "petsc4py/PETSc/MatPartitioning.pyx":47
*
* def getType(self):
* cdef PetscMatPartitioningType cval = NULL # <<<<<<<<<<<<<<
* CHKERR( MatPartitioningGetType(self.part, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/MatPartitioning.pyx":48
* def getType(self):
* 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(46, 48, __pyx_L1_error)
/* "petsc4py/PETSc/MatPartitioning.pyx":49
* cdef PetscMatPartitioningType cval = NULL
* CHKERR( MatPartitioningGetType(self.part, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def setFromOptions(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 49, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/MatPartitioning.pyx":46
* CHKERR( MatPartitioningSetType(self.part, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscMatPartitioningType cval = NULL
* CHKERR( MatPartitioningGetType(self.part, &cval) )
*/
/* 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":51
* return bytes2str(cval)
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( MatPartitioningSetFromOptions(self.part) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_15setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_14setFromOptions[] = "MatPartitioning.setFromOptions(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_15setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_14setFromOptions(((struct PyPetscMatPartitioningObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_15MatPartitioning_14setFromOptions(struct PyPetscMatPartitioningObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFromOptions", 0);
/* "petsc4py/PETSc/MatPartitioning.pyx":52
*
* def setFromOptions(self):
* CHKERR( MatPartitioningSetFromOptions(self.part) ) # <<<<<<<<<<<<<<
*
* def setAdjacency(self, Mat adj):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPartitioningSetFromOptions(__pyx_v_self->part)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 52, __pyx_L1_error)
/* "petsc4py/PETSc/MatPartitioning.pyx":51
* return bytes2str(cval)
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( MatPartitioningSetFromOptions(self.part) )
*
*/
/* 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":54
* CHKERR( MatPartitioningSetFromOptions(self.part) )
*
* def setAdjacency(self, Mat adj): # <<<<<<<<<<<<<<
* CHKERR( MatPartitioningSetAdjacency(self.part, adj.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_17setAdjacency(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_16setAdjacency[] = "MatPartitioning.setAdjacency(self, Mat adj)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_17setAdjacency(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_adj = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_adj,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_adj)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setAdjacency") < 0)) __PYX_ERR(46, 54, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_adj = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setAdjacency", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(46, 54, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.setAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_adj), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "adj", 0))) __PYX_ERR(46, 54, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_16setAdjacency(((struct PyPetscMatPartitioningObject *)__pyx_v_self), __pyx_v_adj);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":55
*
* def setAdjacency(self, Mat adj):
* CHKERR( MatPartitioningSetAdjacency(self.part, adj.mat) ) # <<<<<<<<<<<<<<
*
* def apply(self, IS partitioning):
*/
__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(46, 55, __pyx_L1_error)
/* "petsc4py/PETSc/MatPartitioning.pyx":54
* CHKERR( MatPartitioningSetFromOptions(self.part) )
*
* def setAdjacency(self, Mat adj): # <<<<<<<<<<<<<<
* CHKERR( MatPartitioningSetAdjacency(self.part, adj.mat) )
*
*/
/* 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":57
* CHKERR( MatPartitioningSetAdjacency(self.part, adj.mat) )
*
* def apply(self, IS partitioning): # <<<<<<<<<<<<<<
* CHKERR( MatPartitioningApply(self.part, &partitioning.iset) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_19apply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_18apply[] = "MatPartitioning.apply(self, IS partitioning)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_19apply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_partitioning = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_partitioning,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_partitioning)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply") < 0)) __PYX_ERR(46, 57, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_partitioning = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("apply", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(46, 57, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.MatPartitioning.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_partitioning), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "partitioning", 0))) __PYX_ERR(46, 57, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_15MatPartitioning_18apply(((struct PyPetscMatPartitioningObject *)__pyx_v_self), __pyx_v_partitioning);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":58
*
* def apply(self, IS partitioning):
* 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(46, 58, __pyx_L1_error)
/* "petsc4py/PETSc/MatPartitioning.pyx":57
* CHKERR( MatPartitioningSetAdjacency(self.part, adj.mat) )
*
* def apply(self, IS partitioning): # <<<<<<<<<<<<<<
* CHKERR( MatPartitioningApply(self.part, &partitioning.iset) )
*
*/
/* 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":166
* # --- 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC___cinit__(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_2PC___cinit__(struct PyPetscPCObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/PC.pyx":167
*
* 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":168
* 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":166
* # --- xxx ---
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.pc
* self.pc = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":170
* 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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(47, 170, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_x = values[0];
__pyx_v_y = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 170, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
int __pyx_t_7;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__call__", 0);
__Pyx_INCREF(__pyx_v_y);
/* "petsc4py/PETSc/PC.pyx":171
*
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/PC.pyx":172
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOperators); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_createVecLeft); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_y, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":171
*
* 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":173
* if y is None: # XXX do this better
* y = self.getOperators()[0].createVecLeft()
* self.apply(x, y) # <<<<<<<<<<<<<<
* return y
*
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_apply); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
__pyx_t_7 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_7 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_x, __pyx_v_y};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 173, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_x, __pyx_v_y};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 173, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
{
__pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_INCREF(__pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_x);
__Pyx_INCREF(__pyx_v_y);
__Pyx_GIVEREF(__pyx_v_y);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_y);
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":174
* 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":170
* 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_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__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":178
* # --- xxx ---
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_4view[] = "PC.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(47, 178, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 178, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(47, 178, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_4view(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/PC.pyx":179
*
* def view(self, Viewer viewer=None):
* 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":180
* def view(self, Viewer viewer=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
}
/* "petsc4py/PETSc/PC.pyx":181
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
* CHKERR( PCView(self.pc, vwr) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCView(__pyx_v_self->pc, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 181, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":178
* # --- xxx ---
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.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":183
* CHKERR( PCView(self.pc, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PCDestroy(&self.pc) )
* self.pc = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_6destroy[] = "PC.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_6destroy(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_6destroy(struct PyPetscPCObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/PC.pyx":184
*
* def destroy(self):
* 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(47, 184, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":185
* def destroy(self):
* CHKERR( PCDestroy(&self.pc) )
* self.pc = NULL # <<<<<<<<<<<<<<
* return self
*
*/
__pyx_v_self->pc = NULL;
/* "petsc4py/PETSc/PC.pyx":186
* CHKERR( PCDestroy(&self.pc) )
* self.pc = NULL
* return self # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":183
* CHKERR( PCView(self.pc, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( PCDestroy(&self.pc) )
* self.pc = NULL
*/
/* 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":188
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscPC newpc = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_8create[] = "PC.create(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(47, 188, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 188, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":189
*
* def create(self, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(47, 189, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":190
* def create(self, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscPC newpc = NULL # <<<<<<<<<<<<<<
* CHKERR( PCCreate(ccomm, &newpc) )
* PetscCLEAR(self.obj); self.pc = newpc
*/
__pyx_v_newpc = NULL;
/* "petsc4py/PETSc/PC.pyx":191
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscPC newpc = NULL
* CHKERR( PCCreate(ccomm, &newpc) ) # <<<<<<<<<<<<<<
* 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(47, 191, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":192
* cdef PetscPC newpc = NULL
* CHKERR( PCCreate(ccomm, &newpc) )
* PetscCLEAR(self.obj); self.pc = newpc # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->pc = __pyx_v_newpc;
/* "petsc4py/PETSc/PC.pyx":193
* CHKERR( PCCreate(ccomm, &newpc) )
* PetscCLEAR(self.obj); self.pc = newpc
* return self # <<<<<<<<<<<<<<
*
* def setType(self, pc_type):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":188
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscPC newpc = NULL
*/
/* 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":195
* return self
*
* def setType(self, pc_type): # <<<<<<<<<<<<<<
* cdef PetscPCType cval = NULL
* pc_type = str2bytes(pc_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_10setType[] = "PC.setType(self, pc_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_pc_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pc_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pc_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(47, 195, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_pc_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 195, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":196
*
* def setType(self, pc_type):
* cdef PetscPCType cval = NULL # <<<<<<<<<<<<<<
* pc_type = str2bytes(pc_type, &cval)
* CHKERR( PCSetType(self.pc, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/PC.pyx":197
* def setType(self, pc_type):
* 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(47, 197, __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":198
* cdef PetscPCType cval = NULL
* pc_type = str2bytes(pc_type, &cval)
* CHKERR( PCSetType(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def getType(self):
*/
__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(47, 198, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":195
* return self
*
* def setType(self, pc_type): # <<<<<<<<<<<<<<
* cdef PetscPCType cval = NULL
* pc_type = str2bytes(pc_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":200
* CHKERR( PCSetType(self.pc, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscPCType cval = NULL
* CHKERR( PCGetType(self.pc, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_12getType[] = "PC.getType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_12getType(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_12getType(struct PyPetscPCObject *__pyx_v_self) {
PCType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getType", 0);
/* "petsc4py/PETSc/PC.pyx":201
*
* def getType(self):
* cdef PetscPCType cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PCGetType(self.pc, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/PC.pyx":202
* def getType(self):
* 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(47, 202, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":203
* cdef PetscPCType cval = NULL
* CHKERR( PCGetType(self.pc, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def setOptionsPrefix(self, prefix):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":200
* CHKERR( PCSetType(self.pc, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscPCType cval = NULL
* CHKERR( PCGetType(self.pc, &cval) )
*/
/* 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":205
* return bytes2str(cval)
*
* def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_15setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_14setOptionsPrefix[] = "PC.setOptionsPrefix(self, prefix)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_15setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(47, 205, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_prefix = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 205, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":206
*
* def setOptionsPrefix(self, prefix):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* prefix = str2bytes(prefix, &cval)
* CHKERR( PCSetOptionsPrefix(self.pc, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/PC.pyx":207
* def setOptionsPrefix(self, prefix):
* 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(47, 207, __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":208
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
* CHKERR( PCSetOptionsPrefix(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def getOptionsPrefix(self):
*/
__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(47, 208, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":205
* return bytes2str(cval)
*
* def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":210
* CHKERR( PCSetOptionsPrefix(self.pc, cval) )
*
* def getOptionsPrefix(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PCGetOptionsPrefix(self.pc, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_17getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_16getOptionsPrefix[] = "PC.getOptionsPrefix(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_17getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_16getOptionsPrefix(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_16getOptionsPrefix(struct PyPetscPCObject *__pyx_v_self) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getOptionsPrefix", 0);
/* "petsc4py/PETSc/PC.pyx":211
*
* def getOptionsPrefix(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PCGetOptionsPrefix(self.pc, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/PC.pyx":212
* def getOptionsPrefix(self):
* 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(47, 212, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":213
* cdef const char *cval = NULL
* CHKERR( PCGetOptionsPrefix(self.pc, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def appendOptionsPrefix(self, prefix):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":210
* CHKERR( PCSetOptionsPrefix(self.pc, cval) )
*
* def getOptionsPrefix(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PCGetOptionsPrefix(self.pc, &cval) )
*/
/* 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":215
* return bytes2str(cval)
*
* def appendOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_19appendOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_18appendOptionsPrefix[] = "PC.appendOptionsPrefix(self, prefix)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_19appendOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "appendOptionsPrefix") < 0)) __PYX_ERR(47, 215, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_prefix = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 215, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":216
*
* def appendOptionsPrefix(self, prefix):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* prefix = str2bytes(prefix, &cval)
* CHKERR( PCAppendOptionsPrefix(self.pc, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/PC.pyx":217
* def appendOptionsPrefix(self, prefix):
* 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(47, 217, __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":218
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
* CHKERR( PCAppendOptionsPrefix(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def setFromOptions(self):
*/
__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(47, 218, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":215
* return bytes2str(cval)
*
* def appendOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":220
* CHKERR( PCAppendOptionsPrefix(self.pc, cval) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( PCSetFromOptions(self.pc) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_21setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_20setFromOptions[] = "PC.setFromOptions(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_21setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_20setFromOptions(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_20setFromOptions(struct PyPetscPCObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFromOptions", 0);
/* "petsc4py/PETSc/PC.pyx":221
*
* def setFromOptions(self):
* CHKERR( PCSetFromOptions(self.pc) ) # <<<<<<<<<<<<<<
*
* def setOperators(self, Mat A=None, Mat P=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(47, 221, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":220
* CHKERR( PCAppendOptionsPrefix(self.pc, cval) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( PCSetFromOptions(self.pc) )
*
*/
/* 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":223
* CHKERR( PCSetFromOptions(self.pc) )
*
* def setOperators(self, Mat A=None, Mat P=None): # <<<<<<<<<<<<<<
* cdef PetscMat amat=NULL
* if A is not None: amat = A.mat
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_23setOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_22setOperators[] = "PC.setOperators(self, Mat A=None, Mat P=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_23setOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_A = 0;
struct PyPetscMatObject *__pyx_v_P = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_P,0};
PyObject* values[2] = {0,0};
values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None);
values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOperators") < 0)) __PYX_ERR(47, 223, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_A = ((struct PyPetscMatObject *)values[0]);
__pyx_v_P = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setOperators", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 223, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setOperators", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(47, 223, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(47, 223, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_22setOperators(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_A, __pyx_v_P);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
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("setOperators", 0);
/* "petsc4py/PETSc/PC.pyx":224
*
* def setOperators(self, Mat A=None, Mat P=None):
* cdef PetscMat amat=NULL # <<<<<<<<<<<<<<
* if A is not None: amat = A.mat
* cdef PetscMat pmat=amat
*/
__pyx_v_amat = NULL;
/* "petsc4py/PETSc/PC.pyx":225
* def setOperators(self, Mat A=None, Mat P=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_A->mat;
__pyx_v_amat = __pyx_t_3;
}
/* "petsc4py/PETSc/PC.pyx":226
* 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":227
* 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_2 = (((PyObject *)__pyx_v_P) != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __pyx_v_P->mat;
__pyx_v_pmat = __pyx_t_3;
}
/* "petsc4py/PETSc/PC.pyx":228
* cdef PetscMat pmat=amat
* if P is not None: pmat = P.mat
* CHKERR( PCSetOperators(self.pc, amat, pmat) ) # <<<<<<<<<<<<<<
*
* def getOperators(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetOperators(__pyx_v_self->pc, __pyx_v_amat, __pyx_v_pmat)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 228, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":223
* CHKERR( PCSetFromOptions(self.pc) )
*
* def setOperators(self, Mat A=None, Mat P=None): # <<<<<<<<<<<<<<
* cdef PetscMat amat=NULL
* if A is not None: amat = A.mat
*/
/* 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":230
* CHKERR( PCSetOperators(self.pc, amat, pmat) )
*
* def getOperators(self): # <<<<<<<<<<<<<<
* cdef Mat A = Mat(), P = Mat()
* CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_25getOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_24getOperators[] = "PC.getOperators(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_25getOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOperators (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOperators", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOperators", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_24getOperators(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_24getOperators(struct PyPetscPCObject *__pyx_v_self) {
struct PyPetscMatObject *__pyx_v_A = 0;
struct PyPetscMatObject *__pyx_v_P = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getOperators", 0);
/* "petsc4py/PETSc/PC.pyx":231
*
* def getOperators(self):
* cdef Mat A = Mat(), P = Mat() # <<<<<<<<<<<<<<
* CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) )
* PetscINCREF(A.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 231, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_A = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 231, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/PC.pyx":232
* def getOperators(self):
* cdef Mat A = Mat(), P = Mat()
* CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) ) # <<<<<<<<<<<<<<
* PetscINCREF(A.obj)
* PetscINCREF(P.obj)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGetOperators(__pyx_v_self->pc, (&__pyx_v_A->mat), (&__pyx_v_P->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 232, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":233
* cdef Mat A = Mat(), P = Mat()
* CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) )
* PetscINCREF(A.obj) # <<<<<<<<<<<<<<
* PetscINCREF(P.obj)
* return (A, P)
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A->__pyx_base.obj));
/* "petsc4py/PETSc/PC.pyx":234
* CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) )
* PetscINCREF(A.obj)
* PetscINCREF(P.obj) # <<<<<<<<<<<<<<
* return (A, P)
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj));
/* "petsc4py/PETSc/PC.pyx":235
* PetscINCREF(A.obj)
* PetscINCREF(P.obj)
* return (A, P) # <<<<<<<<<<<<<<
*
* def setUseAmat(self, flag):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_A));
__Pyx_GIVEREF(((PyObject *)__pyx_v_A));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_A));
__Pyx_INCREF(((PyObject *)__pyx_v_P));
__Pyx_GIVEREF(((PyObject *)__pyx_v_P));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P));
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":230
* CHKERR( PCSetOperators(self.pc, amat, pmat) )
*
* def getOperators(self): # <<<<<<<<<<<<<<
* cdef Mat A = Mat(), P = Mat()
* CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.PC.getOperators", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_A);
__Pyx_XDECREF((PyObject *)__pyx_v_P);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":237
* return (A, P)
*
* def setUseAmat(self, flag): # <<<<<<<<<<<<<<
* cdef PetscBool cflag = PETSC_FALSE
* if flag:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_27setUseAmat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_26setUseAmat[] = "PC.setUseAmat(self, flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_27setUseAmat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flag = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setUseAmat") < 0)) __PYX_ERR(47, 237, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setUseAmat", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 237, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":238
*
* def setUseAmat(self, flag):
* cdef PetscBool cflag = PETSC_FALSE # <<<<<<<<<<<<<<
* if flag:
* cflag = PETSC_TRUE
*/
__pyx_v_cflag = PETSC_FALSE;
/* "petsc4py/PETSc/PC.pyx":239
* def setUseAmat(self, flag):
* 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(47, 239, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/PC.pyx":240
* cdef PetscBool cflag = PETSC_FALSE
* if flag:
* cflag = PETSC_TRUE # <<<<<<<<<<<<<<
* CHKERR( PCSetUseAmat(self.pc, cflag) )
*
*/
__pyx_v_cflag = PETSC_TRUE;
/* "petsc4py/PETSc/PC.pyx":239
* def setUseAmat(self, flag):
* cdef PetscBool cflag = PETSC_FALSE
* if flag: # <<<<<<<<<<<<<<
* cflag = PETSC_TRUE
* CHKERR( PCSetUseAmat(self.pc, cflag) )
*/
}
/* "petsc4py/PETSc/PC.pyx":241
* if flag:
* cflag = PETSC_TRUE
* CHKERR( PCSetUseAmat(self.pc, cflag) ) # <<<<<<<<<<<<<<
*
* def getUseAmat(self):
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetUseAmat(__pyx_v_self->pc, __pyx_v_cflag)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 241, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":237
* return (A, P)
*
* def setUseAmat(self, flag): # <<<<<<<<<<<<<<
* cdef PetscBool cflag = PETSC_FALSE
* if flag:
*/
/* 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":243
* CHKERR( PCSetUseAmat(self.pc, cflag) )
*
* def getUseAmat(self): # <<<<<<<<<<<<<<
* cdef PetscBool cflag = PETSC_FALSE
* CHKERR( PCGetUseAmat(self.pc, &cflag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_29getUseAmat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_28getUseAmat[] = "PC.getUseAmat(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_29getUseAmat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getUseAmat (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getUseAmat", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getUseAmat", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_28getUseAmat(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_28getUseAmat(struct PyPetscPCObject *__pyx_v_self) {
PetscBool __pyx_v_cflag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getUseAmat", 0);
/* "petsc4py/PETSc/PC.pyx":244
*
* def getUseAmat(self):
* cdef PetscBool cflag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( PCGetUseAmat(self.pc, &cflag) )
* return toBool(cflag)
*/
__pyx_v_cflag = PETSC_FALSE;
/* "petsc4py/PETSc/PC.pyx":245
* def getUseAmat(self):
* 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(47, 245, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":246
* cdef PetscBool cflag = PETSC_FALSE
* CHKERR( PCGetUseAmat(self.pc, &cflag) )
* return toBool(cflag) # <<<<<<<<<<<<<<
*
* def setReusePreconditioner(self, flag):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_cflag); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 246, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":243
* CHKERR( PCSetUseAmat(self.pc, cflag) )
*
* def getUseAmat(self): # <<<<<<<<<<<<<<
* cdef PetscBool cflag = PETSC_FALSE
* CHKERR( PCGetUseAmat(self.pc, &cflag) )
*/
/* 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":248
* return toBool(cflag)
*
* def setReusePreconditioner(self, flag): # <<<<<<<<<<<<<<
* cdef PetscBool cflag = PETSC_FALSE
* if flag:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_31setReusePreconditioner(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_30setReusePreconditioner[] = "PC.setReusePreconditioner(self, flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_31setReusePreconditioner(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flag = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setReusePreconditioner") < 0)) __PYX_ERR(47, 248, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setReusePreconditioner", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 248, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":249
*
* def setReusePreconditioner(self, flag):
* cdef PetscBool cflag = PETSC_FALSE # <<<<<<<<<<<<<<
* if flag:
* cflag = PETSC_TRUE
*/
__pyx_v_cflag = PETSC_FALSE;
/* "petsc4py/PETSc/PC.pyx":250
* def setReusePreconditioner(self, flag):
* 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(47, 250, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/PC.pyx":251
* cdef PetscBool cflag = PETSC_FALSE
* if flag:
* cflag = PETSC_TRUE # <<<<<<<<<<<<<<
* CHKERR( PCSetReusePreconditioner(self.pc, cflag) )
*
*/
__pyx_v_cflag = PETSC_TRUE;
/* "petsc4py/PETSc/PC.pyx":250
* def setReusePreconditioner(self, flag):
* cdef PetscBool cflag = PETSC_FALSE
* if flag: # <<<<<<<<<<<<<<
* cflag = PETSC_TRUE
* CHKERR( PCSetReusePreconditioner(self.pc, cflag) )
*/
}
/* "petsc4py/PETSc/PC.pyx":252
* if flag:
* cflag = PETSC_TRUE
* CHKERR( PCSetReusePreconditioner(self.pc, cflag) ) # <<<<<<<<<<<<<<
*
* def setFailedReason(self, reason):
*/
__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(47, 252, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":248
* return toBool(cflag)
*
* def setReusePreconditioner(self, flag): # <<<<<<<<<<<<<<
* cdef PetscBool cflag = PETSC_FALSE
* if flag:
*/
/* 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":254
* CHKERR( PCSetReusePreconditioner(self.pc, cflag) )
*
* def setFailedReason(self, reason): # <<<<<<<<<<<<<<
* cdef PetscPCFailedReason val = reason
* CHKERR( PCSetFailedReason(self.pc, val) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_33setFailedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_32setFailedReason[] = "PC.setFailedReason(self, reason)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_33setFailedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_reason = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reason,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reason)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFailedReason") < 0)) __PYX_ERR(47, 254, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_reason = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFailedReason", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 254, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":255
*
* def setFailedReason(self, reason):
* cdef PetscPCFailedReason val = reason # <<<<<<<<<<<<<<
* CHKERR( PCSetFailedReason(self.pc, val) )
*
*/
__pyx_t_1 = ((PCFailedReason)__Pyx_PyInt_As_PCFailedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 255, __pyx_L1_error)
__pyx_v_val = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":256
* def setFailedReason(self, reason):
* cdef PetscPCFailedReason val = reason
* CHKERR( PCSetFailedReason(self.pc, val) ) # <<<<<<<<<<<<<<
*
* def getFailedReason(self):
*/
__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(47, 256, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":254
* CHKERR( PCSetReusePreconditioner(self.pc, cflag) )
*
* def setFailedReason(self, reason): # <<<<<<<<<<<<<<
* cdef PetscPCFailedReason val = reason
* CHKERR( PCSetFailedReason(self.pc, val) )
*/
/* 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":258
* CHKERR( PCSetFailedReason(self.pc, val) )
*
* def getFailedReason(self): # <<<<<<<<<<<<<<
* cdef PetscPCFailedReason reason = PC_NOERROR
* CHKERR( PCGetFailedReason(self.pc, &reason) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_35getFailedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_34getFailedReason[] = "PC.getFailedReason(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_35getFailedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFailedReason (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFailedReason", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFailedReason", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_34getFailedReason(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_34getFailedReason(struct PyPetscPCObject *__pyx_v_self) {
PCFailedReason __pyx_v_reason;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFailedReason", 0);
/* "petsc4py/PETSc/PC.pyx":259
*
* def getFailedReason(self):
* cdef PetscPCFailedReason reason = PC_NOERROR # <<<<<<<<<<<<<<
* CHKERR( PCGetFailedReason(self.pc, &reason) )
* return reason
*/
__pyx_v_reason = PC_NOERROR;
/* "petsc4py/PETSc/PC.pyx":260
* def getFailedReason(self):
* 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(47, 260, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":261
* cdef PetscPCFailedReason reason = PC_NOERROR
* CHKERR( PCGetFailedReason(self.pc, &reason) )
* return reason # <<<<<<<<<<<<<<
*
* def getFailedReasonRank(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_PCFailedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":258
* CHKERR( PCSetFailedReason(self.pc, val) )
*
* def getFailedReason(self): # <<<<<<<<<<<<<<
* cdef PetscPCFailedReason reason = PC_NOERROR
* CHKERR( PCGetFailedReason(self.pc, &reason) )
*/
/* 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":263
* return reason
*
* def getFailedReasonRank(self): # <<<<<<<<<<<<<<
* cdef PetscPCFailedReason reason = PC_NOERROR
* CHKERR( PCGetFailedReasonRank(self.pc, &reason) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_37getFailedReasonRank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_36getFailedReasonRank[] = "PC.getFailedReasonRank(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_37getFailedReasonRank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFailedReasonRank (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFailedReasonRank", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFailedReasonRank", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_36getFailedReasonRank(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_36getFailedReasonRank(struct PyPetscPCObject *__pyx_v_self) {
PCFailedReason __pyx_v_reason;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFailedReasonRank", 0);
/* "petsc4py/PETSc/PC.pyx":264
*
* def getFailedReasonRank(self):
* cdef PetscPCFailedReason reason = PC_NOERROR # <<<<<<<<<<<<<<
* CHKERR( PCGetFailedReasonRank(self.pc, &reason) )
* return reason
*/
__pyx_v_reason = PC_NOERROR;
/* "petsc4py/PETSc/PC.pyx":265
* def getFailedReasonRank(self):
* cdef PetscPCFailedReason reason = PC_NOERROR
* CHKERR( PCGetFailedReasonRank(self.pc, &reason) ) # <<<<<<<<<<<<<<
* return reason
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGetFailedReasonRank(__pyx_v_self->pc, (&__pyx_v_reason))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 265, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":266
* cdef PetscPCFailedReason reason = PC_NOERROR
* CHKERR( PCGetFailedReasonRank(self.pc, &reason) )
* return reason # <<<<<<<<<<<<<<
*
* def setUp(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_PCFailedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":263
* return reason
*
* def getFailedReasonRank(self): # <<<<<<<<<<<<<<
* cdef PetscPCFailedReason reason = PC_NOERROR
* CHKERR( PCGetFailedReasonRank(self.pc, &reason) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.PC.getFailedReasonRank", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":268
* return reason
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( PCSetUp(self.pc) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_39setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_38setUp[] = "PC.setUp(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_39setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setUp (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_38setUp(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_38setUp(struct PyPetscPCObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setUp", 0);
/* "petsc4py/PETSc/PC.pyx":269
*
* def setUp(self):
* CHKERR( PCSetUp(self.pc) ) # <<<<<<<<<<<<<<
*
* def reset(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetUp(__pyx_v_self->pc)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 269, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":268
* return reason
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( PCSetUp(self.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":271
* CHKERR( PCSetUp(self.pc) )
*
* def reset(self): # <<<<<<<<<<<<<<
* CHKERR( PCReset(self.pc) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_41reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_40reset[] = "PC.reset(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_41reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_40reset(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_40reset(struct PyPetscPCObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reset", 0);
/* "petsc4py/PETSc/PC.pyx":272
*
* def reset(self):
* CHKERR( PCReset(self.pc) ) # <<<<<<<<<<<<<<
*
* def setUpOnBlocks(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCReset(__pyx_v_self->pc)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 272, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":271
* CHKERR( PCSetUp(self.pc) )
*
* def reset(self): # <<<<<<<<<<<<<<
* CHKERR( PCReset(self.pc) )
*
*/
/* 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":274
* CHKERR( PCReset(self.pc) )
*
* def setUpOnBlocks(self): # <<<<<<<<<<<<<<
* CHKERR( PCSetUpOnBlocks(self.pc) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_43setUpOnBlocks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_42setUpOnBlocks[] = "PC.setUpOnBlocks(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_43setUpOnBlocks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setUpOnBlocks (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setUpOnBlocks", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUpOnBlocks", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_42setUpOnBlocks(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_42setUpOnBlocks(struct PyPetscPCObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setUpOnBlocks", 0);
/* "petsc4py/PETSc/PC.pyx":275
*
* def setUpOnBlocks(self):
* CHKERR( PCSetUpOnBlocks(self.pc) ) # <<<<<<<<<<<<<<
*
* def apply(self, Vec x, Vec y):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetUpOnBlocks(__pyx_v_self->pc)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 275, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":274
* CHKERR( PCReset(self.pc) )
*
* def setUpOnBlocks(self): # <<<<<<<<<<<<<<
* CHKERR( PCSetUpOnBlocks(self.pc) )
*
*/
/* 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":277
* CHKERR( PCSetUpOnBlocks(self.pc) )
*
* def apply(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( PCApply(self.pc, x.vec, y.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_45apply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_44apply[] = "PC.apply(self, Vec x, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_45apply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("apply", 1, 2, 2, 1); __PYX_ERR(47, 277, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply") < 0)) __PYX_ERR(47, 277, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_y = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("apply", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 277, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(47, 277, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(47, 277, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_44apply(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_44apply(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("apply", 0);
/* "petsc4py/PETSc/PC.pyx":278
*
* def apply(self, Vec x, Vec y):
* CHKERR( PCApply(self.pc, x.vec, y.vec) ) # <<<<<<<<<<<<<<
*
* def matApply(self, Mat x, Mat y):
*/
__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(47, 278, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":277
* CHKERR( PCSetUpOnBlocks(self.pc) )
*
* def apply(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( PCApply(self.pc, x.vec, y.vec) )
*
*/
/* 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":280
* CHKERR( PCApply(self.pc, x.vec, y.vec) )
*
* def matApply(self, Mat x, Mat y): # <<<<<<<<<<<<<<
* CHKERR( PCMatApply(self.pc, x.mat, y.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_47matApply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_46matApply[] = "PC.matApply(self, Mat x, Mat y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_47matApply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_x = 0;
struct PyPetscMatObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("matApply", 1, 2, 2, 1); __PYX_ERR(47, 280, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matApply") < 0)) __PYX_ERR(47, 280, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_x = ((struct PyPetscMatObject *)values[0]);
__pyx_v_y = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("matApply", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 280, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.matApply", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "x", 0))) __PYX_ERR(47, 280, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "y", 0))) __PYX_ERR(47, 280, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_46matApply(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_46matApply(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_y) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("matApply", 0);
/* "petsc4py/PETSc/PC.pyx":281
*
* def matApply(self, Mat x, Mat y):
* CHKERR( PCMatApply(self.pc, x.mat, y.mat) ) # <<<<<<<<<<<<<<
*
* def applyTranspose(self, Vec x, Vec y):
*/
__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(47, 281, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":280
* CHKERR( PCApply(self.pc, x.vec, y.vec) )
*
* def matApply(self, Mat x, Mat y): # <<<<<<<<<<<<<<
* CHKERR( PCMatApply(self.pc, x.mat, y.mat) )
*
*/
/* 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":283
* CHKERR( PCMatApply(self.pc, x.mat, y.mat) )
*
* def applyTranspose(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( PCApplyTranspose(self.pc, x.vec, y.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_49applyTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_48applyTranspose[] = "PC.applyTranspose(self, Vec x, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_49applyTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("applyTranspose", 1, 2, 2, 1); __PYX_ERR(47, 283, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applyTranspose") < 0)) __PYX_ERR(47, 283, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_y = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("applyTranspose", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 283, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.applyTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(47, 283, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(47, 283, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_48applyTranspose(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_48applyTranspose(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("applyTranspose", 0);
/* "petsc4py/PETSc/PC.pyx":284
*
* def applyTranspose(self, Vec x, Vec y):
* CHKERR( PCApplyTranspose(self.pc, x.vec, y.vec) ) # <<<<<<<<<<<<<<
*
* def applySymmetricLeft(self, Vec x, Vec y):
*/
__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(47, 284, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":283
* CHKERR( PCMatApply(self.pc, x.mat, y.mat) )
*
* def applyTranspose(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( PCApplyTranspose(self.pc, x.vec, y.vec) )
*
*/
/* 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":286
* CHKERR( PCApplyTranspose(self.pc, x.vec, y.vec) )
*
* def applySymmetricLeft(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( PCApplySymmetricLeft(self.pc, x.vec, y.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_51applySymmetricLeft(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_50applySymmetricLeft[] = "PC.applySymmetricLeft(self, Vec x, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_51applySymmetricLeft(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("applySymmetricLeft", 1, 2, 2, 1); __PYX_ERR(47, 286, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applySymmetricLeft") < 0)) __PYX_ERR(47, 286, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_y = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("applySymmetricLeft", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 286, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.applySymmetricLeft", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(47, 286, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(47, 286, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_50applySymmetricLeft(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":287
*
* def applySymmetricLeft(self, Vec x, Vec y):
* CHKERR( PCApplySymmetricLeft(self.pc, x.vec, y.vec) ) # <<<<<<<<<<<<<<
*
* def applySymmetricRight(self, Vec x, Vec y):
*/
__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(47, 287, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":286
* CHKERR( PCApplyTranspose(self.pc, x.vec, y.vec) )
*
* def applySymmetricLeft(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( PCApplySymmetricLeft(self.pc, x.vec, y.vec) )
*
*/
/* 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":289
* CHKERR( PCApplySymmetricLeft(self.pc, x.vec, y.vec) )
*
* def applySymmetricRight(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( PCApplySymmetricRight(self.pc, x.vec, y.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_53applySymmetricRight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_52applySymmetricRight[] = "PC.applySymmetricRight(self, Vec x, Vec y)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_53applySymmetricRight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_y = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("applySymmetricRight", 1, 2, 2, 1); __PYX_ERR(47, 289, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applySymmetricRight") < 0)) __PYX_ERR(47, 289, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_y = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("applySymmetricRight", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 289, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.applySymmetricRight", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(47, 289, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(47, 289, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_52applySymmetricRight(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":290
*
* def applySymmetricRight(self, Vec x, Vec y):
* 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(47, 290, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":289
* CHKERR( PCApplySymmetricLeft(self.pc, x.vec, y.vec) )
*
* def applySymmetricRight(self, Vec x, Vec y): # <<<<<<<<<<<<<<
* CHKERR( PCApplySymmetricRight(self.pc, x.vec, y.vec) )
*
*/
/* 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":294
* # --- discretization space ---
*
* def getDM(self): # <<<<<<<<<<<<<<
* cdef PetscDM newdm = NULL
* CHKERR( PCGetDM(self.pc, &newdm) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_55getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_54getDM[] = "PC.getDM(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_55getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDM (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_54getDM(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_54getDM(struct PyPetscPCObject *__pyx_v_self) {
DM __pyx_v_newdm;
struct PyPetscDMObject *__pyx_v_dm = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDM", 0);
/* "petsc4py/PETSc/PC.pyx":295
*
* def getDM(self):
* cdef PetscDM newdm = NULL # <<<<<<<<<<<<<<
* CHKERR( PCGetDM(self.pc, &newdm) )
* cdef DM dm = subtype_DM(newdm)()
*/
__pyx_v_newdm = NULL;
/* "petsc4py/PETSc/PC.pyx":296
* def getDM(self):
* 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(47, 296, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":297
* cdef PetscDM newdm = NULL
* CHKERR( PCGetDM(self.pc, &newdm) )
* cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<<
* dm.dm = newdm
* PetscINCREF(dm.obj)
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(47, 297, __pyx_L1_error)
__pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":298
* CHKERR( PCGetDM(self.pc, &newdm) )
* cdef DM dm = subtype_DM(newdm)()
* dm.dm = newdm # <<<<<<<<<<<<<<
* PetscINCREF(dm.obj)
* return dm
*/
__pyx_v_dm->dm = __pyx_v_newdm;
/* "petsc4py/PETSc/PC.pyx":299
* cdef DM dm = subtype_DM(newdm)()
* dm.dm = newdm
* PetscINCREF(dm.obj) # <<<<<<<<<<<<<<
* return dm
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj));
/* "petsc4py/PETSc/PC.pyx":300
* dm.dm = newdm
* PetscINCREF(dm.obj)
* return dm # <<<<<<<<<<<<<<
*
* def setDM(self, DM dm):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_dm));
__pyx_r = ((PyObject *)__pyx_v_dm);
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":294
* # --- discretization space ---
*
* def getDM(self): # <<<<<<<<<<<<<<
* cdef PetscDM newdm = NULL
* CHKERR( PCGetDM(self.pc, &newdm) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.PC.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_dm);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":302
* return dm
*
* def setDM(self, DM dm): # <<<<<<<<<<<<<<
* CHKERR( PCSetDM(self.pc, dm.dm) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_57setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_56setDM[] = "PC.setDM(self, DM dm)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_57setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscDMObject *__pyx_v_dm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDM") < 0)) __PYX_ERR(47, 302, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_dm = ((struct PyPetscDMObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 302, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(47, 302, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_56setDM(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_dm);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":303
*
* def setDM(self, DM dm):
* CHKERR( PCSetDM(self.pc, dm.dm) ) # <<<<<<<<<<<<<<
*
* def setCoordinates(self, coordinates):
*/
__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(47, 303, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":302
* return dm
*
* def setDM(self, DM dm): # <<<<<<<<<<<<<<
* CHKERR( PCSetDM(self.pc, dm.dm) )
*
*/
/* 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":305
* CHKERR( PCSetDM(self.pc, dm.dm) )
*
* def setCoordinates(self, coordinates): # <<<<<<<<<<<<<<
* cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL)
* if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_59setCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_58setCoordinates[] = "PC.setCoordinates(self, coordinates)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_59setCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_coordinates = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coordinates,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coordinates)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCoordinates") < 0)) __PYX_ERR(47, 305, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_coordinates = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setCoordinates", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 305, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_58setCoordinates(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_coordinates) {
PyArrayObject *__pyx_v_xyz = 0;
PetscInt __pyx_v_nvtx;
PetscInt __pyx_v_ndim;
PetscReal *__pyx_v_coords;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setCoordinates", 0);
/* "petsc4py/PETSc/PC.pyx":306
*
* def setCoordinates(self, coordinates):
* 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(47, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_xyz = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/PC.pyx":307
* def setCoordinates(self, coordinates):
* 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) != 0);
if (__pyx_t_2) {
__pyx_t_1 = ((PyObject *)PyArray_Copy(__pyx_v_xyz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 307, __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":308
* 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) != 0);
if (unlikely(__pyx_t_2)) {
/* "petsc4py/PETSc/PC.pyx":310
* 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_1 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_xyz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_coordinates_must_have_two_dimens, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/PC.pyx":308
* cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL)
* if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz)
* if PyArray_NDIM(xyz) != 2: raise ValueError( # <<<<<<<<<<<<<<
* ("coordinates must have two dimensions: "
* "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) )
*/
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 308, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(47, 308, __pyx_L1_error)
}
/* "petsc4py/PETSc/PC.pyx":311
* ("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":312
* "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":313
* 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":314
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetCoordinates(__pyx_v_self->pc, __pyx_v_ndim, __pyx_v_nvtx, __pyx_v_coords)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 314, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":305
* CHKERR( PCSetDM(self.pc, dm.dm) )
*
* def setCoordinates(self, coordinates): # <<<<<<<<<<<<<<
* cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL)
* if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.PC.setCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_xyz);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":318
* # --- Python ---
*
* def createPython(self, context=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscPC newpc = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_61createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_60createPython[] = "PC.createPython(self, context=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_61createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_context = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_comm,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createPython") < 0)) __PYX_ERR(47, 318, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_context = values[0];
__pyx_v_comm = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createPython", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 318, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":319
*
* def createPython(self, context=None, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(47, 319, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":320
* def createPython(self, context=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscPC newpc = NULL # <<<<<<<<<<<<<<
* CHKERR( PCCreate(ccomm, &newpc) )
* PetscCLEAR(self.obj); self.pc = newpc
*/
__pyx_v_newpc = NULL;
/* "petsc4py/PETSc/PC.pyx":321
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscPC newpc = NULL
* CHKERR( PCCreate(ccomm, &newpc) ) # <<<<<<<<<<<<<<
* 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(47, 321, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":322
* cdef PetscPC newpc = NULL
* CHKERR( PCCreate(ccomm, &newpc) )
* PetscCLEAR(self.obj); self.pc = newpc # <<<<<<<<<<<<<<
* CHKERR( PCSetType(self.pc, PCPYTHON) )
* CHKERR( PCPythonSetContext(self.pc, <void*>context) )
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->pc = __pyx_v_newpc;
/* "petsc4py/PETSc/PC.pyx":323
* CHKERR( PCCreate(ccomm, &newpc) )
* 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(47, 323, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":324
* 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(47, 324, __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(47, 324, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":325
* CHKERR( PCSetType(self.pc, PCPYTHON) )
* CHKERR( PCPythonSetContext(self.pc, <void*>context) )
* return self # <<<<<<<<<<<<<<
*
* def setPythonContext(self, context):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":318
* # --- Python ---
*
* def createPython(self, context=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscPC newpc = NULL
*/
/* 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":327
* return self
*
* def setPythonContext(self, context): # <<<<<<<<<<<<<<
* CHKERR( PCPythonSetContext(self.pc, <void*>context) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_63setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_62setPythonContext[] = "PC.setPythonContext(self, context)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_63setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_context = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonContext") < 0)) __PYX_ERR(47, 327, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_context = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 327, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":328
*
* def setPythonContext(self, context):
* CHKERR( PCPythonSetContext(self.pc, <void*>context) ) # <<<<<<<<<<<<<<
*
* def getPythonContext(self):
*/
__pyx_t_1 = PCPythonSetContext(__pyx_v_self->pc, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 328, __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(47, 328, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":327
* return self
*
* def setPythonContext(self, context): # <<<<<<<<<<<<<<
* CHKERR( PCPythonSetContext(self.pc, <void*>context) )
*
*/
/* 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":330
* CHKERR( PCPythonSetContext(self.pc, <void*>context) )
*
* def getPythonContext(self): # <<<<<<<<<<<<<<
* cdef void *context = NULL
* CHKERR( PCPythonGetContext(self.pc, &context) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_65getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_64getPythonContext[] = "PC.getPythonContext(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_65getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getPythonContext (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getPythonContext", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonContext", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_64getPythonContext(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_64getPythonContext(struct PyPetscPCObject *__pyx_v_self) {
void *__pyx_v_context;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getPythonContext", 0);
/* "petsc4py/PETSc/PC.pyx":331
*
* def getPythonContext(self):
* cdef void *context = NULL # <<<<<<<<<<<<<<
* CHKERR( PCPythonGetContext(self.pc, &context) )
* if context == NULL: return None
*/
__pyx_v_context = NULL;
/* "petsc4py/PETSc/PC.pyx":332
* def getPythonContext(self):
* 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(47, 332, __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(47, 332, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":333
* 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) != 0);
if (__pyx_t_3) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/PC.pyx":334
* CHKERR( PCPythonGetContext(self.pc, &context) )
* if context == NULL: return None
* else: return <object> context # <<<<<<<<<<<<<<
*
* def setPythonType(self, py_type):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_context));
__pyx_r = ((PyObject *)__pyx_v_context);
goto __pyx_L0;
}
/* "petsc4py/PETSc/PC.pyx":330
* CHKERR( PCPythonSetContext(self.pc, <void*>context) )
*
* def getPythonContext(self): # <<<<<<<<<<<<<<
* cdef void *context = NULL
* CHKERR( PCPythonGetContext(self.pc, &context) )
*/
/* 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":336
* else: return <object> context
*
* def setPythonType(self, py_type): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* py_type = str2bytes(py_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_67setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_66setPythonType[] = "PC.setPythonType(self, py_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_67setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_py_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_py_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonType") < 0)) __PYX_ERR(47, 336, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_py_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 336, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":337
*
* def setPythonType(self, py_type):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* py_type = str2bytes(py_type, &cval)
* CHKERR( PCPythonSetType(self.pc, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/PC.pyx":338
* def setPythonType(self, py_type):
* 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(47, 338, __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":339
* cdef const char *cval = NULL
* py_type = str2bytes(py_type, &cval)
* CHKERR( PCPythonSetType(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def getPythonType(self):
*/
__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(47, 339, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":336
* else: return <object> context
*
* def setPythonType(self, py_type): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* py_type = str2bytes(py_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":341
* CHKERR( PCPythonSetType(self.pc, cval) )
*
* def getPythonType(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PCPythonGetType(self.pc, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_69getPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_68getPythonType[] = "PC.getPythonType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_69getPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getPythonType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getPythonType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_68getPythonType(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_68getPythonType(struct PyPetscPCObject *__pyx_v_self) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getPythonType", 0);
/* "petsc4py/PETSc/PC.pyx":342
*
* def getPythonType(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PCPythonGetType(self.pc, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/PC.pyx":343
* def getPythonType(self):
* 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(47, 343, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":344
* cdef const char *cval = NULL
* CHKERR( PCPythonGetType(self.pc, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* # --- ASM ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 344, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":341
* CHKERR( PCPythonSetType(self.pc, cval) )
*
* def getPythonType(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( PCPythonGetType(self.pc, &cval) )
*/
/* 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":348
* # --- ASM ---
*
* def setASMType(self, asmtype): # <<<<<<<<<<<<<<
* cdef PetscPCASMType cval = asmtype
* CHKERR( PCASMSetType(self.pc, cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_71setASMType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_70setASMType[] = "PC.setASMType(self, asmtype)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_71setASMType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_asmtype = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_asmtype,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmtype)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setASMType") < 0)) __PYX_ERR(47, 348, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_asmtype = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setASMType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 348, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setASMType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_70setASMType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_asmtype);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_70setASMType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_asmtype) {
PCASMType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PCASMType __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setASMType", 0);
/* "petsc4py/PETSc/PC.pyx":349
*
* def setASMType(self, asmtype):
* cdef PetscPCASMType cval = asmtype # <<<<<<<<<<<<<<
* CHKERR( PCASMSetType(self.pc, cval) )
*
*/
__pyx_t_1 = ((PCASMType)__Pyx_PyInt_As_PCASMType(__pyx_v_asmtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 349, __pyx_L1_error)
__pyx_v_cval = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":350
* def setASMType(self, asmtype):
* cdef PetscPCASMType cval = asmtype
* CHKERR( PCASMSetType(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def setASMOverlap(self, overlap):
*/
__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(47, 350, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":348
* # --- ASM ---
*
* def setASMType(self, asmtype): # <<<<<<<<<<<<<<
* cdef PetscPCASMType cval = asmtype
* CHKERR( PCASMSetType(self.pc, cval) )
*/
/* 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":352
* CHKERR( PCASMSetType(self.pc, cval) )
*
* def setASMOverlap(self, overlap): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(overlap)
* CHKERR( PCASMSetOverlap(self.pc, ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_73setASMOverlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_72setASMOverlap[] = "PC.setASMOverlap(self, overlap)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_73setASMOverlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_overlap = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_overlap,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overlap)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setASMOverlap") < 0)) __PYX_ERR(47, 352, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_overlap = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setASMOverlap", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 352, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setASMOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_72setASMOverlap(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_overlap);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_72setASMOverlap(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_overlap) {
PetscInt __pyx_v_ival;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setASMOverlap", 0);
/* "petsc4py/PETSc/PC.pyx":353
*
* def setASMOverlap(self, overlap):
* 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(47, 353, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":354
* def setASMOverlap(self, overlap):
* cdef PetscInt ival = asInt(overlap)
* CHKERR( PCASMSetOverlap(self.pc, ival) ) # <<<<<<<<<<<<<<
*
* def setASMLocalSubdomains(self, nsd, is_=None, is_local=None):
*/
__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(47, 354, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":352
* CHKERR( PCASMSetType(self.pc, cval) )
*
* def setASMOverlap(self, overlap): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(overlap)
* CHKERR( PCASMSetOverlap(self.pc, ival) )
*/
/* 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":356
* CHKERR( PCASMSetOverlap(self.pc, ival) )
*
* def setASMLocalSubdomains(self, nsd, is_=None, is_local=None): # <<<<<<<<<<<<<<
* cdef PetscInt n = asInt(nsd)
* cdef PetscInt i = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_75setASMLocalSubdomains(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_74setASMLocalSubdomains[] = "PC.setASMLocalSubdomains(self, nsd, is_=None, is_local=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_75setASMLocalSubdomains(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_nsd = 0;
PyObject *__pyx_v_is_ = 0;
PyObject *__pyx_v_is_local = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsd,&__pyx_n_s_is,&__pyx_n_s_is_local,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsd)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_local);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setASMLocalSubdomains") < 0)) __PYX_ERR(47, 356, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_nsd = values[0];
__pyx_v_is_ = values[1];
__pyx_v_is_local = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setASMLocalSubdomains", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 356, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setASMLocalSubdomains", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_74setASMLocalSubdomains(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_nsd, __pyx_v_is_, __pyx_v_is_local);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_74setASMLocalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_, PyObject *__pyx_v_is_local) {
PetscInt __pyx_v_n;
PetscInt __pyx_v_i;
IS *__pyx_v_isets;
IS *__pyx_v_isets_local;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
Py_ssize_t __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PetscErrorCode __pyx_t_7;
PetscInt __pyx_t_8;
PetscInt __pyx_t_9;
IS __pyx_t_10;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setASMLocalSubdomains", 0);
/* "petsc4py/PETSc/PC.pyx":357
*
* def setASMLocalSubdomains(self, nsd, is_=None, is_local=None):
* 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(47, 357, __pyx_L1_error)
__pyx_v_n = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":358
* def setASMLocalSubdomains(self, nsd, is_=None, is_local=None):
* 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":359
* cdef PetscInt n = asInt(nsd)
* cdef PetscInt i = 0
* cdef PetscIS *isets = NULL # <<<<<<<<<<<<<<
* cdef PetscIS *isets_local = NULL
* if is_ is not None:
*/
__pyx_v_isets = NULL;
/* "petsc4py/PETSc/PC.pyx":360
* cdef PetscInt i = 0
* cdef PetscIS *isets = NULL
* cdef PetscIS *isets_local = NULL # <<<<<<<<<<<<<<
* if is_ is not None:
* assert len(is_) == nsd
*/
__pyx_v_isets_local = NULL;
/* "petsc4py/PETSc/PC.pyx":361
* cdef PetscIS *isets = NULL
* cdef PetscIS *isets_local = NULL
* if is_ is not None: # <<<<<<<<<<<<<<
* assert len(is_) == nsd
* CHKERR( PetscMalloc(<size_t>n*sizeof(PetscIS), &isets) )
*/
__pyx_t_2 = (__pyx_v_is_ != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/PC.pyx":362
* cdef PetscIS *isets_local = NULL
* if is_ is not None:
* assert len(is_) == 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_4 = PyObject_Length(__pyx_v_is_); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(47, 362, __pyx_L1_error)
__pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 362, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_v_nsd, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 362, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(47, 362, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(47, 362, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/PC.pyx":363
* if is_ is not None:
* assert len(is_) == nsd
* CHKERR( PetscMalloc(<size_t>n*sizeof(PetscIS), &isets) ) # <<<<<<<<<<<<<<
* for i in range(n):
* isets[i] = (<IS?>is_[i]).iset
*/
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_n) * (sizeof(IS))), (&__pyx_v_isets))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 363, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":364
* assert len(is_) == nsd
* CHKERR( PetscMalloc(<size_t>n*sizeof(PetscIS), &isets) )
* for i in range(n): # <<<<<<<<<<<<<<
* isets[i] = (<IS?>is_[i]).iset
* if is_local is not None:
*/
__pyx_t_1 = __pyx_v_n;
__pyx_t_8 = __pyx_t_1;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
/* "petsc4py/PETSc/PC.pyx":365
* CHKERR( PetscMalloc(<size_t>n*sizeof(PetscIS), &isets) )
* for i in range(n):
* isets[i] = (<IS?>is_[i]).iset # <<<<<<<<<<<<<<
* if is_local is not None:
* assert len(is_local) == nsd
*/
__pyx_t_6 = __Pyx_GetItemInt(__pyx_v_is_, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (!(likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(47, 365, __pyx_L1_error)
__pyx_t_10 = ((struct PyPetscISObject *)__pyx_t_6)->iset;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
(__pyx_v_isets[__pyx_v_i]) = __pyx_t_10;
}
/* "petsc4py/PETSc/PC.pyx":361
* cdef PetscIS *isets = NULL
* cdef PetscIS *isets_local = NULL
* if is_ is not None: # <<<<<<<<<<<<<<
* assert len(is_) == nsd
* CHKERR( PetscMalloc(<size_t>n*sizeof(PetscIS), &isets) )
*/
}
/* "petsc4py/PETSc/PC.pyx":366
* for i in range(n):
* isets[i] = (<IS?>is_[i]).iset
* if is_local is not None: # <<<<<<<<<<<<<<
* assert len(is_local) == nsd
* CHKERR( PetscMalloc(<size_t>n*sizeof(PetscIS), &isets_local) )
*/
__pyx_t_3 = (__pyx_v_is_local != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/PC.pyx":367
* isets[i] = (<IS?>is_[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_4 = PyObject_Length(__pyx_v_is_local); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(47, 367, __pyx_L1_error)
__pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_v_nsd, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 367, __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(47, 367, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(47, 367, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/PC.pyx":368
* 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_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_n) * (sizeof(IS))), (&__pyx_v_isets_local))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 368, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":369
* 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_8 = __pyx_t_1;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
/* "petsc4py/PETSc/PC.pyx":370
* 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_5 = __Pyx_GetItemInt(__pyx_v_is_local, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 370, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(47, 370, __pyx_L1_error)
__pyx_t_10 = ((struct PyPetscISObject *)__pyx_t_5)->iset;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
(__pyx_v_isets_local[__pyx_v_i]) = __pyx_t_10;
}
/* "petsc4py/PETSc/PC.pyx":366
* for i in range(n):
* isets[i] = (<IS?>is_[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":371
* 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_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCASMSetLocalSubdomains(__pyx_v_self->pc, __pyx_v_n, __pyx_v_isets, __pyx_v_isets_local)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 371, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":372
* 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_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_isets)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 372, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":373
* CHKERR( PCASMSetLocalSubdomains(self.pc, n, isets, isets_local) )
* CHKERR( PetscFree(isets) )
* CHKERR( PetscFree(isets_local) ) # <<<<<<<<<<<<<<
*
* def setASMTotalSubdomains(self, nsd, is_=None, is_local=None):
*/
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_isets_local)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 373, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":356
* CHKERR( PCASMSetOverlap(self.pc, ival) )
*
* def setASMLocalSubdomains(self, nsd, is_=None, is_local=None): # <<<<<<<<<<<<<<
* cdef PetscInt n = asInt(nsd)
* cdef PetscInt i = 0
*/
/* 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.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":375
* CHKERR( PetscFree(isets_local) )
*
* def setASMTotalSubdomains(self, nsd, is_=None, is_local=None): # <<<<<<<<<<<<<<
* cdef PetscInt n = asInt(nsd)
* cdef PetscInt i = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_77setASMTotalSubdomains(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_76setASMTotalSubdomains[] = "PC.setASMTotalSubdomains(self, nsd, is_=None, is_local=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_77setASMTotalSubdomains(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_nsd = 0;
PyObject *__pyx_v_is_ = 0;
PyObject *__pyx_v_is_local = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsd,&__pyx_n_s_is,&__pyx_n_s_is_local,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsd)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_local);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setASMTotalSubdomains") < 0)) __PYX_ERR(47, 375, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_nsd = values[0];
__pyx_v_is_ = values[1];
__pyx_v_is_local = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setASMTotalSubdomains", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 375, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setASMTotalSubdomains", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_76setASMTotalSubdomains(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_nsd, __pyx_v_is_, __pyx_v_is_local);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_76setASMTotalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_, PyObject *__pyx_v_is_local) {
PetscInt __pyx_v_n;
PetscInt __pyx_v_i;
IS *__pyx_v_isets;
IS *__pyx_v_isets_local;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
Py_ssize_t __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PetscErrorCode __pyx_t_7;
PetscInt __pyx_t_8;
PetscInt __pyx_t_9;
IS __pyx_t_10;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setASMTotalSubdomains", 0);
/* "petsc4py/PETSc/PC.pyx":376
*
* def setASMTotalSubdomains(self, nsd, is_=None, is_local=None):
* 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(47, 376, __pyx_L1_error)
__pyx_v_n = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":377
* def setASMTotalSubdomains(self, nsd, is_=None, is_local=None):
* 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":378
* cdef PetscInt n = asInt(nsd)
* cdef PetscInt i = 0
* cdef PetscIS *isets = NULL # <<<<<<<<<<<<<<
* cdef PetscIS *isets_local = NULL
* if is_ is not None:
*/
__pyx_v_isets = NULL;
/* "petsc4py/PETSc/PC.pyx":379
* cdef PetscInt i = 0
* cdef PetscIS *isets = NULL
* cdef PetscIS *isets_local = NULL # <<<<<<<<<<<<<<
* if is_ is not None:
* assert len(is_) == nsd
*/
__pyx_v_isets_local = NULL;
/* "petsc4py/PETSc/PC.pyx":380
* cdef PetscIS *isets = NULL
* cdef PetscIS *isets_local = NULL
* if is_ is not None: # <<<<<<<<<<<<<<
* assert len(is_) == nsd
* CHKERR( PetscMalloc(<size_t>n*sizeof(PetscIS), &isets) )
*/
__pyx_t_2 = (__pyx_v_is_ != Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/PC.pyx":381
* cdef PetscIS *isets_local = NULL
* if is_ is not None:
* assert len(is_) == 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_4 = PyObject_Length(__pyx_v_is_); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(47, 381, __pyx_L1_error)
__pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 381, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_v_nsd, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 381, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(47, 381, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(47, 381, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/PC.pyx":382
* if is_ is not None:
* assert len(is_) == nsd
* CHKERR( PetscMalloc(<size_t>n*sizeof(PetscIS), &isets) ) # <<<<<<<<<<<<<<
* for i in range(n):
* isets[i] = (<IS?>is_[i]).iset
*/
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_n) * (sizeof(IS))), (&__pyx_v_isets))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 382, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":383
* assert len(is_) == nsd
* CHKERR( PetscMalloc(<size_t>n*sizeof(PetscIS), &isets) )
* for i in range(n): # <<<<<<<<<<<<<<
* isets[i] = (<IS?>is_[i]).iset
* if is_local is not None:
*/
__pyx_t_1 = __pyx_v_n;
__pyx_t_8 = __pyx_t_1;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
/* "petsc4py/PETSc/PC.pyx":384
* CHKERR( PetscMalloc(<size_t>n*sizeof(PetscIS), &isets) )
* for i in range(n):
* isets[i] = (<IS?>is_[i]).iset # <<<<<<<<<<<<<<
* if is_local is not None:
* assert len(is_local) == nsd
*/
__pyx_t_6 = __Pyx_GetItemInt(__pyx_v_is_, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 384, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (!(likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(47, 384, __pyx_L1_error)
__pyx_t_10 = ((struct PyPetscISObject *)__pyx_t_6)->iset;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
(__pyx_v_isets[__pyx_v_i]) = __pyx_t_10;
}
/* "petsc4py/PETSc/PC.pyx":380
* cdef PetscIS *isets = NULL
* cdef PetscIS *isets_local = NULL
* if is_ is not None: # <<<<<<<<<<<<<<
* assert len(is_) == nsd
* CHKERR( PetscMalloc(<size_t>n*sizeof(PetscIS), &isets) )
*/
}
/* "petsc4py/PETSc/PC.pyx":385
* for i in range(n):
* isets[i] = (<IS?>is_[i]).iset
* if is_local is not None: # <<<<<<<<<<<<<<
* assert len(is_local) == nsd
* CHKERR( PetscMalloc(<size_t>n*sizeof(PetscIS), &isets_local) )
*/
__pyx_t_3 = (__pyx_v_is_local != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/PC.pyx":386
* isets[i] = (<IS?>is_[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_4 = PyObject_Length(__pyx_v_is_local); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(47, 386, __pyx_L1_error)
__pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_v_nsd, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 386, __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(47, 386, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(47, 386, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/PC.pyx":387
* 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_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_n) * (sizeof(IS))), (&__pyx_v_isets_local))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 387, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":388
* 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_8 = __pyx_t_1;
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
/* "petsc4py/PETSc/PC.pyx":389
* 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_5 = __Pyx_GetItemInt(__pyx_v_is_local, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 389, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(47, 389, __pyx_L1_error)
__pyx_t_10 = ((struct PyPetscISObject *)__pyx_t_5)->iset;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
(__pyx_v_isets_local[__pyx_v_i]) = __pyx_t_10;
}
/* "petsc4py/PETSc/PC.pyx":385
* for i in range(n):
* isets[i] = (<IS?>is_[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":390
* 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_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCASMSetTotalSubdomains(__pyx_v_self->pc, __pyx_v_n, __pyx_v_isets, __pyx_v_isets_local)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 390, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":391
* 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_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_isets)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 391, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":392
* CHKERR( PCASMSetTotalSubdomains(self.pc, n, isets, isets_local) )
* CHKERR( PetscFree(isets) )
* CHKERR( PetscFree(isets_local) ) # <<<<<<<<<<<<<<
*
* def getASMSubKSP(self):
*/
__pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_isets_local)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 392, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":375
* CHKERR( PetscFree(isets_local) )
*
* def setASMTotalSubdomains(self, nsd, is_=None, is_local=None): # <<<<<<<<<<<<<<
* cdef PetscInt n = asInt(nsd)
* cdef PetscInt i = 0
*/
/* 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.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":394
* CHKERR( PetscFree(isets_local) )
*
* def getASMSubKSP(self): # <<<<<<<<<<<<<<
* cdef PetscInt i = 0, n = 0
* cdef PetscKSP *p = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_79getASMSubKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_78getASMSubKSP[] = "PC.getASMSubKSP(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_79getASMSubKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getASMSubKSP (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getASMSubKSP", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getASMSubKSP", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_78getASMSubKSP(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_78getASMSubKSP(struct PyPetscPCObject *__pyx_v_self) {
CYTHON_UNUSED PetscInt __pyx_v_i;
PetscInt __pyx_v_n;
KSP *__pyx_v_p;
PetscInt __pyx_8genexpr8__pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscInt __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getASMSubKSP", 0);
/* "petsc4py/PETSc/PC.pyx":395
*
* def getASMSubKSP(self):
* cdef PetscInt i = 0, n = 0 # <<<<<<<<<<<<<<
* cdef PetscKSP *p = NULL
* CHKERR( PCASMGetSubKSP(self.pc, &n, NULL, &p) )
*/
__pyx_v_i = 0;
__pyx_v_n = 0;
/* "petsc4py/PETSc/PC.pyx":396
* def getASMSubKSP(self):
* cdef PetscInt i = 0, n = 0
* cdef PetscKSP *p = NULL # <<<<<<<<<<<<<<
* CHKERR( PCASMGetSubKSP(self.pc, &n, NULL, &p) )
* return [ref_KSP(p[i]) for i from 0 <= i <n]
*/
__pyx_v_p = NULL;
/* "petsc4py/PETSc/PC.pyx":397
* cdef PetscInt i = 0, n = 0
* cdef PetscKSP *p = NULL
* CHKERR( PCASMGetSubKSP(self.pc, &n, NULL, &p) ) # <<<<<<<<<<<<<<
* return [ref_KSP(p[i]) for i from 0 <= i <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(47, 397, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":398
* 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):
*/
__Pyx_XDECREF(__pyx_r);
{ /* enter inner scope */
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 398, __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(47, 398, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(47, 398, __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":394
* CHKERR( PetscFree(isets_local) )
*
* def getASMSubKSP(self): # <<<<<<<<<<<<<<
* cdef PetscInt i = 0, n = 0
* cdef PetscKSP *p = NULL
*/
/* 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":400
* return [ref_KSP(p[i]) for i from 0 <= i <n]
*
* def setASMSortIndices(self, dosort): # <<<<<<<<<<<<<<
* cdef PetscBool cdosort = asBool(dosort)
* CHKERR( PCASMSetSortIndices(self.pc, cdosort) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_81setASMSortIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_80setASMSortIndices[] = "PC.setASMSortIndices(self, dosort)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_81setASMSortIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_dosort = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dosort,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dosort)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setASMSortIndices") < 0)) __PYX_ERR(47, 400, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_dosort = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setASMSortIndices", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 400, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setASMSortIndices", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_80setASMSortIndices(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_dosort);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_80setASMSortIndices(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_dosort) {
PetscBool __pyx_v_cdosort;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscBool __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setASMSortIndices", 0);
/* "petsc4py/PETSc/PC.pyx":401
*
* def setASMSortIndices(self, dosort):
* 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(47, 401, __pyx_L1_error)
__pyx_v_cdosort = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":402
* def setASMSortIndices(self, dosort):
* 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(47, 402, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":400
* return [ref_KSP(p[i]) for i from 0 <= i <n]
*
* def setASMSortIndices(self, dosort): # <<<<<<<<<<<<<<
* cdef PetscBool cdosort = asBool(dosort)
* CHKERR( PCASMSetSortIndices(self.pc, cdosort) )
*/
/* 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":406
* # --- GASM ---
*
* def setGASMType(self, gasmtype): # <<<<<<<<<<<<<<
* cdef PetscPCGASMType cval = gasmtype
* CHKERR( PCGASMSetType(self.pc, cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_83setGASMType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_82setGASMType[] = "PC.setGASMType(self, gasmtype)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_83setGASMType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_gasmtype = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gasmtype,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gasmtype)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGASMType") < 0)) __PYX_ERR(47, 406, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_gasmtype = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setGASMType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 406, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setGASMType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_82setGASMType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_gasmtype);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_82setGASMType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_gasmtype) {
PCGASMType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PCGASMType __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setGASMType", 0);
/* "petsc4py/PETSc/PC.pyx":407
*
* def setGASMType(self, gasmtype):
* cdef PetscPCGASMType cval = gasmtype # <<<<<<<<<<<<<<
* CHKERR( PCGASMSetType(self.pc, cval) )
*
*/
__pyx_t_1 = ((PCGASMType)__Pyx_PyInt_As_PCGASMType(__pyx_v_gasmtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 407, __pyx_L1_error)
__pyx_v_cval = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":408
* def setGASMType(self, gasmtype):
* cdef PetscPCGASMType cval = gasmtype
* CHKERR( PCGASMSetType(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def setGASMOverlap(self, overlap):
*/
__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(47, 408, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":406
* # --- GASM ---
*
* def setGASMType(self, gasmtype): # <<<<<<<<<<<<<<
* cdef PetscPCGASMType cval = gasmtype
* CHKERR( PCGASMSetType(self.pc, cval) )
*/
/* 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":410
* CHKERR( PCGASMSetType(self.pc, cval) )
*
* def setGASMOverlap(self, overlap): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(overlap)
* CHKERR( PCGASMSetOverlap(self.pc, ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_85setGASMOverlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_84setGASMOverlap[] = "PC.setGASMOverlap(self, overlap)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_85setGASMOverlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_overlap = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_overlap,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overlap)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGASMOverlap") < 0)) __PYX_ERR(47, 410, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_overlap = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setGASMOverlap", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 410, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setGASMOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_84setGASMOverlap(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_overlap);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_84setGASMOverlap(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_overlap) {
PetscInt __pyx_v_ival;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setGASMOverlap", 0);
/* "petsc4py/PETSc/PC.pyx":411
*
* def setGASMOverlap(self, overlap):
* 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(47, 411, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":412
* def setGASMOverlap(self, overlap):
* 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(47, 412, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":410
* CHKERR( PCGASMSetType(self.pc, cval) )
*
* def setGASMOverlap(self, overlap): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(overlap)
* CHKERR( PCGASMSetOverlap(self.pc, ival) )
*/
/* 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":416
* # --- GAMG ---
*
* def setGAMGType(self, gamgtype): # <<<<<<<<<<<<<<
* cdef PetscPCGAMGType cval = NULL
* gamgtype = str2bytes(gamgtype, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_87setGAMGType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_86setGAMGType[] = "PC.setGAMGType(self, gamgtype)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_87setGAMGType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_gamgtype = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gamgtype,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gamgtype)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGAMGType") < 0)) __PYX_ERR(47, 416, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_gamgtype = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setGAMGType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 416, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setGAMGType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_86setGAMGType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_gamgtype);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_86setGAMGType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_gamgtype) {
PCGAMGType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setGAMGType", 0);
__Pyx_INCREF(__pyx_v_gamgtype);
/* "petsc4py/PETSc/PC.pyx":417
*
* def setGAMGType(self, gamgtype):
* cdef PetscPCGAMGType cval = NULL # <<<<<<<<<<<<<<
* gamgtype = str2bytes(gamgtype, &cval)
* CHKERR( PCGAMGSetType(self.pc, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/PC.pyx":418
* def setGAMGType(self, gamgtype):
* 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(47, 418, __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":419
* cdef PetscPCGAMGType cval = NULL
* gamgtype = str2bytes(gamgtype, &cval)
* CHKERR( PCGAMGSetType(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def setGAMGLevels(self, levels):
*/
__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(47, 419, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":416
* # --- GAMG ---
*
* def setGAMGType(self, gamgtype): # <<<<<<<<<<<<<<
* cdef PetscPCGAMGType cval = NULL
* gamgtype = str2bytes(gamgtype, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":421
* CHKERR( PCGAMGSetType(self.pc, cval) )
*
* def setGAMGLevels(self, levels): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(levels)
* CHKERR( PCGAMGSetNlevels(self.pc, ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_89setGAMGLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_88setGAMGLevels[] = "PC.setGAMGLevels(self, levels)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_89setGAMGLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_levels = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGAMGLevels") < 0)) __PYX_ERR(47, 421, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_levels = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setGAMGLevels", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 421, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setGAMGLevels", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_88setGAMGLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_88setGAMGLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels) {
PetscInt __pyx_v_ival;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setGAMGLevels", 0);
/* "petsc4py/PETSc/PC.pyx":422
*
* def setGAMGLevels(self, levels):
* 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(47, 422, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":423
* def setGAMGLevels(self, levels):
* cdef PetscInt ival = asInt(levels)
* CHKERR( PCGAMGSetNlevels(self.pc, ival) ) # <<<<<<<<<<<<<<
*
* def setGAMGSmooths(self, smooths):
*/
__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(47, 423, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":421
* CHKERR( PCGAMGSetType(self.pc, cval) )
*
* def setGAMGLevels(self, levels): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(levels)
* CHKERR( PCGAMGSetNlevels(self.pc, ival) )
*/
/* 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":425
* CHKERR( PCGAMGSetNlevels(self.pc, ival) )
*
* def setGAMGSmooths(self, smooths): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(smooths)
* CHKERR( PCGAMGSetNSmooths(self.pc, ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_91setGAMGSmooths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_90setGAMGSmooths[] = "PC.setGAMGSmooths(self, smooths)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_91setGAMGSmooths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_smooths = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_smooths,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_smooths)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGAMGSmooths") < 0)) __PYX_ERR(47, 425, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_smooths = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setGAMGSmooths", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 425, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setGAMGSmooths", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_90setGAMGSmooths(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_smooths);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_90setGAMGSmooths(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_smooths) {
PetscInt __pyx_v_ival;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setGAMGSmooths", 0);
/* "petsc4py/PETSc/PC.pyx":426
*
* def setGAMGSmooths(self, smooths):
* 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(47, 426, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":427
* def setGAMGSmooths(self, smooths):
* 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(47, 427, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":425
* CHKERR( PCGAMGSetNlevels(self.pc, ival) )
*
* def setGAMGSmooths(self, smooths): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(smooths)
* CHKERR( PCGAMGSetNSmooths(self.pc, ival) )
*/
/* 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":431
* # --- Hypre ---
*
* def getHYPREType(self): # <<<<<<<<<<<<<<
* cdef PetscPCHYPREType cval = NULL
* CHKERR( PCHYPREGetType(self.pc, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_93getHYPREType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_92getHYPREType[] = "PC.getHYPREType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_93getHYPREType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getHYPREType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getHYPREType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getHYPREType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_92getHYPREType(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_92getHYPREType(struct PyPetscPCObject *__pyx_v_self) {
const char* __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getHYPREType", 0);
/* "petsc4py/PETSc/PC.pyx":432
*
* def getHYPREType(self):
* cdef PetscPCHYPREType cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PCHYPREGetType(self.pc, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/PC.pyx":433
* def getHYPREType(self):
* 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(47, 433, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":434
* cdef PetscPCHYPREType cval = NULL
* CHKERR( PCHYPREGetType(self.pc, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def setHYPREType(self, hypretype):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 434, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":431
* # --- Hypre ---
*
* def getHYPREType(self): # <<<<<<<<<<<<<<
* cdef PetscPCHYPREType cval = NULL
* CHKERR( PCHYPREGetType(self.pc, &cval) )
*/
/* 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":436
* return bytes2str(cval)
*
* def setHYPREType(self, hypretype): # <<<<<<<<<<<<<<
* cdef PetscPCHYPREType cval = NULL
* hypretype = str2bytes(hypretype, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_95setHYPREType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_94setHYPREType[] = "PC.setHYPREType(self, hypretype)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_95setHYPREType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_hypretype = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hypretype,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hypretype)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHYPREType") < 0)) __PYX_ERR(47, 436, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_hypretype = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setHYPREType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 436, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_94setHYPREType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_hypretype);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_94setHYPREType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_hypretype) {
const char* __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setHYPREType", 0);
__Pyx_INCREF(__pyx_v_hypretype);
/* "petsc4py/PETSc/PC.pyx":437
*
* def setHYPREType(self, hypretype):
* cdef PetscPCHYPREType cval = NULL # <<<<<<<<<<<<<<
* hypretype = str2bytes(hypretype, &cval)
* CHKERR( PCHYPRESetType(self.pc, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/PC.pyx":438
* def setHYPREType(self, hypretype):
* 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(47, 438, __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":439
* cdef PetscPCHYPREType cval = NULL
* hypretype = str2bytes(hypretype, &cval)
* CHKERR( PCHYPRESetType(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def setHYPREDiscreteCurl(self, Mat mat):
*/
__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(47, 439, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":436
* return bytes2str(cval)
*
* def setHYPREType(self, hypretype): # <<<<<<<<<<<<<<
* cdef PetscPCHYPREType cval = NULL
* hypretype = str2bytes(hypretype, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":441
* CHKERR( PCHYPRESetType(self.pc, cval) )
*
* def setHYPREDiscreteCurl(self, Mat mat): # <<<<<<<<<<<<<<
* CHKERR( PCHYPRESetDiscreteCurl(self.pc, mat.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_97setHYPREDiscreteCurl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_96setHYPREDiscreteCurl[] = "PC.setHYPREDiscreteCurl(self, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_97setHYPREDiscreteCurl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHYPREDiscreteCurl") < 0)) __PYX_ERR(47, 441, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setHYPREDiscreteCurl", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 441, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREDiscreteCurl", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(47, 441, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_96setHYPREDiscreteCurl(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_96setHYPREDiscreteCurl(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setHYPREDiscreteCurl", 0);
/* "petsc4py/PETSc/PC.pyx":442
*
* def setHYPREDiscreteCurl(self, Mat mat):
* CHKERR( PCHYPRESetDiscreteCurl(self.pc, mat.mat) ) # <<<<<<<<<<<<<<
*
* def setHYPREDiscreteGradient(self, Mat mat):
*/
__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(47, 442, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":441
* CHKERR( PCHYPRESetType(self.pc, cval) )
*
* def setHYPREDiscreteCurl(self, Mat mat): # <<<<<<<<<<<<<<
* CHKERR( PCHYPRESetDiscreteCurl(self.pc, mat.mat) )
*
*/
/* 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":444
* CHKERR( PCHYPRESetDiscreteCurl(self.pc, mat.mat) )
*
* def setHYPREDiscreteGradient(self, Mat mat): # <<<<<<<<<<<<<<
* CHKERR( PCHYPRESetDiscreteGradient(self.pc, mat.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_99setHYPREDiscreteGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_98setHYPREDiscreteGradient[] = "PC.setHYPREDiscreteGradient(self, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_99setHYPREDiscreteGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHYPREDiscreteGradient") < 0)) __PYX_ERR(47, 444, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setHYPREDiscreteGradient", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 444, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREDiscreteGradient", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(47, 444, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_98setHYPREDiscreteGradient(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_98setHYPREDiscreteGradient(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setHYPREDiscreteGradient", 0);
/* "petsc4py/PETSc/PC.pyx":445
*
* def setHYPREDiscreteGradient(self, Mat mat):
* CHKERR( PCHYPRESetDiscreteGradient(self.pc, mat.mat) ) # <<<<<<<<<<<<<<
*
* def setHYPRESetAlphaPoissonMatrix(self, Mat mat):
*/
__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(47, 445, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":444
* CHKERR( PCHYPRESetDiscreteCurl(self.pc, mat.mat) )
*
* def setHYPREDiscreteGradient(self, Mat mat): # <<<<<<<<<<<<<<
* CHKERR( PCHYPRESetDiscreteGradient(self.pc, mat.mat) )
*
*/
/* 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":447
* CHKERR( PCHYPRESetDiscreteGradient(self.pc, mat.mat) )
*
* def setHYPRESetAlphaPoissonMatrix(self, Mat mat): # <<<<<<<<<<<<<<
* CHKERR( PCHYPRESetAlphaPoissonMatrix(self.pc, mat.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_101setHYPRESetAlphaPoissonMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_100setHYPRESetAlphaPoissonMatrix[] = "PC.setHYPRESetAlphaPoissonMatrix(self, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_101setHYPRESetAlphaPoissonMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHYPRESetAlphaPoissonMatrix") < 0)) __PYX_ERR(47, 447, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setHYPRESetAlphaPoissonMatrix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 447, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetAlphaPoissonMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(47, 447, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_100setHYPRESetAlphaPoissonMatrix(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_100setHYPRESetAlphaPoissonMatrix(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setHYPRESetAlphaPoissonMatrix", 0);
/* "petsc4py/PETSc/PC.pyx":448
*
* def setHYPRESetAlphaPoissonMatrix(self, Mat mat):
* CHKERR( PCHYPRESetAlphaPoissonMatrix(self.pc, mat.mat) ) # <<<<<<<<<<<<<<
*
* def setHYPRESetBetaPoissonMatrix(self, Mat mat=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(47, 448, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":447
* CHKERR( PCHYPRESetDiscreteGradient(self.pc, mat.mat) )
*
* def setHYPRESetAlphaPoissonMatrix(self, Mat mat): # <<<<<<<<<<<<<<
* CHKERR( PCHYPRESetAlphaPoissonMatrix(self.pc, mat.mat) )
*
*/
/* 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":450
* CHKERR( PCHYPRESetAlphaPoissonMatrix(self.pc, mat.mat) )
*
* def setHYPRESetBetaPoissonMatrix(self, Mat mat=None): # <<<<<<<<<<<<<<
* cdef PetscMat pmat = NULL
* if mat is not None: pmat = mat.mat
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_103setHYPRESetBetaPoissonMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_102setHYPRESetBetaPoissonMatrix[] = "PC.setHYPRESetBetaPoissonMatrix(self, Mat mat=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_103setHYPRESetBetaPoissonMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHYPRESetBetaPoissonMatrix") < 0)) __PYX_ERR(47, 450, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setHYPRESetBetaPoissonMatrix", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 450, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetBetaPoissonMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "mat", 0))) __PYX_ERR(47, 450, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_102setHYPRESetBetaPoissonMatrix(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_102setHYPRESetBetaPoissonMatrix(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) {
Mat __pyx_v_pmat;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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("setHYPRESetBetaPoissonMatrix", 0);
/* "petsc4py/PETSc/PC.pyx":451
*
* def setHYPRESetBetaPoissonMatrix(self, Mat mat=None):
* 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":452
* def setHYPRESetBetaPoissonMatrix(self, Mat mat=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_mat->mat;
__pyx_v_pmat = __pyx_t_3;
}
/* "petsc4py/PETSc/PC.pyx":453
* cdef PetscMat pmat = NULL
* if mat is not None: pmat = mat.mat
* CHKERR( PCHYPRESetBetaPoissonMatrix(self.pc, pmat) ) # <<<<<<<<<<<<<<
*
* def setHYPRESetInterpolations(self, dim, Mat RT_Pi_Full=None, RT_Pi=None,
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPRESetBetaPoissonMatrix(__pyx_v_self->pc, __pyx_v_pmat)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 453, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":450
* CHKERR( PCHYPRESetAlphaPoissonMatrix(self.pc, mat.mat) )
*
* def setHYPRESetBetaPoissonMatrix(self, Mat mat=None): # <<<<<<<<<<<<<<
* cdef PetscMat pmat = NULL
* if mat is not None: pmat = mat.mat
*/
/* 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":455
* CHKERR( PCHYPRESetBetaPoissonMatrix(self.pc, pmat) )
*
* def setHYPRESetInterpolations(self, dim, Mat RT_Pi_Full=None, RT_Pi=None, # <<<<<<<<<<<<<<
* Mat ND_Pi_Full=None, ND_Pi=None):
* cdef PetscMat RT_full_mat = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_105setHYPRESetInterpolations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_104setHYPRESetInterpolations[] = "PC.setHYPRESetInterpolations(self, dim, Mat RT_Pi_Full=None, RT_Pi=None, Mat ND_Pi_Full=None, ND_Pi=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_105setHYPRESetInterpolations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setHYPRESetInterpolations (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,&__pyx_n_s_RT_Pi_Full,&__pyx_n_s_RT_Pi,&__pyx_n_s_ND_Pi_Full,&__pyx_n_s_ND_Pi,0};
PyObject* values[5] = {0,0,0,0,0};
values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None);
values[2] = ((PyObject *)Py_None);
/* "petsc4py/PETSc/PC.pyx":456
*
* def setHYPRESetInterpolations(self, dim, Mat RT_Pi_Full=None, RT_Pi=None,
* Mat ND_Pi_Full=None, ND_Pi=None): # <<<<<<<<<<<<<<
* cdef PetscMat RT_full_mat = NULL
* if RT_Pi_Full is not None: RT_full_mat = RT_Pi_Full.mat
*/
values[3] = (PyObject *)((struct PyPetscMatObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_RT_Pi_Full);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_RT_Pi);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ND_Pi_Full);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ND_Pi);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHYPRESetInterpolations") < 0)) __PYX_ERR(47, 455, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_dim = values[0];
__pyx_v_RT_Pi_Full = ((struct PyPetscMatObject *)values[1]);
__pyx_v_RT_Pi = values[2];
__pyx_v_ND_Pi_Full = ((struct PyPetscMatObject *)values[3]);
__pyx_v_ND_Pi = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setHYPRESetInterpolations", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 455, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetInterpolations", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_RT_Pi_Full), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "RT_Pi_Full", 0))) __PYX_ERR(47, 455, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ND_Pi_Full), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "ND_Pi_Full", 0))) __PYX_ERR(47, 456, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_104setHYPRESetInterpolations(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_dim, __pyx_v_RT_Pi_Full, __pyx_v_RT_Pi, __pyx_v_ND_Pi_Full, __pyx_v_ND_Pi);
/* "petsc4py/PETSc/PC.pyx":455
* CHKERR( PCHYPRESetBetaPoissonMatrix(self.pc, pmat) )
*
* def setHYPRESetInterpolations(self, dim, Mat RT_Pi_Full=None, RT_Pi=None, # <<<<<<<<<<<<<<
* Mat ND_Pi_Full=None, ND_Pi=None):
* cdef PetscMat RT_full_mat = NULL
*/
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_104setHYPRESetInterpolations(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_dim, struct PyPetscMatObject *__pyx_v_RT_Pi_Full, PyObject *__pyx_v_RT_Pi, struct PyPetscMatObject *__pyx_v_ND_Pi_Full, PyObject *__pyx_v_ND_Pi) {
Mat __pyx_v_RT_full_mat;
Mat __pyx_v_ND_full_mat;
PetscInt __pyx_v_idim;
Mat *__pyx_v_RT_Pi_mat;
PyObject *__pyx_v_i = NULL;
Mat *__pyx_v_ND_Pi_mat;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
Mat __pyx_t_3;
PetscInt __pyx_t_4;
size_t __pyx_t_5;
Py_ssize_t __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *(*__pyx_t_9)(PyObject *);
Py_ssize_t __pyx_t_10;
PetscErrorCode __pyx_t_11;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setHYPRESetInterpolations", 0);
/* "petsc4py/PETSc/PC.pyx":457
* def setHYPRESetInterpolations(self, dim, Mat RT_Pi_Full=None, RT_Pi=None,
* Mat ND_Pi_Full=None, ND_Pi=None):
* 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":458
* Mat ND_Pi_Full=None, ND_Pi=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_RT_Pi_Full->mat;
__pyx_v_RT_full_mat = __pyx_t_3;
}
/* "petsc4py/PETSc/PC.pyx":459
* 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":460
* 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_2 = (((PyObject *)__pyx_v_ND_Pi_Full) != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __pyx_v_ND_Pi_Full->mat;
__pyx_v_ND_full_mat = __pyx_t_3;
}
/* "petsc4py/PETSc/PC.pyx":461
* 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_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 461, __pyx_L1_error)
__pyx_v_idim = __pyx_t_4;
/* "petsc4py/PETSc/PC.pyx":462
* 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":463
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/PC.pyx":464
* 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_5 = __Pyx_PyInt_As_size_t(__pyx_v_dim); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(47, 464, __pyx_L1_error)
(void)(PetscMalloc((((size_t)__pyx_t_5) * (sizeof(Mat))), (&__pyx_v_RT_Pi_mat)));
/* "petsc4py/PETSc/PC.pyx":465
* 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_6 = PyObject_Length(__pyx_v_RT_Pi); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(47, 465, __pyx_L1_error)
__pyx_t_7 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 465, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_v_dim, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(47, 465, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(47, 465, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_2)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(47, 465, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/PC.pyx":466
* 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_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_dim); if (unlikely(!__pyx_t_8)) __PYX_ERR(47, 466, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
__pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); __pyx_t_6 = 0;
__pyx_t_9 = NULL;
} else {
__pyx_t_6 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 466, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(47, 466, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
for (;;) {
if (likely(!__pyx_t_9)) {
if (likely(PyList_CheckExact(__pyx_t_7))) {
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(47, 466, __pyx_L1_error)
#else
__pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(47, 466, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
#endif
} else {
if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(47, 466, __pyx_L1_error)
#else
__pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(47, 466, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
#endif
}
} else {
__pyx_t_8 = __pyx_t_9(__pyx_t_7);
if (unlikely(!__pyx_t_8)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(47, 466, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_8);
}
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
__pyx_t_8 = 0;
/* "petsc4py/PETSc/PC.pyx":467
* 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_8 = __Pyx_PyObject_GetItem(__pyx_v_RT_Pi, __pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(47, 467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(47, 467, __pyx_L1_error)
__pyx_t_3 = ((struct PyPetscMatObject *)__pyx_t_8)->mat;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(47, 467, __pyx_L1_error)
(__pyx_v_RT_Pi_mat[__pyx_t_10]) = __pyx_t_3;
/* "petsc4py/PETSc/PC.pyx":466
* 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_7); __pyx_t_7 = 0;
/* "petsc4py/PETSc/PC.pyx":463
* 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":468
* 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":469
* 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_2 = (__pyx_v_ND_Pi != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/PC.pyx":470
* 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_5 = __Pyx_PyInt_As_size_t(__pyx_v_dim); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(47, 470, __pyx_L1_error)
(void)(PetscMalloc((((size_t)__pyx_t_5) * (sizeof(Mat))), (&__pyx_v_ND_Pi_mat)));
/* "petsc4py/PETSc/PC.pyx":471
* 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_6 = PyObject_Length(__pyx_v_ND_Pi); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(47, 471, __pyx_L1_error)
__pyx_t_7 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 471, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_v_dim, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(47, 471, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(47, 471, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(!__pyx_t_1)) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(47, 471, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/PC.pyx":472
* 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_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_dim); if (unlikely(!__pyx_t_8)) __PYX_ERR(47, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
__pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); __pyx_t_6 = 0;
__pyx_t_9 = NULL;
} else {
__pyx_t_6 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(47, 472, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
for (;;) {
if (likely(!__pyx_t_9)) {
if (likely(PyList_CheckExact(__pyx_t_7))) {
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(47, 472, __pyx_L1_error)
#else
__pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(47, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
#endif
} else {
if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(47, 472, __pyx_L1_error)
#else
__pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(47, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
#endif
}
} else {
__pyx_t_8 = __pyx_t_9(__pyx_t_7);
if (unlikely(!__pyx_t_8)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(47, 472, __pyx_L1_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_8);
}
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
__pyx_t_8 = 0;
/* "petsc4py/PETSc/PC.pyx":473
* 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_8 = __Pyx_PyObject_GetItem(__pyx_v_ND_Pi, __pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(47, 473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(47, 473, __pyx_L1_error)
__pyx_t_3 = ((struct PyPetscMatObject *)__pyx_t_8)->mat;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(47, 473, __pyx_L1_error)
(__pyx_v_ND_Pi_mat[__pyx_t_10]) = __pyx_t_3;
/* "petsc4py/PETSc/PC.pyx":472
* 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_7); __pyx_t_7 = 0;
/* "petsc4py/PETSc/PC.pyx":469
* 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":474
* 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_11 = __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_11 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 474, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":476
* 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_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_RT_Pi_mat)); if (unlikely(__pyx_t_11 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 476, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":477
* ND_full_mat, ND_Pi_mat))
* CHKERR (PetscFree(RT_Pi_mat))
* CHKERR (PetscFree(ND_Pi_mat)) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ND_Pi_mat)); if (unlikely(__pyx_t_11 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 477, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":455
* CHKERR( PCHYPRESetBetaPoissonMatrix(self.pc, pmat) )
*
* def setHYPRESetInterpolations(self, dim, Mat RT_Pi_Full=None, RT_Pi=None, # <<<<<<<<<<<<<<
* Mat ND_Pi_Full=None, ND_Pi=None):
* cdef PetscMat RT_full_mat = NULL
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__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":481
*
*
* def setHYPRESetEdgeConstantVectors(self, Vec ozz, Vec zoz, Vec zzo=None): # <<<<<<<<<<<<<<
* cdef PetscVec zzo_vec = NULL
* if zzo is not None: zzo_vec = zzo.vec
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_107setHYPRESetEdgeConstantVectors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_106setHYPRESetEdgeConstantVectors[] = "PC.setHYPRESetEdgeConstantVectors(self, Vec ozz, Vec zoz, Vec zzo=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_107setHYPRESetEdgeConstantVectors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_ozz = 0;
struct PyPetscVecObject *__pyx_v_zoz = 0;
struct PyPetscVecObject *__pyx_v_zzo = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ozz,&__pyx_n_s_zoz,&__pyx_n_s_zzo,0};
PyObject* values[3] = {0,0,0};
values[2] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ozz)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zoz)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setHYPRESetEdgeConstantVectors", 0, 2, 3, 1); __PYX_ERR(47, 481, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zzo);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHYPRESetEdgeConstantVectors") < 0)) __PYX_ERR(47, 481, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_ozz = ((struct PyPetscVecObject *)values[0]);
__pyx_v_zoz = ((struct PyPetscVecObject *)values[1]);
__pyx_v_zzo = ((struct PyPetscVecObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setHYPRESetEdgeConstantVectors", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 481, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetEdgeConstantVectors", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ozz), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "ozz", 0))) __PYX_ERR(47, 481, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zoz), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "zoz", 0))) __PYX_ERR(47, 481, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zzo), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "zzo", 0))) __PYX_ERR(47, 481, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_106setHYPRESetEdgeConstantVectors(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ozz, __pyx_v_zoz, __pyx_v_zzo);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_106setHYPRESetEdgeConstantVectors(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_ozz, struct PyPetscVecObject *__pyx_v_zoz, struct PyPetscVecObject *__pyx_v_zzo) {
Vec __pyx_v_zzo_vec;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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("setHYPRESetEdgeConstantVectors", 0);
/* "petsc4py/PETSc/PC.pyx":482
*
* def setHYPRESetEdgeConstantVectors(self, Vec ozz, Vec zoz, Vec zzo=None):
* 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":483
* def setHYPRESetEdgeConstantVectors(self, Vec ozz, Vec zoz, Vec zzo=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_zzo->vec;
__pyx_v_zzo_vec = __pyx_t_3;
}
/* "petsc4py/PETSc/PC.pyx":484
* 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_4 = __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_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 484, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":481
*
*
* def setHYPRESetEdgeConstantVectors(self, Vec ozz, Vec zoz, Vec zzo=None): # <<<<<<<<<<<<<<
* cdef PetscVec zzo_vec = NULL
* if zzo is not None: zzo_vec = zzo.vec
*/
/* 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":487
* zzo_vec) )
*
* def setHYPREAMSSetInteriorNodes(self, Vec interior): # <<<<<<<<<<<<<<
* CHKERR(PCHYPREAMSSetInteriorNodes(self.pc, interior.vec))
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_109setHYPREAMSSetInteriorNodes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_108setHYPREAMSSetInteriorNodes[] = "PC.setHYPREAMSSetInteriorNodes(self, Vec interior)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_109setHYPREAMSSetInteriorNodes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_interior = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_interior,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interior)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHYPREAMSSetInteriorNodes") < 0)) __PYX_ERR(47, 487, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_interior = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setHYPREAMSSetInteriorNodes", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 487, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREAMSSetInteriorNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interior), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "interior", 0))) __PYX_ERR(47, 487, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_108setHYPREAMSSetInteriorNodes(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_interior);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_108setHYPREAMSSetInteriorNodes(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_interior) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setHYPREAMSSetInteriorNodes", 0);
/* "petsc4py/PETSc/PC.pyx":488
*
* def setHYPREAMSSetInteriorNodes(self, Vec interior):
* 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(47, 488, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":487
* zzo_vec) )
*
* def setHYPREAMSSetInteriorNodes(self, Vec interior): # <<<<<<<<<<<<<<
* CHKERR(PCHYPREAMSSetInteriorNodes(self.pc, interior.vec))
*
*/
/* 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":492
* # --- Factor ---
*
* def setFactorSolverType(self, solver): # <<<<<<<<<<<<<<
* cdef PetscMatSolverType cval = NULL
* solver = str2bytes(solver, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_111setFactorSolverType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_110setFactorSolverType[] = "PC.setFactorSolverType(self, solver)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_111setFactorSolverType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_solver = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_solver,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_solver)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFactorSolverType") < 0)) __PYX_ERR(47, 492, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_solver = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFactorSolverType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 492, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorSolverType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_110setFactorSolverType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_solver);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_110setFactorSolverType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_solver) {
MatSolverType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFactorSolverType", 0);
__Pyx_INCREF(__pyx_v_solver);
/* "petsc4py/PETSc/PC.pyx":493
*
* def setFactorSolverType(self, solver):
* cdef PetscMatSolverType cval = NULL # <<<<<<<<<<<<<<
* solver = str2bytes(solver, &cval)
* CHKERR( PCFactorSetMatSolverType(self.pc, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/PC.pyx":494
* def setFactorSolverType(self, solver):
* 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(47, 494, __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":495
* cdef PetscMatSolverType cval = NULL
* solver = str2bytes(solver, &cval)
* CHKERR( PCFactorSetMatSolverType(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def getFactorSolverType(self):
*/
__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(47, 495, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":492
* # --- Factor ---
*
* def setFactorSolverType(self, solver): # <<<<<<<<<<<<<<
* cdef PetscMatSolverType cval = NULL
* solver = str2bytes(solver, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":497
* CHKERR( PCFactorSetMatSolverType(self.pc, cval) )
*
* def getFactorSolverType(self): # <<<<<<<<<<<<<<
* cdef PetscMatSolverType cval = NULL
* CHKERR( PCFactorGetMatSolverType(self.pc, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_113getFactorSolverType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_112getFactorSolverType[] = "PC.getFactorSolverType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_113getFactorSolverType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFactorSolverType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFactorSolverType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFactorSolverType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_112getFactorSolverType(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_112getFactorSolverType(struct PyPetscPCObject *__pyx_v_self) {
MatSolverType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFactorSolverType", 0);
/* "petsc4py/PETSc/PC.pyx":498
*
* def getFactorSolverType(self):
* cdef PetscMatSolverType cval = NULL # <<<<<<<<<<<<<<
* CHKERR( PCFactorGetMatSolverType(self.pc, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/PC.pyx":499
* def getFactorSolverType(self):
* 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(47, 499, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":500
* cdef PetscMatSolverType cval = NULL
* CHKERR( PCFactorGetMatSolverType(self.pc, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def setFactorSetUpSolverType(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 500, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":497
* CHKERR( PCFactorSetMatSolverType(self.pc, cval) )
*
* def getFactorSolverType(self): # <<<<<<<<<<<<<<
* cdef PetscMatSolverType cval = NULL
* CHKERR( PCFactorGetMatSolverType(self.pc, &cval) )
*/
/* 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":502
* return bytes2str(cval)
*
* def setFactorSetUpSolverType(self): # <<<<<<<<<<<<<<
* CHKERR( PCFactorSetUpMatSolverType(self.pc) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_115setFactorSetUpSolverType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_114setFactorSetUpSolverType[] = "PC.setFactorSetUpSolverType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_115setFactorSetUpSolverType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setFactorSetUpSolverType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setFactorSetUpSolverType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFactorSetUpSolverType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_114setFactorSetUpSolverType(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_114setFactorSetUpSolverType(struct PyPetscPCObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFactorSetUpSolverType", 0);
/* "petsc4py/PETSc/PC.pyx":503
*
* def setFactorSetUpSolverType(self):
* CHKERR( PCFactorSetUpMatSolverType(self.pc) ) # <<<<<<<<<<<<<<
*
* def setFactorOrdering(self, ord_type=None, nzdiag=None, reuse=None):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetUpMatSolverType(__pyx_v_self->pc)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 503, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":502
* return bytes2str(cval)
*
* def setFactorSetUpSolverType(self): # <<<<<<<<<<<<<<
* CHKERR( PCFactorSetUpMatSolverType(self.pc) )
*
*/
/* 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":505
* CHKERR( PCFactorSetUpMatSolverType(self.pc) )
*
* def setFactorOrdering(self, ord_type=None, nzdiag=None, reuse=None): # <<<<<<<<<<<<<<
* cdef PetscMatOrderingType cval = NULL
* if ord_type is not None:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_117setFactorOrdering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_116setFactorOrdering[] = "PC.setFactorOrdering(self, ord_type=None, nzdiag=None, reuse=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_117setFactorOrdering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ord_type = 0;
PyObject *__pyx_v_nzdiag = 0;
PyObject *__pyx_v_reuse = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ord_type,&__pyx_n_s_nzdiag,&__pyx_n_s_reuse,0};
PyObject* values[3] = {0,0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ord_type);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzdiag);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reuse);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFactorOrdering") < 0)) __PYX_ERR(47, 505, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_ord_type = values[0];
__pyx_v_nzdiag = values[1];
__pyx_v_reuse = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFactorOrdering", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 505, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorOrdering", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_116setFactorOrdering(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ord_type, __pyx_v_nzdiag, __pyx_v_reuse);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_116setFactorOrdering(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ord_type, PyObject *__pyx_v_nzdiag, PyObject *__pyx_v_reuse) {
MatOrderingType __pyx_v_cval;
PetscReal __pyx_v_rval;
PetscBool __pyx_v_bval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
PetscReal __pyx_t_5;
PetscBool __pyx_t_6;
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":506
*
* def setFactorOrdering(self, ord_type=None, nzdiag=None, reuse=None):
* cdef PetscMatOrderingType cval = NULL # <<<<<<<<<<<<<<
* if ord_type is not None:
* ord_type = str2bytes(ord_type, &cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/PC.pyx":507
* def setFactorOrdering(self, ord_type=None, nzdiag=None, reuse=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/PC.pyx":508
* 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_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ord_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 508, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_ord_type, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":509
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetMatOrderingType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 509, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":507
* def setFactorOrdering(self, ord_type=None, nzdiag=None, reuse=None):
* 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":510
* 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":511
* CHKERR( PCFactorSetMatOrderingType(self.pc, cval) )
* cdef PetscReal rval = 0
* if nzdiag is not None: # <<<<<<<<<<<<<<
* rval = asReal(nzdiag)
* CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) )
*/
__pyx_t_2 = (__pyx_v_nzdiag != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/PC.pyx":512
* cdef PetscReal rval = 0
* if nzdiag is not None:
* rval = asReal(nzdiag) # <<<<<<<<<<<<<<
* CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) )
* cdef PetscBool bval = PETSC_FALSE
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_nzdiag); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(47, 512, __pyx_L1_error)
__pyx_v_rval = __pyx_t_5;
/* "petsc4py/PETSc/PC.pyx":513
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorReorderForNonzeroDiagonal(__pyx_v_self->pc, __pyx_v_rval)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 513, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":511
* 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":514
* 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":515
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/PC.pyx":516
* 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_2 = __Pyx_PyObject_IsTrue(__pyx_v_reuse); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(47, 516, __pyx_L1_error)
if (__pyx_t_2) {
__pyx_t_6 = PETSC_TRUE;
} else {
__pyx_t_6 = PETSC_FALSE;
}
__pyx_v_bval = __pyx_t_6;
/* "petsc4py/PETSc/PC.pyx":517
* if reuse is not None:
* bval = PETSC_TRUE if reuse else PETSC_FALSE
* CHKERR( PCFactorSetReuseOrdering(self.pc, bval) ) # <<<<<<<<<<<<<<
*
* def setFactorPivot(self, zeropivot=None, inblocks=None):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetReuseOrdering(__pyx_v_self->pc, __pyx_v_bval)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 517, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":515
* 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":505
* CHKERR( PCFactorSetUpMatSolverType(self.pc) )
*
* def setFactorOrdering(self, ord_type=None, nzdiag=None, reuse=None): # <<<<<<<<<<<<<<
* cdef PetscMatOrderingType cval = NULL
* if ord_type is not 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.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":519
* CHKERR( PCFactorSetReuseOrdering(self.pc, bval) )
*
* def setFactorPivot(self, zeropivot=None, inblocks=None): # <<<<<<<<<<<<<<
* cdef PetscReal rval = 0
* if zeropivot is not None:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_119setFactorPivot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_118setFactorPivot[] = "PC.setFactorPivot(self, zeropivot=None, inblocks=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_119setFactorPivot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_zeropivot = 0;
PyObject *__pyx_v_inblocks = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_zeropivot,&__pyx_n_s_inblocks,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zeropivot);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inblocks);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFactorPivot") < 0)) __PYX_ERR(47, 519, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_zeropivot = values[0];
__pyx_v_inblocks = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFactorPivot", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 519, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorPivot", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_118setFactorPivot(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_zeropivot, __pyx_v_inblocks);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_118setFactorPivot(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_zeropivot, PyObject *__pyx_v_inblocks) {
PetscReal __pyx_v_rval;
PetscBool __pyx_v_bval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PetscReal __pyx_t_3;
PetscErrorCode __pyx_t_4;
PetscBool __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFactorPivot", 0);
/* "petsc4py/PETSc/PC.pyx":520
*
* def setFactorPivot(self, zeropivot=None, inblocks=None):
* cdef PetscReal rval = 0 # <<<<<<<<<<<<<<
* if zeropivot is not None:
* rval = asReal(zeropivot)
*/
__pyx_v_rval = 0.0;
/* "petsc4py/PETSc/PC.pyx":521
* def setFactorPivot(self, zeropivot=None, inblocks=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/PC.pyx":522
* cdef PetscReal rval = 0
* if zeropivot is not None:
* rval = asReal(zeropivot) # <<<<<<<<<<<<<<
* CHKERR( PCFactorSetZeroPivot(self.pc, rval) )
* cdef PetscBool bval = PETSC_FALSE
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zeropivot); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(47, 522, __pyx_L1_error)
__pyx_v_rval = __pyx_t_3;
/* "petsc4py/PETSc/PC.pyx":523
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetZeroPivot(__pyx_v_self->pc, __pyx_v_rval)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 523, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":521
* def setFactorPivot(self, zeropivot=None, inblocks=None):
* cdef PetscReal rval = 0
* if zeropivot is not None: # <<<<<<<<<<<<<<
* rval = asReal(zeropivot)
* CHKERR( PCFactorSetZeroPivot(self.pc, rval) )
*/
}
/* "petsc4py/PETSc/PC.pyx":524
* 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":525
* 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_2 = (__pyx_v_inblocks != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/PC.pyx":526
* 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(47, 526, __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":527
* if inblocks is not None:
* bval = PETSC_TRUE if inblocks else PETSC_FALSE
* CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) ) # <<<<<<<<<<<<<<
*
* def setFactorShift(self, shift_type=None, amount=None):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetPivotInBlocks(__pyx_v_self->pc, __pyx_v_bval)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 527, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":525
* 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":519
* CHKERR( PCFactorSetReuseOrdering(self.pc, bval) )
*
* def setFactorPivot(self, zeropivot=None, inblocks=None): # <<<<<<<<<<<<<<
* cdef PetscReal rval = 0
* if zeropivot is not 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":529
* CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) )
*
* def setFactorShift(self, shift_type=None, amount=None): # <<<<<<<<<<<<<<
* cdef PetscMatFactorShiftType cval = MAT_SHIFT_NONE
* if shift_type is not None:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_121setFactorShift(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_120setFactorShift[] = "PC.setFactorShift(self, shift_type=None, amount=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_121setFactorShift(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_shift_type = 0;
PyObject *__pyx_v_amount = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shift_type,&__pyx_n_s_amount,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shift_type);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_amount);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFactorShift") < 0)) __PYX_ERR(47, 529, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_shift_type = values[0];
__pyx_v_amount = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFactorShift", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 529, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorShift", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_120setFactorShift(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_shift_type, __pyx_v_amount);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_120setFactorShift(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_shift_type, PyObject *__pyx_v_amount) {
MatFactorShiftType __pyx_v_cval;
PetscReal __pyx_v_rval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
MatFactorShiftType __pyx_t_3;
PetscErrorCode __pyx_t_4;
PetscReal __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFactorShift", 0);
/* "petsc4py/PETSc/PC.pyx":530
*
* def setFactorShift(self, shift_type=None, amount=None):
* 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":531
* def setFactorShift(self, shift_type=None, amount=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/PC.pyx":532
* 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_3 = __pyx_f_8petsc4py_5PETSc_matfactorshifttype(__pyx_v_shift_type); if (unlikely(__pyx_t_3 == ((MatFactorShiftType)((MatFactorShiftType)-1L)))) __PYX_ERR(47, 532, __pyx_L1_error)
__pyx_v_cval = __pyx_t_3;
/* "petsc4py/PETSc/PC.pyx":533
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetShiftType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 533, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":531
* def setFactorShift(self, shift_type=None, amount=None):
* 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":534
* 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":535
* CHKERR( PCFactorSetShiftType(self.pc, cval) )
* cdef PetscReal rval = 0
* if amount is not None: # <<<<<<<<<<<<<<
* rval = asReal(amount)
* CHKERR( PCFactorSetShiftAmount(self.pc, rval) )
*/
__pyx_t_2 = (__pyx_v_amount != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/PC.pyx":536
* cdef PetscReal rval = 0
* if amount is not None:
* rval = asReal(amount) # <<<<<<<<<<<<<<
* CHKERR( PCFactorSetShiftAmount(self.pc, rval) )
*
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_amount); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(47, 536, __pyx_L1_error)
__pyx_v_rval = __pyx_t_5;
/* "petsc4py/PETSc/PC.pyx":537
* if amount is not None:
* rval = asReal(amount)
* CHKERR( PCFactorSetShiftAmount(self.pc, rval) ) # <<<<<<<<<<<<<<
*
* def setFactorLevels(self, levels):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetShiftAmount(__pyx_v_self->pc, __pyx_v_rval)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 537, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":535
* 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":529
* CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) )
*
* def setFactorShift(self, shift_type=None, amount=None): # <<<<<<<<<<<<<<
* cdef PetscMatFactorShiftType cval = MAT_SHIFT_NONE
* if shift_type is not 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":539
* CHKERR( PCFactorSetShiftAmount(self.pc, rval) )
*
* def setFactorLevels(self, levels): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(levels)
* CHKERR( PCFactorSetLevels(self.pc, ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_123setFactorLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_122setFactorLevels[] = "PC.setFactorLevels(self, levels)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_123setFactorLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_levels = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFactorLevels") < 0)) __PYX_ERR(47, 539, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_levels = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFactorLevels", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 539, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorLevels", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_122setFactorLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_122setFactorLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels) {
PetscInt __pyx_v_ival;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFactorLevels", 0);
/* "petsc4py/PETSc/PC.pyx":540
*
* def setFactorLevels(self, levels):
* 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(47, 540, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":541
* def setFactorLevels(self, levels):
* cdef PetscInt ival = asInt(levels)
* CHKERR( PCFactorSetLevels(self.pc, ival) ) # <<<<<<<<<<<<<<
*
* def getFactorMatrix(self):
*/
__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(47, 541, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":539
* CHKERR( PCFactorSetShiftAmount(self.pc, rval) )
*
* def setFactorLevels(self, levels): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(levels)
* CHKERR( PCFactorSetLevels(self.pc, ival) )
*/
/* 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":543
* CHKERR( PCFactorSetLevels(self.pc, ival) )
*
* def getFactorMatrix(self): # <<<<<<<<<<<<<<
* cdef Mat mat = Mat()
* CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_125getFactorMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_124getFactorMatrix[] = "PC.getFactorMatrix(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_125getFactorMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFactorMatrix (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFactorMatrix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFactorMatrix", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_124getFactorMatrix(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_124getFactorMatrix(struct PyPetscPCObject *__pyx_v_self) {
struct PyPetscMatObject *__pyx_v_mat = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFactorMatrix", 0);
/* "petsc4py/PETSc/PC.pyx":544
*
* def getFactorMatrix(self):
* cdef Mat mat = Mat() # <<<<<<<<<<<<<<
* CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) )
* PetscINCREF(mat.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 544, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/PC.pyx":545
* def getFactorMatrix(self):
* cdef Mat mat = Mat()
* CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) ) # <<<<<<<<<<<<<<
* PetscINCREF(mat.obj)
* return mat
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorGetMatrix(__pyx_v_self->pc, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 545, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":546
* cdef Mat mat = Mat()
* CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) )
* PetscINCREF(mat.obj) # <<<<<<<<<<<<<<
* return mat
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj));
/* "petsc4py/PETSc/PC.pyx":547
* CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) )
* 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":543
* CHKERR( PCFactorSetLevels(self.pc, ival) )
*
* def getFactorMatrix(self): # <<<<<<<<<<<<<<
* cdef Mat mat = Mat()
* CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.PC.getFactorMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_mat);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":551
* # --- FieldSplit ---
*
* def setFieldSplitType(self, ctype): # <<<<<<<<<<<<<<
* cdef PetscPCCompositeType cval = ctype
* CHKERR( PCFieldSplitSetType(self.pc, cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_127setFieldSplitType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_126setFieldSplitType[] = "PC.setFieldSplitType(self, ctype)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_127setFieldSplitType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ctype = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctype,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ctype)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldSplitType") < 0)) __PYX_ERR(47, 551, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_ctype = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFieldSplitType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 551, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_126setFieldSplitType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ctype);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_126setFieldSplitType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype) {
PCCompositeType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PCCompositeType __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFieldSplitType", 0);
/* "petsc4py/PETSc/PC.pyx":552
*
* def setFieldSplitType(self, ctype):
* cdef PetscPCCompositeType cval = ctype # <<<<<<<<<<<<<<
* CHKERR( PCFieldSplitSetType(self.pc, cval) )
*
*/
__pyx_t_1 = ((PCCompositeType)__Pyx_PyInt_As_PCCompositeType(__pyx_v_ctype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 552, __pyx_L1_error)
__pyx_v_cval = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":553
* def setFieldSplitType(self, ctype):
* cdef PetscPCCompositeType cval = ctype
* CHKERR( PCFieldSplitSetType(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def setFieldSplitIS(self, *fields):
*/
__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(47, 553, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":551
* # --- FieldSplit ---
*
* def setFieldSplitType(self, ctype): # <<<<<<<<<<<<<<
* cdef PetscPCCompositeType cval = ctype
* CHKERR( PCFieldSplitSetType(self.pc, cval) )
*/
/* 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":555
* CHKERR( PCFieldSplitSetType(self.pc, cval) )
*
* def setFieldSplitIS(self, *fields): # <<<<<<<<<<<<<<
* cdef object name = None
* cdef IS field = None
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_129setFieldSplitIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_128setFieldSplitIS[] = "PC.setFieldSplitIS(self, *fields)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_129setFieldSplitIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_fields = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setFieldSplitIS (wrapper)", 0);
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFieldSplitIS", 0))) return NULL;
__Pyx_INCREF(__pyx_args);
__pyx_v_fields = __pyx_args;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_128setFieldSplitIS(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_fields);
/* function exit code */
__Pyx_XDECREF(__pyx_v_fields);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_128setFieldSplitIS(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_fields) {
PyObject *__pyx_v_name = 0;
struct PyPetscISObject *__pyx_v_field = 0;
char const *__pyx_v_cname;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *(*__pyx_t_7)(PyObject *);
PetscErrorCode __pyx_t_8;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFieldSplitIS", 0);
/* "petsc4py/PETSc/PC.pyx":556
*
* def setFieldSplitIS(self, *fields):
* 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":557
* def setFieldSplitIS(self, *fields):
* 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":558
* 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":559
* 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 (;;) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(47, 559, __pyx_L1_error)
#else
__pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
#endif
if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
PyObject* sequence = __pyx_t_3;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(47, 559, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
__pyx_t_5 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
#else
__pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 559, __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(47, 559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
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(47, 559, __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(47, 559, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(47, 559, __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":560
* 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(47, 560, __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":561
* for name, field in fields:
* name = str2bytes(name, &cname)
* CHKERR( PCFieldSplitSetIS(self.pc, cname, field.iset) ) # <<<<<<<<<<<<<<
*
* def setFieldSplitFields(self, bsize, *fields):
*/
__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(47, 561, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":559
* 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":555
* CHKERR( PCFieldSplitSetType(self.pc, cval) )
*
* def setFieldSplitIS(self, *fields): # <<<<<<<<<<<<<<
* cdef object name = None
* cdef IS field = 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_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":563
* CHKERR( PCFieldSplitSetIS(self.pc, cname, field.iset) )
*
* def setFieldSplitFields(self, bsize, *fields): # <<<<<<<<<<<<<<
* cdef PetscInt bs = asInt(bsize)
* CHKERR( PCFieldSplitSetBlockSize(self.pc, bs) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_131setFieldSplitFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_130setFieldSplitFields[] = "PC.setFieldSplitFields(self, bsize, *fields)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_131setFieldSplitFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_bsize = 0;
PyObject *__pyx_v_fields = 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 (PyTuple_GET_SIZE(__pyx_args) > 1) {
__pyx_v_fields = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
if (unlikely(!__pyx_v_fields)) {
__Pyx_RefNannyFinishContext();
return NULL;
}
__Pyx_GOTREF(__pyx_v_fields);
} else {
__pyx_v_fields = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
}
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bsize,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
default:
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "setFieldSplitFields") < 0)) __PYX_ERR(47, 563, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_bsize = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFieldSplitFields", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 563, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_fields); __pyx_v_fields = 0;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitFields", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_130setFieldSplitFields(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bsize, __pyx_v_fields);
/* function exit code */
__Pyx_XDECREF(__pyx_v_fields);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_130setFieldSplitFields(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_fields) {
PetscInt __pyx_v_bs;
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_field = 0;
char const *__pyx_v_cname;
PetscInt __pyx_v_nfields;
PetscInt *__pyx_v_ifields;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
Py_ssize_t __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *(*__pyx_t_9)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFieldSplitFields", 0);
/* "petsc4py/PETSc/PC.pyx":564
*
* def setFieldSplitFields(self, bsize, *fields):
* 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(47, 564, __pyx_L1_error)
__pyx_v_bs = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":565
* def setFieldSplitFields(self, bsize, *fields):
* 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(47, 565, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":566
* 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":567
* 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":568
* 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":569
* 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":570
* 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 (;;) {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(47, 570, __pyx_L1_error)
#else
__pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 570, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
#endif
if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
PyObject* sequence = __pyx_t_5;
Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
__PYX_ERR(47, 570, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_6 = PyList_GET_ITEM(sequence, 0);
__pyx_t_7 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
#else
__pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 570, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 570, __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(47, 570, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
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(47, 570, __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(47, 570, __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":571
* 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(47, 571, __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":572
* 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(47, 572, __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":573
* 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(47, 573, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":570
* 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":563
* CHKERR( PCFieldSplitSetIS(self.pc, cname, field.iset) )
*
* def setFieldSplitFields(self, bsize, *fields): # <<<<<<<<<<<<<<
* cdef PetscInt bs = asInt(bsize)
* CHKERR( PCFieldSplitSetBlockSize(self.pc, bs) )
*/
/* 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":576
* nfields, ifields, ifields) )
*
* def getFieldSplitSubKSP(self): # <<<<<<<<<<<<<<
* cdef PetscInt i = 0, n = 0
* cdef PetscKSP *p = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_133getFieldSplitSubKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_132getFieldSplitSubKSP[] = "PC.getFieldSplitSubKSP(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_133getFieldSplitSubKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFieldSplitSubKSP (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFieldSplitSubKSP", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFieldSplitSubKSP", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_132getFieldSplitSubKSP(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_132getFieldSplitSubKSP(struct PyPetscPCObject *__pyx_v_self) {
CYTHON_UNUSED PetscInt __pyx_v_i;
PetscInt __pyx_v_n;
KSP *__pyx_v_p;
PyObject *__pyx_v_subksp = 0;
PetscInt __pyx_8genexpr9__pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscInt __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
int __pyx_t_6;
char const *__pyx_t_7;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFieldSplitSubKSP", 0);
/* "petsc4py/PETSc/PC.pyx":577
*
* def getFieldSplitSubKSP(self):
* cdef PetscInt i = 0, n = 0 # <<<<<<<<<<<<<<
* cdef PetscKSP *p = NULL
* cdef object subksp = None
*/
__pyx_v_i = 0;
__pyx_v_n = 0;
/* "petsc4py/PETSc/PC.pyx":578
* def getFieldSplitSubKSP(self):
* cdef PetscInt i = 0, n = 0
* cdef PetscKSP *p = NULL # <<<<<<<<<<<<<<
* cdef object subksp = None
* try:
*/
__pyx_v_p = NULL;
/* "petsc4py/PETSc/PC.pyx":579
* cdef PetscInt i = 0, n = 0
* cdef PetscKSP *p = NULL
* cdef object subksp = None # <<<<<<<<<<<<<<
* try:
* CHKERR( PCFieldSplitGetSubKSP(self.pc, &n, &p) )
*/
__Pyx_INCREF(Py_None);
__pyx_v_subksp = Py_None;
/* "petsc4py/PETSc/PC.pyx":580
* 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":581
* 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(47, 581, __pyx_L4_error)
/* "petsc4py/PETSc/PC.pyx":582
* 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(47, 582, __pyx_L4_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(47, 582, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_4);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(47, 582, __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":584
* 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(47, 584, __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;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_11);
__Pyx_XGOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_t_13);
__pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename;
{
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_p)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 584, __pyx_L9_error)
}
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
}
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
__pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
__pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7;
goto __pyx_L1_error;
__pyx_L9_error:;
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
}
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
goto __pyx_L1_error;
}
__pyx_L5:;
}
/* "petsc4py/PETSc/PC.pyx":585
* finally:
* CHKERR( PetscFree(p) )
* return subksp # <<<<<<<<<<<<<<
*
* def getFieldSplitSchurGetSubKSP(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_subksp);
__pyx_r = __pyx_v_subksp;
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":576
* nfields, ifields, ifields) )
*
* def getFieldSplitSubKSP(self): # <<<<<<<<<<<<<<
* cdef PetscInt i = 0, n = 0
* cdef PetscKSP *p = NULL
*/
/* 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":587
* return subksp
*
* def getFieldSplitSchurGetSubKSP(self): # <<<<<<<<<<<<<<
* cdef PetscInt i = 0, n = 0
* cdef PetscKSP *p = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_135getFieldSplitSchurGetSubKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_134getFieldSplitSchurGetSubKSP[] = "PC.getFieldSplitSchurGetSubKSP(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_135getFieldSplitSchurGetSubKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFieldSplitSchurGetSubKSP (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFieldSplitSchurGetSubKSP", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFieldSplitSchurGetSubKSP", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_134getFieldSplitSchurGetSubKSP(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_134getFieldSplitSchurGetSubKSP(struct PyPetscPCObject *__pyx_v_self) {
CYTHON_UNUSED PetscInt __pyx_v_i;
PetscInt __pyx_v_n;
KSP *__pyx_v_p;
PyObject *__pyx_v_subksp = 0;
PetscInt __pyx_9genexpr10__pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscInt __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
int __pyx_t_6;
char const *__pyx_t_7;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFieldSplitSchurGetSubKSP", 0);
/* "petsc4py/PETSc/PC.pyx":588
*
* def getFieldSplitSchurGetSubKSP(self):
* cdef PetscInt i = 0, n = 0 # <<<<<<<<<<<<<<
* cdef PetscKSP *p = NULL
* cdef object subksp = None
*/
__pyx_v_i = 0;
__pyx_v_n = 0;
/* "petsc4py/PETSc/PC.pyx":589
* def getFieldSplitSchurGetSubKSP(self):
* cdef PetscInt i = 0, n = 0
* cdef PetscKSP *p = NULL # <<<<<<<<<<<<<<
* cdef object subksp = None
* try:
*/
__pyx_v_p = NULL;
/* "petsc4py/PETSc/PC.pyx":590
* cdef PetscInt i = 0, n = 0
* cdef PetscKSP *p = NULL
* cdef object subksp = None # <<<<<<<<<<<<<<
* try:
* CHKERR( PCFieldSplitSchurGetSubKSP(self.pc, &n, &p) )
*/
__Pyx_INCREF(Py_None);
__pyx_v_subksp = Py_None;
/* "petsc4py/PETSc/PC.pyx":591
* 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":592
* 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(47, 592, __pyx_L4_error)
/* "petsc4py/PETSc/PC.pyx":593
* 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(47, 593, __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(47, 593, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_4);
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(47, 593, __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":595
* 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(47, 595, __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;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_t_10);
__Pyx_XGOTREF(__pyx_t_11);
__Pyx_XGOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_t_13);
__pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename;
{
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_p)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 595, __pyx_L9_error)
}
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
}
__Pyx_XGIVEREF(__pyx_t_8);
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
__Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
__pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
__pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7;
goto __pyx_L1_error;
__pyx_L9_error:;
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
}
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
goto __pyx_L1_error;
}
__pyx_L5:;
}
/* "petsc4py/PETSc/PC.pyx":596
* finally:
* CHKERR( PetscFree(p) )
* return subksp # <<<<<<<<<<<<<<
*
* def setFieldSplitSchurFactType(self, ctype):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_subksp);
__pyx_r = __pyx_v_subksp;
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":587
* return subksp
*
* def getFieldSplitSchurGetSubKSP(self): # <<<<<<<<<<<<<<
* cdef PetscInt i = 0, n = 0
* cdef PetscKSP *p = NULL
*/
/* 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":598
* return subksp
*
* def setFieldSplitSchurFactType(self, ctype): # <<<<<<<<<<<<<<
* cdef PetscPCFieldSplitSchurFactType cval = ctype
* CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_137setFieldSplitSchurFactType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_136setFieldSplitSchurFactType[] = "PC.setFieldSplitSchurFactType(self, ctype)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_137setFieldSplitSchurFactType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ctype = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctype,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ctype)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldSplitSchurFactType") < 0)) __PYX_ERR(47, 598, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_ctype = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFieldSplitSchurFactType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 598, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitSchurFactType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_136setFieldSplitSchurFactType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ctype);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_136setFieldSplitSchurFactType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype) {
PCFieldSplitSchurFactType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PCFieldSplitSchurFactType __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFieldSplitSchurFactType", 0);
/* "petsc4py/PETSc/PC.pyx":599
*
* def setFieldSplitSchurFactType(self, ctype):
* cdef PetscPCFieldSplitSchurFactType cval = ctype # <<<<<<<<<<<<<<
* CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) )
*
*/
__pyx_t_1 = ((PCFieldSplitSchurFactType)__Pyx_PyInt_As_PCFieldSplitSchurFactType(__pyx_v_ctype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 599, __pyx_L1_error)
__pyx_v_cval = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":600
* def setFieldSplitSchurFactType(self, ctype):
* cdef PetscPCFieldSplitSchurFactType cval = ctype
* CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def setFieldSplitSchurPreType(self, ptype, Mat pre=None):
*/
__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(47, 600, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":598
* return subksp
*
* def setFieldSplitSchurFactType(self, ctype): # <<<<<<<<<<<<<<
* cdef PetscPCFieldSplitSchurFactType cval = ctype
* CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) )
*/
/* 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":602
* CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) )
*
* def setFieldSplitSchurPreType(self, ptype, Mat pre=None): # <<<<<<<<<<<<<<
* cdef PetscPCFieldSplitSchurPreType pval = ptype
* cdef PetscMat pmat = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_139setFieldSplitSchurPreType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_138setFieldSplitSchurPreType[] = "PC.setFieldSplitSchurPreType(self, ptype, Mat pre=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_139setFieldSplitSchurPreType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ptype = 0;
struct PyPetscMatObject *__pyx_v_pre = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ptype,&__pyx_n_s_pre,0};
PyObject* values[2] = {0,0};
values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ptype)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pre);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldSplitSchurPreType") < 0)) __PYX_ERR(47, 602, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_ptype = values[0];
__pyx_v_pre = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFieldSplitSchurPreType", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 602, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitSchurPreType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pre), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "pre", 0))) __PYX_ERR(47, 602, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_138setFieldSplitSchurPreType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ptype, __pyx_v_pre);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_138setFieldSplitSchurPreType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ptype, struct PyPetscMatObject *__pyx_v_pre) {
PCFieldSplitSchurPreType __pyx_v_pval;
Mat __pyx_v_pmat;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PCFieldSplitSchurPreType __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
Mat __pyx_t_4;
PetscErrorCode __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFieldSplitSchurPreType", 0);
/* "petsc4py/PETSc/PC.pyx":603
*
* def setFieldSplitSchurPreType(self, ptype, Mat pre=None):
* cdef PetscPCFieldSplitSchurPreType pval = ptype # <<<<<<<<<<<<<<
* cdef PetscMat pmat = NULL
* if pre is not None: pmat = pre.mat
*/
__pyx_t_1 = ((PCFieldSplitSchurPreType)__Pyx_PyInt_As_PCFieldSplitSchurPreType(__pyx_v_ptype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 603, __pyx_L1_error)
__pyx_v_pval = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":604
* def setFieldSplitSchurPreType(self, ptype, Mat pre=None):
* 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":605
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_4 = __pyx_v_pre->mat;
__pyx_v_pmat = __pyx_t_4;
}
/* "petsc4py/PETSc/PC.pyx":606
* cdef PetscMat pmat = NULL
* if pre is not None: pmat = pre.mat
* CHKERR( PCFieldSplitSetSchurPre(self.pc, pval, pmat) ) # <<<<<<<<<<<<<<
*
* # --- COMPOSITE ---
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitSetSchurPre(__pyx_v_self->pc, __pyx_v_pval, __pyx_v_pmat)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 606, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":602
* CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) )
*
* def setFieldSplitSchurPreType(self, ptype, Mat pre=None): # <<<<<<<<<<<<<<
* cdef PetscPCFieldSplitSchurPreType pval = ptype
* cdef PetscMat pmat = NULL
*/
/* 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":610
* # --- COMPOSITE ---
*
* def setCompositeType(self, ctype): # <<<<<<<<<<<<<<
* cdef PetscPCCompositeType cval = ctype
* CHKERR( PCCompositeSetType(self.pc, cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_141setCompositeType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_140setCompositeType[] = "PC.setCompositeType(self, ctype)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_141setCompositeType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ctype = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctype,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ctype)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCompositeType") < 0)) __PYX_ERR(47, 610, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_ctype = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setCompositeType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 610, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setCompositeType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_140setCompositeType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ctype);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_140setCompositeType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype) {
PCCompositeType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PCCompositeType __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setCompositeType", 0);
/* "petsc4py/PETSc/PC.pyx":611
*
* def setCompositeType(self, ctype):
* cdef PetscPCCompositeType cval = ctype # <<<<<<<<<<<<<<
* CHKERR( PCCompositeSetType(self.pc, cval) )
*
*/
__pyx_t_1 = ((PCCompositeType)__Pyx_PyInt_As_PCCompositeType(__pyx_v_ctype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 611, __pyx_L1_error)
__pyx_v_cval = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":612
* def setCompositeType(self, ctype):
* cdef PetscPCCompositeType cval = ctype
* CHKERR( PCCompositeSetType(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def getCompositePC(self, n):
*/
__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(47, 612, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":610
* # --- COMPOSITE ---
*
* def setCompositeType(self, ctype): # <<<<<<<<<<<<<<
* cdef PetscPCCompositeType cval = ctype
* CHKERR( PCCompositeSetType(self.pc, cval) )
*/
/* 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":614
* CHKERR( PCCompositeSetType(self.pc, cval) )
*
* def getCompositePC(self, n): # <<<<<<<<<<<<<<
* cdef PC pc = PC()
* cdef cn = asInt(n)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_143getCompositePC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_142getCompositePC[] = "PC.getCompositePC(self, n)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_143getCompositePC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_n = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getCompositePC") < 0)) __PYX_ERR(47, 614, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_n = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getCompositePC", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 614, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.getCompositePC", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_142getCompositePC(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_n);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_142getCompositePC(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_n) {
struct PyPetscPCObject *__pyx_v_pc = 0;
PyObject *__pyx_v_cn = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscInt __pyx_t_2;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getCompositePC", 0);
/* "petsc4py/PETSc/PC.pyx":615
*
* def getCompositePC(self, n):
* cdef PC pc = PC() # <<<<<<<<<<<<<<
* cdef cn = asInt(n)
* CHKERR( PCCompositeGetPC(self.pc, cn, &pc.pc) )
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_pc = ((struct PyPetscPCObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/PC.pyx":616
* def getCompositePC(self, n):
* cdef PC pc = PC()
* cdef cn = asInt(n) # <<<<<<<<<<<<<<
* CHKERR( PCCompositeGetPC(self.pc, cn, &pc.pc) )
* PetscINCREF(pc.obj)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_n); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 616, __pyx_L1_error)
__pyx_t_1 = __Pyx_PyInt_From_PetscInt(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 616, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_cn = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/PC.pyx":617
* cdef PC pc = PC()
* cdef cn = asInt(n)
* CHKERR( PCCompositeGetPC(self.pc, cn, &pc.pc) ) # <<<<<<<<<<<<<<
* PetscINCREF(pc.obj)
* return pc
*/
__pyx_t_2 = __Pyx_PyInt_As_PetscInt(__pyx_v_cn); if (unlikely((__pyx_t_2 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(47, 617, __pyx_L1_error)
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCCompositeGetPC(__pyx_v_self->pc, __pyx_t_2, (&__pyx_v_pc->pc))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 617, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":618
* cdef cn = asInt(n)
* CHKERR( PCCompositeGetPC(self.pc, cn, &pc.pc) )
* PetscINCREF(pc.obj) # <<<<<<<<<<<<<<
* return pc
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_pc->__pyx_base.obj));
/* "petsc4py/PETSc/PC.pyx":619
* CHKERR( PCCompositeGetPC(self.pc, cn, &pc.pc) )
* PetscINCREF(pc.obj)
* return pc # <<<<<<<<<<<<<<
*
* def addCompositePCType(self, pc_type):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_pc));
__pyx_r = ((PyObject *)__pyx_v_pc);
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":614
* CHKERR( PCCompositeSetType(self.pc, cval) )
*
* def getCompositePC(self, n): # <<<<<<<<<<<<<<
* cdef PC pc = PC()
* cdef cn = asInt(n)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.PC.getCompositePC", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_pc);
__Pyx_XDECREF(__pyx_v_cn);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":621
* return pc
*
* def addCompositePCType(self, pc_type): # <<<<<<<<<<<<<<
* cdef PetscPCType cval = NULL
* pc_type = str2bytes(pc_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_145addCompositePCType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_144addCompositePCType[] = "PC.addCompositePCType(self, pc_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_145addCompositePCType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_pc_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pc_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pc_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addCompositePCType") < 0)) __PYX_ERR(47, 621, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_pc_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("addCompositePCType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 621, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.addCompositePCType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_144addCompositePCType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_pc_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_144addCompositePCType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_pc_type) {
PCType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("addCompositePCType", 0);
__Pyx_INCREF(__pyx_v_pc_type);
/* "petsc4py/PETSc/PC.pyx":622
*
* def addCompositePCType(self, pc_type):
* cdef PetscPCType cval = NULL # <<<<<<<<<<<<<<
* pc_type = str2bytes(pc_type, &cval)
* CHKERR( PCCompositeAddPCType(self.pc, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/PC.pyx":623
* def addCompositePCType(self, pc_type):
* 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(47, 623, __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":624
* 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(47, 624, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":621
* return pc
*
* def addCompositePCType(self, pc_type): # <<<<<<<<<<<<<<
* cdef PetscPCType cval = NULL
* pc_type = str2bytes(pc_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":628
* # --- KSP ---
*
* def getKSP(self): # <<<<<<<<<<<<<<
* cdef KSP ksp = KSP()
* CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_147getKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_146getKSP[] = "PC.getKSP(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_147getKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getKSP (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getKSP", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getKSP", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_146getKSP(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_146getKSP(struct PyPetscPCObject *__pyx_v_self) {
struct PyPetscKSPObject *__pyx_v_ksp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getKSP", 0);
/* "petsc4py/PETSc/PC.pyx":629
*
* def getKSP(self):
* cdef KSP ksp = KSP() # <<<<<<<<<<<<<<
* CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) )
* PetscINCREF(ksp.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 629, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/PC.pyx":630
* def getKSP(self):
* cdef KSP ksp = KSP()
* CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) ) # <<<<<<<<<<<<<<
* PetscINCREF(ksp.obj)
* return ksp
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCKSPGetKSP(__pyx_v_self->pc, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 630, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":631
* cdef KSP ksp = KSP()
* CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) )
* PetscINCREF(ksp.obj) # <<<<<<<<<<<<<<
* return ksp
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj));
/* "petsc4py/PETSc/PC.pyx":632
* CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) )
* 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":628
* # --- KSP ---
*
* def getKSP(self): # <<<<<<<<<<<<<<
* cdef KSP ksp = KSP()
* CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.PC.getKSP", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ksp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":636
* # --- MG ---
*
* def getMGType(self): # <<<<<<<<<<<<<<
* cdef PetscPCMGType cval = PC_MG_ADDITIVE
* CHKERR( PCMGGetType(self.pc, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_149getMGType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_148getMGType[] = "PC.getMGType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_149getMGType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getMGType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getMGType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMGType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_148getMGType(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_148getMGType(struct PyPetscPCObject *__pyx_v_self) {
PCMGType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getMGType", 0);
/* "petsc4py/PETSc/PC.pyx":637
*
* def getMGType(self):
* cdef PetscPCMGType cval = PC_MG_ADDITIVE # <<<<<<<<<<<<<<
* CHKERR( PCMGGetType(self.pc, &cval) )
* return cval
*/
__pyx_v_cval = PC_MG_ADDITIVE;
/* "petsc4py/PETSc/PC.pyx":638
* def getMGType(self):
* 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(47, 638, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":639
* cdef PetscPCMGType cval = PC_MG_ADDITIVE
* CHKERR( PCMGGetType(self.pc, &cval) )
* return cval # <<<<<<<<<<<<<<
*
* def setMGType(self, mgtype):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_PCMGType(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":636
* # --- MG ---
*
* def getMGType(self): # <<<<<<<<<<<<<<
* cdef PetscPCMGType cval = PC_MG_ADDITIVE
* CHKERR( PCMGGetType(self.pc, &cval) )
*/
/* 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":641
* return cval
*
* def setMGType(self, mgtype): # <<<<<<<<<<<<<<
* cdef PetscPCMGType cval = mgtype
* CHKERR( PCMGSetType(self.pc, cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_151setMGType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_150setMGType[] = "PC.setMGType(self, mgtype)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_151setMGType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_mgtype = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mgtype,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mgtype)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGType") < 0)) __PYX_ERR(47, 641, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_mgtype = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMGType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 641, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setMGType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_150setMGType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mgtype);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_150setMGType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_mgtype) {
PCMGType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PCMGType __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setMGType", 0);
/* "petsc4py/PETSc/PC.pyx":642
*
* def setMGType(self, mgtype):
* cdef PetscPCMGType cval = mgtype # <<<<<<<<<<<<<<
* CHKERR( PCMGSetType(self.pc, cval) )
*
*/
__pyx_t_1 = ((PCMGType)__Pyx_PyInt_As_PCMGType(__pyx_v_mgtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 642, __pyx_L1_error)
__pyx_v_cval = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":643
* def setMGType(self, mgtype):
* cdef PetscPCMGType cval = mgtype
* CHKERR( PCMGSetType(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def getMGLevels(self):
*/
__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(47, 643, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":641
* return cval
*
* def setMGType(self, mgtype): # <<<<<<<<<<<<<<
* cdef PetscPCMGType cval = mgtype
* CHKERR( PCMGSetType(self.pc, cval) )
*/
/* 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":645
* CHKERR( PCMGSetType(self.pc, cval) )
*
* def getMGLevels(self): # <<<<<<<<<<<<<<
* cdef PetscInt levels = 0
* CHKERR( PCMGGetLevels(self.pc, &levels) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_153getMGLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_152getMGLevels[] = "PC.getMGLevels(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_153getMGLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getMGLevels (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getMGLevels", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMGLevels", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_152getMGLevels(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_152getMGLevels(struct PyPetscPCObject *__pyx_v_self) {
PetscInt __pyx_v_levels;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getMGLevels", 0);
/* "petsc4py/PETSc/PC.pyx":646
*
* def getMGLevels(self):
* cdef PetscInt levels = 0 # <<<<<<<<<<<<<<
* CHKERR( PCMGGetLevels(self.pc, &levels) )
* return toInt(levels)
*/
__pyx_v_levels = 0;
/* "petsc4py/PETSc/PC.pyx":647
* def getMGLevels(self):
* 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(47, 647, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":648
* cdef PetscInt levels = 0
* CHKERR( PCMGGetLevels(self.pc, &levels) )
* return toInt(levels) # <<<<<<<<<<<<<<
*
* def setMGLevels(self, levels):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_levels); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 648, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":645
* CHKERR( PCMGSetType(self.pc, cval) )
*
* def getMGLevels(self): # <<<<<<<<<<<<<<
* cdef PetscInt levels = 0
* CHKERR( PCMGGetLevels(self.pc, &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":650
* return toInt(levels)
*
* def setMGLevels(self, levels): # <<<<<<<<<<<<<<
* cdef PetscInt clevels = asInt(levels)
* CHKERR( PCMGSetLevels(self.pc, clevels, NULL) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_155setMGLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_154setMGLevels[] = "PC.setMGLevels(self, levels)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_155setMGLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_levels = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGLevels") < 0)) __PYX_ERR(47, 650, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_levels = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMGLevels", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 650, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setMGLevels", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_154setMGLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_154setMGLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels) {
PetscInt __pyx_v_clevels;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setMGLevels", 0);
/* "petsc4py/PETSc/PC.pyx":651
*
* def setMGLevels(self, levels):
* 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(47, 651, __pyx_L1_error)
__pyx_v_clevels = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":652
* def setMGLevels(self, levels):
* cdef PetscInt clevels = asInt(levels)
* CHKERR( PCMGSetLevels(self.pc, clevels, NULL) ) # <<<<<<<<<<<<<<
*
* def getMGCoarseSolve(self):
*/
__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(47, 652, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":650
* return toInt(levels)
*
* def setMGLevels(self, levels): # <<<<<<<<<<<<<<
* cdef PetscInt clevels = asInt(levels)
* CHKERR( PCMGSetLevels(self.pc, clevels, NULL) )
*/
/* 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":654
* CHKERR( PCMGSetLevels(self.pc, clevels, NULL) )
*
* def getMGCoarseSolve(self): # <<<<<<<<<<<<<<
* cdef KSP ksp = KSP()
* CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_157getMGCoarseSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_156getMGCoarseSolve[] = "PC.getMGCoarseSolve(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_157getMGCoarseSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getMGCoarseSolve (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getMGCoarseSolve", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMGCoarseSolve", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_156getMGCoarseSolve(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_156getMGCoarseSolve(struct PyPetscPCObject *__pyx_v_self) {
struct PyPetscKSPObject *__pyx_v_ksp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getMGCoarseSolve", 0);
/* "petsc4py/PETSc/PC.pyx":655
*
* def getMGCoarseSolve(self):
* cdef KSP ksp = KSP() # <<<<<<<<<<<<<<
* CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) )
* PetscINCREF(ksp.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 655, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/PC.pyx":656
* def getMGCoarseSolve(self):
* cdef KSP ksp = KSP()
* CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) ) # <<<<<<<<<<<<<<
* PetscINCREF(ksp.obj)
* return ksp
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetCoarseSolve(__pyx_v_self->pc, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 656, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":657
* cdef KSP ksp = KSP()
* CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) )
* PetscINCREF(ksp.obj) # <<<<<<<<<<<<<<
* return ksp
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj));
/* "petsc4py/PETSc/PC.pyx":658
* CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) )
* PetscINCREF(ksp.obj)
* return ksp # <<<<<<<<<<<<<<
*
* def setMGInterpolation(self, level, Mat mat):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_ksp));
__pyx_r = ((PyObject *)__pyx_v_ksp);
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":654
* CHKERR( PCMGSetLevels(self.pc, clevels, NULL) )
*
* def getMGCoarseSolve(self): # <<<<<<<<<<<<<<
* cdef KSP ksp = KSP()
* CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.PC.getMGCoarseSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ksp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":660
* return ksp
*
* def setMGInterpolation(self, level, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetInterpolation(self.pc, clevel, mat.mat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_159setMGInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_158setMGInterpolation[] = "PC.setMGInterpolation(self, level, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_159setMGInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 0;
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_mat,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setMGInterpolation", 1, 2, 2, 1); __PYX_ERR(47, 660, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGInterpolation") < 0)) __PYX_ERR(47, 660, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_level = values[0];
__pyx_v_mat = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMGInterpolation", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 660, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setMGInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(47, 660, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_158setMGInterpolation(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_158setMGInterpolation(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat) {
PetscInt __pyx_v_clevel;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setMGInterpolation", 0);
/* "petsc4py/PETSc/PC.pyx":661
*
* def setMGInterpolation(self, level, Mat mat):
* 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(47, 661, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":662
* def setMGInterpolation(self, level, Mat mat):
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetInterpolation(self.pc, clevel, mat.mat) ) # <<<<<<<<<<<<<<
*
* def getMGInterpolation(self, level):
*/
__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(47, 662, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":660
* return ksp
*
* def setMGInterpolation(self, level, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetInterpolation(self.pc, clevel, mat.mat) )
*/
/* 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":664
* CHKERR( PCMGSetInterpolation(self.pc, clevel, mat.mat) )
*
* def getMGInterpolation(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef Mat interpolation = Mat()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_161getMGInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_160getMGInterpolation[] = "PC.getMGInterpolation(self, level)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_161getMGInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMGInterpolation") < 0)) __PYX_ERR(47, 664, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_level = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getMGInterpolation", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 664, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.getMGInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_160getMGInterpolation(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_160getMGInterpolation(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) {
PetscInt __pyx_v_clevel;
struct PyPetscMatObject *__pyx_v_interpolation = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getMGInterpolation", 0);
/* "petsc4py/PETSc/PC.pyx":665
*
* def getMGInterpolation(self, level):
* 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(47, 665, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":666
* def getMGInterpolation(self, level):
* cdef PetscInt clevel = asInt(level)
* cdef Mat interpolation = Mat() # <<<<<<<<<<<<<<
* CHKERR( PCMGGetInterpolation(self.pc, clevel, &interpolation.mat) )
* PetscINCREF(interpolation.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 666, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_interpolation = ((struct PyPetscMatObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/PC.pyx":667
* cdef PetscInt clevel = asInt(level)
* cdef Mat interpolation = Mat()
* CHKERR( PCMGGetInterpolation(self.pc, clevel, &interpolation.mat) ) # <<<<<<<<<<<<<<
* PetscINCREF(interpolation.obj)
* return interpolation
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetInterpolation(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_interpolation->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 667, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":668
* cdef Mat interpolation = Mat()
* CHKERR( PCMGGetInterpolation(self.pc, clevel, &interpolation.mat) )
* PetscINCREF(interpolation.obj) # <<<<<<<<<<<<<<
* return interpolation
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_interpolation->__pyx_base.obj));
/* "petsc4py/PETSc/PC.pyx":669
* CHKERR( PCMGGetInterpolation(self.pc, clevel, &interpolation.mat) )
* PetscINCREF(interpolation.obj)
* return interpolation # <<<<<<<<<<<<<<
*
* def setMGRestriction(self, level, Mat mat):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_interpolation));
__pyx_r = ((PyObject *)__pyx_v_interpolation);
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":664
* CHKERR( PCMGSetInterpolation(self.pc, clevel, mat.mat) )
*
* def getMGInterpolation(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef Mat interpolation = Mat()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.PC.getMGInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_interpolation);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":671
* return interpolation
*
* def setMGRestriction(self, level, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetRestriction(self.pc, clevel, mat.mat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_163setMGRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_162setMGRestriction[] = "PC.setMGRestriction(self, level, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_163setMGRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 0;
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_mat,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setMGRestriction", 1, 2, 2, 1); __PYX_ERR(47, 671, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGRestriction") < 0)) __PYX_ERR(47, 671, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_level = values[0];
__pyx_v_mat = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMGRestriction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 671, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setMGRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(47, 671, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_162setMGRestriction(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_162setMGRestriction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat) {
PetscInt __pyx_v_clevel;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setMGRestriction", 0);
/* "petsc4py/PETSc/PC.pyx":672
*
* def setMGRestriction(self, level, Mat mat):
* 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(47, 672, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":673
* def setMGRestriction(self, level, Mat mat):
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetRestriction(self.pc, clevel, mat.mat) ) # <<<<<<<<<<<<<<
*
* def getMGRestriction(self, level):
*/
__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(47, 673, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":671
* return interpolation
*
* def setMGRestriction(self, level, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetRestriction(self.pc, clevel, mat.mat) )
*/
/* 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":675
* CHKERR( PCMGSetRestriction(self.pc, clevel, mat.mat) )
*
* def getMGRestriction(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef Mat restriction = Mat()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_165getMGRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_164getMGRestriction[] = "PC.getMGRestriction(self, level)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_165getMGRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMGRestriction") < 0)) __PYX_ERR(47, 675, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_level = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getMGRestriction", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 675, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.getMGRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_164getMGRestriction(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_164getMGRestriction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) {
PetscInt __pyx_v_clevel;
struct PyPetscMatObject *__pyx_v_restriction = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getMGRestriction", 0);
/* "petsc4py/PETSc/PC.pyx":676
*
* def getMGRestriction(self, level):
* 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(47, 676, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":677
* def getMGRestriction(self, level):
* cdef PetscInt clevel = asInt(level)
* cdef Mat restriction = Mat() # <<<<<<<<<<<<<<
* CHKERR( PCMGGetRestriction(self.pc, clevel, &restriction.mat) )
* PetscINCREF(restriction.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 677, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_restriction = ((struct PyPetscMatObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/PC.pyx":678
* cdef PetscInt clevel = asInt(level)
* cdef Mat restriction = Mat()
* CHKERR( PCMGGetRestriction(self.pc, clevel, &restriction.mat) ) # <<<<<<<<<<<<<<
* PetscINCREF(restriction.obj)
* return restriction
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetRestriction(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_restriction->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 678, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":679
* cdef Mat restriction = Mat()
* CHKERR( PCMGGetRestriction(self.pc, clevel, &restriction.mat) )
* PetscINCREF(restriction.obj) # <<<<<<<<<<<<<<
* return restriction
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_restriction->__pyx_base.obj));
/* "petsc4py/PETSc/PC.pyx":680
* CHKERR( PCMGGetRestriction(self.pc, clevel, &restriction.mat) )
* PetscINCREF(restriction.obj)
* return restriction # <<<<<<<<<<<<<<
*
* def setMGRScale(self, level, Vec rscale):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_restriction));
__pyx_r = ((PyObject *)__pyx_v_restriction);
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":675
* CHKERR( PCMGSetRestriction(self.pc, clevel, mat.mat) )
*
* def getMGRestriction(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef Mat restriction = Mat()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.PC.getMGRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_restriction);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":682
* return restriction
*
* def setMGRScale(self, level, Vec rscale): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetRScale(self.pc, clevel, rscale.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_167setMGRScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_166setMGRScale[] = "PC.setMGRScale(self, level, Vec rscale)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_167setMGRScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 0;
struct PyPetscVecObject *__pyx_v_rscale = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_rscale,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rscale)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setMGRScale", 1, 2, 2, 1); __PYX_ERR(47, 682, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGRScale") < 0)) __PYX_ERR(47, 682, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_level = values[0];
__pyx_v_rscale = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMGRScale", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 682, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setMGRScale", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rscale), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "rscale", 0))) __PYX_ERR(47, 682, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_166setMGRScale(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_rscale);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_166setMGRScale(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_rscale) {
PetscInt __pyx_v_clevel;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setMGRScale", 0);
/* "petsc4py/PETSc/PC.pyx":683
*
* def setMGRScale(self, level, Vec rscale):
* 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(47, 683, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":684
* def setMGRScale(self, level, Vec rscale):
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetRScale(self.pc, clevel, rscale.vec) ) # <<<<<<<<<<<<<<
*
* def getMGRScale(self, level):
*/
__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(47, 684, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":682
* return restriction
*
* def setMGRScale(self, level, Vec rscale): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetRScale(self.pc, clevel, rscale.vec) )
*/
/* 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":686
* CHKERR( PCMGSetRScale(self.pc, clevel, rscale.vec) )
*
* def getMGRScale(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef Vec rscale = Vec()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_169getMGRScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_168getMGRScale[] = "PC.getMGRScale(self, level)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_169getMGRScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMGRScale") < 0)) __PYX_ERR(47, 686, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_level = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getMGRScale", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 686, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.getMGRScale", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_168getMGRScale(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_168getMGRScale(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) {
PetscInt __pyx_v_clevel;
struct PyPetscVecObject *__pyx_v_rscale = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getMGRScale", 0);
/* "petsc4py/PETSc/PC.pyx":687
*
* def getMGRScale(self, level):
* 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(47, 687, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":688
* def getMGRScale(self, level):
* cdef PetscInt clevel = asInt(level)
* cdef Vec rscale = Vec() # <<<<<<<<<<<<<<
* CHKERR( PCMGGetRScale(self.pc, clevel, &rscale.vec) )
* PetscINCREF(rscale.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 688, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_rscale = ((struct PyPetscVecObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/PC.pyx":689
* cdef PetscInt clevel = asInt(level)
* cdef Vec rscale = Vec()
* CHKERR( PCMGGetRScale(self.pc, clevel, &rscale.vec) ) # <<<<<<<<<<<<<<
* PetscINCREF(rscale.obj)
* return rscale
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetRScale(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_rscale->vec))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 689, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":690
* cdef Vec rscale = Vec()
* CHKERR( PCMGGetRScale(self.pc, clevel, &rscale.vec) )
* PetscINCREF(rscale.obj) # <<<<<<<<<<<<<<
* return rscale
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_rscale->__pyx_base.obj));
/* "petsc4py/PETSc/PC.pyx":691
* CHKERR( PCMGGetRScale(self.pc, clevel, &rscale.vec) )
* PetscINCREF(rscale.obj)
* return rscale # <<<<<<<<<<<<<<
*
* def getMGSmoother(self, level):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_rscale));
__pyx_r = ((PyObject *)__pyx_v_rscale);
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":686
* CHKERR( PCMGSetRScale(self.pc, clevel, rscale.vec) )
*
* def getMGRScale(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef Vec rscale = Vec()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.PC.getMGRScale", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_rscale);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":693
* return rscale
*
* def getMGSmoother(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef KSP ksp = KSP()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_171getMGSmoother(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_170getMGSmoother[] = "PC.getMGSmoother(self, level)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_171getMGSmoother(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMGSmoother") < 0)) __PYX_ERR(47, 693, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_level = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getMGSmoother", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 693, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmoother", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_170getMGSmoother(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_170getMGSmoother(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) {
PetscInt __pyx_v_clevel;
struct PyPetscKSPObject *__pyx_v_ksp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getMGSmoother", 0);
/* "petsc4py/PETSc/PC.pyx":694
*
* def getMGSmoother(self, level):
* 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(47, 694, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":695
* def getMGSmoother(self, level):
* cdef PetscInt clevel = asInt(level)
* cdef KSP ksp = KSP() # <<<<<<<<<<<<<<
* CHKERR( PCMGGetSmoother(self.pc, clevel, &ksp.ksp) )
* PetscINCREF(ksp.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 695, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/PC.pyx":696
* cdef PetscInt clevel = asInt(level)
* cdef KSP ksp = KSP()
* CHKERR( PCMGGetSmoother(self.pc, clevel, &ksp.ksp) ) # <<<<<<<<<<<<<<
* PetscINCREF(ksp.obj)
* return ksp
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetSmoother(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 696, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":697
* cdef KSP ksp = KSP()
* CHKERR( PCMGGetSmoother(self.pc, clevel, &ksp.ksp) )
* PetscINCREF(ksp.obj) # <<<<<<<<<<<<<<
* return ksp
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj));
/* "petsc4py/PETSc/PC.pyx":698
* CHKERR( PCMGGetSmoother(self.pc, clevel, &ksp.ksp) )
* PetscINCREF(ksp.obj)
* return ksp # <<<<<<<<<<<<<<
*
* def getMGSmootherDown(self, level):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_ksp));
__pyx_r = ((PyObject *)__pyx_v_ksp);
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":693
* return rscale
*
* def getMGSmoother(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef KSP ksp = KSP()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmoother", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ksp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":700
* return ksp
*
* def getMGSmootherDown(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef KSP ksp = KSP()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_173getMGSmootherDown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_172getMGSmootherDown[] = "PC.getMGSmootherDown(self, level)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_173getMGSmootherDown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMGSmootherDown") < 0)) __PYX_ERR(47, 700, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_level = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getMGSmootherDown", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 700, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmootherDown", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_172getMGSmootherDown(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_172getMGSmootherDown(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) {
PetscInt __pyx_v_clevel;
struct PyPetscKSPObject *__pyx_v_ksp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getMGSmootherDown", 0);
/* "petsc4py/PETSc/PC.pyx":701
*
* def getMGSmootherDown(self, level):
* 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(47, 701, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":702
* def getMGSmootherDown(self, level):
* cdef PetscInt clevel = asInt(level)
* cdef KSP ksp = KSP() # <<<<<<<<<<<<<<
* CHKERR( PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp) )
* PetscINCREF(ksp.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 702, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/PC.pyx":703
* cdef PetscInt clevel = asInt(level)
* cdef KSP ksp = KSP()
* CHKERR( PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp) ) # <<<<<<<<<<<<<<
* PetscINCREF(ksp.obj)
* return ksp
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetSmootherDown(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 703, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":704
* cdef KSP ksp = KSP()
* CHKERR( PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp) )
* PetscINCREF(ksp.obj) # <<<<<<<<<<<<<<
* return ksp
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj));
/* "petsc4py/PETSc/PC.pyx":705
* CHKERR( PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp) )
* PetscINCREF(ksp.obj)
* return ksp # <<<<<<<<<<<<<<
*
* def getMGSmootherUp(self, level):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_ksp));
__pyx_r = ((PyObject *)__pyx_v_ksp);
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":700
* return ksp
*
* def getMGSmootherDown(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef KSP ksp = KSP()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmootherDown", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ksp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":707
* return ksp
*
* def getMGSmootherUp(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef KSP ksp = KSP()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_175getMGSmootherUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_174getMGSmootherUp[] = "PC.getMGSmootherUp(self, level)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_175getMGSmootherUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMGSmootherUp") < 0)) __PYX_ERR(47, 707, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_level = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getMGSmootherUp", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 707, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmootherUp", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_174getMGSmootherUp(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_174getMGSmootherUp(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) {
PetscInt __pyx_v_clevel;
struct PyPetscKSPObject *__pyx_v_ksp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getMGSmootherUp", 0);
/* "petsc4py/PETSc/PC.pyx":708
*
* def getMGSmootherUp(self, level):
* 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(47, 708, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":709
* def getMGSmootherUp(self, level):
* cdef PetscInt clevel = asInt(level)
* cdef KSP ksp = KSP() # <<<<<<<<<<<<<<
* CHKERR( PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp) )
* PetscINCREF(ksp.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 709, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/PC.pyx":710
* cdef PetscInt clevel = asInt(level)
* cdef KSP ksp = KSP()
* CHKERR( PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp) ) # <<<<<<<<<<<<<<
* PetscINCREF(ksp.obj)
* return ksp
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetSmootherUp(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 710, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":711
* cdef KSP ksp = KSP()
* CHKERR( PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp) )
* PetscINCREF(ksp.obj) # <<<<<<<<<<<<<<
* return ksp
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj));
/* "petsc4py/PETSc/PC.pyx":712
* CHKERR( PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp) )
* PetscINCREF(ksp.obj)
* return ksp # <<<<<<<<<<<<<<
*
* def setMGCycleType(self, cycle_type):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_ksp));
__pyx_r = ((PyObject *)__pyx_v_ksp);
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":707
* return ksp
*
* def getMGSmootherUp(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef KSP ksp = KSP()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmootherUp", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ksp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":714
* return ksp
*
* def setMGCycleType(self, cycle_type): # <<<<<<<<<<<<<<
* cdef PetscPCMGCycleType ctype = cycle_type
* CHKERR( PCMGSetCycleType(self.pc, ctype) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_177setMGCycleType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_176setMGCycleType[] = "PC.setMGCycleType(self, cycle_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_177setMGCycleType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_cycle_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cycle_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cycle_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGCycleType") < 0)) __PYX_ERR(47, 714, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_cycle_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMGCycleType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 714, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setMGCycleType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_176setMGCycleType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_cycle_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_176setMGCycleType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_cycle_type) {
PCMGCycleType __pyx_v_ctype;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PCMGCycleType __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setMGCycleType", 0);
/* "petsc4py/PETSc/PC.pyx":715
*
* def setMGCycleType(self, cycle_type):
* cdef PetscPCMGCycleType ctype = cycle_type # <<<<<<<<<<<<<<
* CHKERR( PCMGSetCycleType(self.pc, ctype) )
*
*/
__pyx_t_1 = ((PCMGCycleType)__Pyx_PyInt_As_PCMGCycleType(__pyx_v_cycle_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 715, __pyx_L1_error)
__pyx_v_ctype = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":716
* def setMGCycleType(self, cycle_type):
* cdef PetscPCMGCycleType ctype = cycle_type
* CHKERR( PCMGSetCycleType(self.pc, ctype) ) # <<<<<<<<<<<<<<
*
* def setMGCycleTypeOnLevel(self, level, cycle_type):
*/
__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(47, 716, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":714
* return ksp
*
* def setMGCycleType(self, cycle_type): # <<<<<<<<<<<<<<
* cdef PetscPCMGCycleType ctype = cycle_type
* CHKERR( PCMGSetCycleType(self.pc, ctype) )
*/
/* 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":718
* CHKERR( PCMGSetCycleType(self.pc, ctype) )
*
* def setMGCycleTypeOnLevel(self, level, cycle_type): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef PetscPCMGCycleType ctype = cycle_type
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_179setMGCycleTypeOnLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_178setMGCycleTypeOnLevel[] = "PC.setMGCycleTypeOnLevel(self, level, cycle_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_179setMGCycleTypeOnLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 0;
PyObject *__pyx_v_cycle_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_cycle_type,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cycle_type)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setMGCycleTypeOnLevel", 1, 2, 2, 1); __PYX_ERR(47, 718, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGCycleTypeOnLevel") < 0)) __PYX_ERR(47, 718, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_level = values[0];
__pyx_v_cycle_type = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMGCycleTypeOnLevel", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 718, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setMGCycleTypeOnLevel", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_178setMGCycleTypeOnLevel(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_cycle_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_178setMGCycleTypeOnLevel(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_cycle_type) {
PetscInt __pyx_v_clevel;
PCMGCycleType __pyx_v_ctype;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PCMGCycleType __pyx_t_2;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setMGCycleTypeOnLevel", 0);
/* "petsc4py/PETSc/PC.pyx":719
*
* def setMGCycleTypeOnLevel(self, level, cycle_type):
* 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(47, 719, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":720
* def setMGCycleTypeOnLevel(self, level, cycle_type):
* cdef PetscInt clevel = asInt(level)
* cdef PetscPCMGCycleType ctype = cycle_type # <<<<<<<<<<<<<<
* CHKERR( PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype) )
*
*/
__pyx_t_2 = ((PCMGCycleType)__Pyx_PyInt_As_PCMGCycleType(__pyx_v_cycle_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 720, __pyx_L1_error)
__pyx_v_ctype = __pyx_t_2;
/* "petsc4py/PETSc/PC.pyx":721
* cdef PetscInt clevel = asInt(level)
* cdef PetscPCMGCycleType ctype = cycle_type
* CHKERR( PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype) ) # <<<<<<<<<<<<<<
*
* def setMGRhs(self, level, Vec rhs):
*/
__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(47, 721, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":718
* CHKERR( PCMGSetCycleType(self.pc, ctype) )
*
* def setMGCycleTypeOnLevel(self, level, cycle_type): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef PetscPCMGCycleType ctype = cycle_type
*/
/* 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":723
* CHKERR( PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype) )
*
* def setMGRhs(self, level, Vec rhs): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetRhs(self.pc, clevel, rhs.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_181setMGRhs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_180setMGRhs[] = "PC.setMGRhs(self, level, Vec rhs)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_181setMGRhs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 0;
struct PyPetscVecObject *__pyx_v_rhs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_rhs,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setMGRhs", 1, 2, 2, 1); __PYX_ERR(47, 723, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGRhs") < 0)) __PYX_ERR(47, 723, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_level = values[0];
__pyx_v_rhs = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMGRhs", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 723, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setMGRhs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "rhs", 0))) __PYX_ERR(47, 723, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_180setMGRhs(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_rhs);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_180setMGRhs(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_rhs) {
PetscInt __pyx_v_clevel;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setMGRhs", 0);
/* "petsc4py/PETSc/PC.pyx":724
*
* def setMGRhs(self, level, Vec rhs):
* 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(47, 724, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":725
* def setMGRhs(self, level, Vec rhs):
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetRhs(self.pc, clevel, rhs.vec) ) # <<<<<<<<<<<<<<
*
* def setMGX(self, level, Vec x):
*/
__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(47, 725, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":723
* CHKERR( PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype) )
*
* def setMGRhs(self, level, Vec rhs): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetRhs(self.pc, clevel, rhs.vec) )
*/
/* 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":727
* CHKERR( PCMGSetRhs(self.pc, clevel, rhs.vec) )
*
* def setMGX(self, level, Vec x): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetX(self.pc, clevel, x.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_183setMGX(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_182setMGX[] = "PC.setMGX(self, level, Vec x)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_183setMGX(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 0;
struct PyPetscVecObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_x,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setMGX", 1, 2, 2, 1); __PYX_ERR(47, 727, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGX") < 0)) __PYX_ERR(47, 727, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_level = values[0];
__pyx_v_x = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMGX", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 727, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setMGX", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(47, 727, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_182setMGX(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_x);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_182setMGX(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_x) {
PetscInt __pyx_v_clevel;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setMGX", 0);
/* "petsc4py/PETSc/PC.pyx":728
*
* def setMGX(self, level, Vec x):
* 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(47, 728, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":729
* def setMGX(self, level, Vec x):
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetX(self.pc, clevel, x.vec) ) # <<<<<<<<<<<<<<
*
* def setMGR(self, level, Vec r):
*/
__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(47, 729, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":727
* CHKERR( PCMGSetRhs(self.pc, clevel, rhs.vec) )
*
* def setMGX(self, level, Vec x): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetX(self.pc, clevel, x.vec) )
*/
/* 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":731
* CHKERR( PCMGSetX(self.pc, clevel, x.vec) )
*
* def setMGR(self, level, Vec r): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetR(self.pc, clevel, r.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_185setMGR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_184setMGR[] = "PC.setMGR(self, level, Vec r)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_185setMGR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 0;
struct PyPetscVecObject *__pyx_v_r = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_r,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setMGR", 1, 2, 2, 1); __PYX_ERR(47, 731, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGR") < 0)) __PYX_ERR(47, 731, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_level = values[0];
__pyx_v_r = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMGR", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 731, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setMGR", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_r), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "r", 0))) __PYX_ERR(47, 731, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_184setMGR(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_r);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_184setMGR(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_r) {
PetscInt __pyx_v_clevel;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setMGR", 0);
/* "petsc4py/PETSc/PC.pyx":732
*
* def setMGR(self, level, Vec r):
* 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(47, 732, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":733
* def setMGR(self, level, Vec r):
* 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(47, 733, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":731
* CHKERR( PCMGSetX(self.pc, clevel, x.vec) )
*
* def setMGR(self, level, Vec r): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( PCMGSetR(self.pc, clevel, r.vec) )
*/
/* 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":737
* # --- BDDC ---
*
* def setBDDCDivergenceMat(self, Mat div, trans=False, IS l2l=None): # <<<<<<<<<<<<<<
* cdef PetscBool ptrans = trans
* cdef PetscIS pl2l = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_187setBDDCDivergenceMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_186setBDDCDivergenceMat[] = "PC.setBDDCDivergenceMat(self, Mat div, trans=False, IS l2l=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_187setBDDCDivergenceMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_div = 0;
PyObject *__pyx_v_trans = 0;
struct PyPetscISObject *__pyx_v_l2l = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_div,&__pyx_n_s_trans,&__pyx_n_s_l2l,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_False);
values[2] = (PyObject *)((struct PyPetscISObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_div)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trans);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l2l);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCDivergenceMat") < 0)) __PYX_ERR(47, 737, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_div = ((struct PyPetscMatObject *)values[0]);
__pyx_v_trans = values[1];
__pyx_v_l2l = ((struct PyPetscISObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBDDCDivergenceMat", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 737, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDivergenceMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_div), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "div", 0))) __PYX_ERR(47, 737, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2l), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "l2l", 0))) __PYX_ERR(47, 737, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_186setBDDCDivergenceMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_div, __pyx_v_trans, __pyx_v_l2l);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_186setBDDCDivergenceMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_div, PyObject *__pyx_v_trans, struct PyPetscISObject *__pyx_v_l2l) {
PetscBool __pyx_v_ptrans;
IS __pyx_v_pl2l;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscBool __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
IS __pyx_t_4;
PetscErrorCode __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBDDCDivergenceMat", 0);
/* "petsc4py/PETSc/PC.pyx":738
*
* def setBDDCDivergenceMat(self, Mat div, trans=False, IS l2l=None):
* cdef PetscBool ptrans = trans # <<<<<<<<<<<<<<
* cdef PetscIS pl2l = NULL
* if l2l is not None: pl2l = l2l.iset
*/
__pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_trans)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 738, __pyx_L1_error)
__pyx_v_ptrans = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":739
* def setBDDCDivergenceMat(self, Mat div, trans=False, IS l2l=None):
* 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":740
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_4 = __pyx_v_l2l->iset;
__pyx_v_pl2l = __pyx_t_4;
}
/* "petsc4py/PETSc/PC.pyx":741
* cdef PetscIS pl2l = NULL
* if l2l is not None: pl2l = l2l.iset
* CHKERR( PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l) ) # <<<<<<<<<<<<<<
*
* def setBDDCDiscreteGradient(self, Mat G, order=1, field=1, gord=True, conforming=True):
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetDivergenceMat(__pyx_v_self->pc, __pyx_v_div->mat, __pyx_v_ptrans, __pyx_v_pl2l)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 741, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":737
* # --- BDDC ---
*
* def setBDDCDivergenceMat(self, Mat div, trans=False, IS l2l=None): # <<<<<<<<<<<<<<
* cdef PetscBool ptrans = trans
* cdef PetscIS pl2l = NULL
*/
/* 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":743
* CHKERR( PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l) )
*
* def setBDDCDiscreteGradient(self, Mat G, order=1, field=1, gord=True, conforming=True): # <<<<<<<<<<<<<<
* cdef PetscInt porder = asInt(order)
* cdef PetscInt pfield = asInt(field)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_189setBDDCDiscreteGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_188setBDDCDiscreteGradient[] = "PC.setBDDCDiscreteGradient(self, Mat G, order=1, field=1, gord=True, conforming=True)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_189setBDDCDiscreteGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setBDDCDiscreteGradient (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_G,&__pyx_n_s_order,&__pyx_n_s_field,&__pyx_n_s_gord,&__pyx_n_s_conforming,0};
PyObject* values[5] = {0,0,0,0,0};
values[1] = ((PyObject *)__pyx_int_1);
values[2] = ((PyObject *)__pyx_int_1);
values[3] = ((PyObject *)Py_True);
values[4] = ((PyObject *)Py_True);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_G)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_order);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gord);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_conforming);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCDiscreteGradient") < 0)) __PYX_ERR(47, 743, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_G = ((struct PyPetscMatObject *)values[0]);
__pyx_v_order = values[1];
__pyx_v_field = values[2];
__pyx_v_gord = values[3];
__pyx_v_conforming = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBDDCDiscreteGradient", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 743, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDiscreteGradient", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_G), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "G", 0))) __PYX_ERR(47, 743, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_188setBDDCDiscreteGradient(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_G, __pyx_v_order, __pyx_v_field, __pyx_v_gord, __pyx_v_conforming);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_188setBDDCDiscreteGradient(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_G, PyObject *__pyx_v_order, PyObject *__pyx_v_field, PyObject *__pyx_v_gord, PyObject *__pyx_v_conforming) {
PetscInt __pyx_v_porder;
PetscInt __pyx_v_pfield;
PetscBool __pyx_v_pgord;
PetscBool __pyx_v_pconforming;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscBool __pyx_t_2;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBDDCDiscreteGradient", 0);
/* "petsc4py/PETSc/PC.pyx":744
*
* def setBDDCDiscreteGradient(self, Mat G, order=1, field=1, gord=True, conforming=True):
* 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(47, 744, __pyx_L1_error)
__pyx_v_porder = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":745
* def setBDDCDiscreteGradient(self, Mat G, order=1, field=1, gord=True, conforming=True):
* 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(47, 745, __pyx_L1_error)
__pyx_v_pfield = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":746
* cdef PetscInt porder = asInt(order)
* cdef PetscInt pfield = asInt(field)
* cdef PetscBool pgord = gord # <<<<<<<<<<<<<<
* cdef PetscBool pconforming = conforming
* CHKERR( PCBDDCSetDiscreteGradient(self.pc, G.mat, porder, pfield, pgord, pconforming) )
*/
__pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_gord)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 746, __pyx_L1_error)
__pyx_v_pgord = __pyx_t_2;
/* "petsc4py/PETSc/PC.pyx":747
* cdef PetscInt pfield = asInt(field)
* cdef PetscBool pgord = gord
* cdef PetscBool pconforming = conforming # <<<<<<<<<<<<<<
* CHKERR( PCBDDCSetDiscreteGradient(self.pc, G.mat, porder, pfield, pgord, pconforming) )
*
*/
__pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_conforming)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 747, __pyx_L1_error)
__pyx_v_pconforming = __pyx_t_2;
/* "petsc4py/PETSc/PC.pyx":748
* cdef PetscBool pgord = gord
* cdef PetscBool pconforming = conforming
* CHKERR( PCBDDCSetDiscreteGradient(self.pc, G.mat, porder, pfield, pgord, pconforming) ) # <<<<<<<<<<<<<<
*
* def setBDDCChangeOfBasisMat(self, Mat T, interior=False):
*/
__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(47, 748, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":743
* CHKERR( PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l) )
*
* def setBDDCDiscreteGradient(self, Mat G, order=1, field=1, gord=True, conforming=True): # <<<<<<<<<<<<<<
* cdef PetscInt porder = asInt(order)
* cdef PetscInt pfield = asInt(field)
*/
/* 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":750
* CHKERR( PCBDDCSetDiscreteGradient(self.pc, G.mat, porder, pfield, pgord, pconforming) )
*
* def setBDDCChangeOfBasisMat(self, Mat T, interior=False): # <<<<<<<<<<<<<<
* cdef PetscBool pinterior = interior
* CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_191setBDDCChangeOfBasisMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_190setBDDCChangeOfBasisMat[] = "PC.setBDDCChangeOfBasisMat(self, Mat T, interior=False)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_191setBDDCChangeOfBasisMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_T = 0;
PyObject *__pyx_v_interior = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_T,&__pyx_n_s_interior,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_False);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_T)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interior);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCChangeOfBasisMat") < 0)) __PYX_ERR(47, 750, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_T = ((struct PyPetscMatObject *)values[0]);
__pyx_v_interior = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBDDCChangeOfBasisMat", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 750, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCChangeOfBasisMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "T", 0))) __PYX_ERR(47, 750, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_190setBDDCChangeOfBasisMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_T, __pyx_v_interior);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_190setBDDCChangeOfBasisMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_T, PyObject *__pyx_v_interior) {
PetscBool __pyx_v_pinterior;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscBool __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBDDCChangeOfBasisMat", 0);
/* "petsc4py/PETSc/PC.pyx":751
*
* def setBDDCChangeOfBasisMat(self, Mat T, interior=False):
* cdef PetscBool pinterior = interior # <<<<<<<<<<<<<<
* CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) )
*
*/
__pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interior)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 751, __pyx_L1_error)
__pyx_v_pinterior = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":752
* def setBDDCChangeOfBasisMat(self, Mat T, interior=False):
* cdef PetscBool pinterior = interior
* CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) ) # <<<<<<<<<<<<<<
*
* def setBDDCPrimalVerticesIS(self, IS primv):
*/
__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(47, 752, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":750
* CHKERR( PCBDDCSetDiscreteGradient(self.pc, G.mat, porder, pfield, pgord, pconforming) )
*
* def setBDDCChangeOfBasisMat(self, Mat T, interior=False): # <<<<<<<<<<<<<<
* cdef PetscBool pinterior = interior
* CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) )
*/
/* 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":754
* CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) )
*
* def setBDDCPrimalVerticesIS(self, IS primv): # <<<<<<<<<<<<<<
* CHKERR( PCBDDCSetPrimalVerticesIS(self.pc, primv.iset) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_193setBDDCPrimalVerticesIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_192setBDDCPrimalVerticesIS[] = "PC.setBDDCPrimalVerticesIS(self, IS primv)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_193setBDDCPrimalVerticesIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_primv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_primv,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_primv)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCPrimalVerticesIS") < 0)) __PYX_ERR(47, 754, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_primv = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBDDCPrimalVerticesIS", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 754, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCPrimalVerticesIS", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_primv), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "primv", 0))) __PYX_ERR(47, 754, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_192setBDDCPrimalVerticesIS(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_primv);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_192setBDDCPrimalVerticesIS(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_primv) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBDDCPrimalVerticesIS", 0);
/* "petsc4py/PETSc/PC.pyx":755
*
* def setBDDCPrimalVerticesIS(self, IS primv):
* CHKERR( PCBDDCSetPrimalVerticesIS(self.pc, primv.iset) ) # <<<<<<<<<<<<<<
*
* def setBDDCPrimalVerticesLocalIS(self, IS primv):
*/
__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(47, 755, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":754
* CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) )
*
* def setBDDCPrimalVerticesIS(self, IS primv): # <<<<<<<<<<<<<<
* CHKERR( PCBDDCSetPrimalVerticesIS(self.pc, primv.iset) )
*
*/
/* 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":757
* CHKERR( PCBDDCSetPrimalVerticesIS(self.pc, primv.iset) )
*
* def setBDDCPrimalVerticesLocalIS(self, IS primv): # <<<<<<<<<<<<<<
* CHKERR( PCBDDCSetPrimalVerticesLocalIS(self.pc, primv.iset) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_195setBDDCPrimalVerticesLocalIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_194setBDDCPrimalVerticesLocalIS[] = "PC.setBDDCPrimalVerticesLocalIS(self, IS primv)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_195setBDDCPrimalVerticesLocalIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_primv = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_primv,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_primv)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCPrimalVerticesLocalIS") < 0)) __PYX_ERR(47, 757, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_primv = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBDDCPrimalVerticesLocalIS", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 757, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCPrimalVerticesLocalIS", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_primv), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "primv", 0))) __PYX_ERR(47, 757, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_194setBDDCPrimalVerticesLocalIS(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_primv);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_194setBDDCPrimalVerticesLocalIS(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_primv) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBDDCPrimalVerticesLocalIS", 0);
/* "petsc4py/PETSc/PC.pyx":758
*
* def setBDDCPrimalVerticesLocalIS(self, IS primv):
* CHKERR( PCBDDCSetPrimalVerticesLocalIS(self.pc, primv.iset) ) # <<<<<<<<<<<<<<
*
* def setBDDCCoarseningRatio(self, cratio):
*/
__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(47, 758, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":757
* CHKERR( PCBDDCSetPrimalVerticesIS(self.pc, primv.iset) )
*
* def setBDDCPrimalVerticesLocalIS(self, IS primv): # <<<<<<<<<<<<<<
* CHKERR( PCBDDCSetPrimalVerticesLocalIS(self.pc, primv.iset) )
*
*/
/* 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":760
* CHKERR( PCBDDCSetPrimalVerticesLocalIS(self.pc, primv.iset) )
*
* def setBDDCCoarseningRatio(self, cratio): # <<<<<<<<<<<<<<
* cdef PetscInt pcratio = asInt(cratio)
* CHKERR( PCBDDCSetCoarseningRatio(self.pc, pcratio) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_197setBDDCCoarseningRatio(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_196setBDDCCoarseningRatio[] = "PC.setBDDCCoarseningRatio(self, cratio)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_197setBDDCCoarseningRatio(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_cratio = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cratio,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cratio)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCCoarseningRatio") < 0)) __PYX_ERR(47, 760, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_cratio = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBDDCCoarseningRatio", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 760, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCCoarseningRatio", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_196setBDDCCoarseningRatio(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_cratio);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_196setBDDCCoarseningRatio(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_cratio) {
PetscInt __pyx_v_pcratio;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBDDCCoarseningRatio", 0);
/* "petsc4py/PETSc/PC.pyx":761
*
* def setBDDCCoarseningRatio(self, cratio):
* 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(47, 761, __pyx_L1_error)
__pyx_v_pcratio = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":762
* def setBDDCCoarseningRatio(self, cratio):
* cdef PetscInt pcratio = asInt(cratio)
* CHKERR( PCBDDCSetCoarseningRatio(self.pc, pcratio) ) # <<<<<<<<<<<<<<
*
* def setBDDCLevels(self, levels):
*/
__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(47, 762, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":760
* CHKERR( PCBDDCSetPrimalVerticesLocalIS(self.pc, primv.iset) )
*
* def setBDDCCoarseningRatio(self, cratio): # <<<<<<<<<<<<<<
* cdef PetscInt pcratio = asInt(cratio)
* CHKERR( PCBDDCSetCoarseningRatio(self.pc, pcratio) )
*/
/* 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":764
* CHKERR( PCBDDCSetCoarseningRatio(self.pc, pcratio) )
*
* def setBDDCLevels(self, levels): # <<<<<<<<<<<<<<
* cdef PetscInt plevels = asInt(levels)
* CHKERR( PCBDDCSetLevels(self.pc, plevels) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_199setBDDCLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_198setBDDCLevels[] = "PC.setBDDCLevels(self, levels)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_199setBDDCLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_levels = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCLevels") < 0)) __PYX_ERR(47, 764, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_levels = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBDDCLevels", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 764, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCLevels", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_198setBDDCLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_198setBDDCLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels) {
PetscInt __pyx_v_plevels;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBDDCLevels", 0);
/* "petsc4py/PETSc/PC.pyx":765
*
* def setBDDCLevels(self, levels):
* 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(47, 765, __pyx_L1_error)
__pyx_v_plevels = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":766
* def setBDDCLevels(self, levels):
* cdef PetscInt plevels = asInt(levels)
* CHKERR( PCBDDCSetLevels(self.pc, plevels) ) # <<<<<<<<<<<<<<
*
* def setBDDCDirichletBoundaries(self, IS bndr):
*/
__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(47, 766, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":764
* CHKERR( PCBDDCSetCoarseningRatio(self.pc, pcratio) )
*
* def setBDDCLevels(self, levels): # <<<<<<<<<<<<<<
* cdef PetscInt plevels = asInt(levels)
* CHKERR( PCBDDCSetLevels(self.pc, plevels) )
*/
/* 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":768
* CHKERR( PCBDDCSetLevels(self.pc, plevels) )
*
* def setBDDCDirichletBoundaries(self, IS bndr): # <<<<<<<<<<<<<<
* CHKERR( PCBDDCSetDirichletBoundaries(self.pc, bndr.iset) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_201setBDDCDirichletBoundaries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_200setBDDCDirichletBoundaries[] = "PC.setBDDCDirichletBoundaries(self, IS bndr)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_201setBDDCDirichletBoundaries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_bndr = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bndr,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bndr)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCDirichletBoundaries") < 0)) __PYX_ERR(47, 768, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_bndr = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBDDCDirichletBoundaries", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 768, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDirichletBoundaries", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bndr), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(47, 768, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_200setBDDCDirichletBoundaries(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_200setBDDCDirichletBoundaries(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBDDCDirichletBoundaries", 0);
/* "petsc4py/PETSc/PC.pyx":769
*
* def setBDDCDirichletBoundaries(self, IS bndr):
* CHKERR( PCBDDCSetDirichletBoundaries(self.pc, bndr.iset) ) # <<<<<<<<<<<<<<
*
* def setBDDCDirichletBoundariesLocal(self, IS bndr):
*/
__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(47, 769, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":768
* CHKERR( PCBDDCSetLevels(self.pc, plevels) )
*
* def setBDDCDirichletBoundaries(self, IS bndr): # <<<<<<<<<<<<<<
* CHKERR( PCBDDCSetDirichletBoundaries(self.pc, bndr.iset) )
*
*/
/* 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":771
* CHKERR( PCBDDCSetDirichletBoundaries(self.pc, bndr.iset) )
*
* def setBDDCDirichletBoundariesLocal(self, IS bndr): # <<<<<<<<<<<<<<
* CHKERR( PCBDDCSetDirichletBoundariesLocal(self.pc, bndr.iset) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_203setBDDCDirichletBoundariesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_202setBDDCDirichletBoundariesLocal[] = "PC.setBDDCDirichletBoundariesLocal(self, IS bndr)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_203setBDDCDirichletBoundariesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_bndr = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bndr,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bndr)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCDirichletBoundariesLocal") < 0)) __PYX_ERR(47, 771, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_bndr = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBDDCDirichletBoundariesLocal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 771, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDirichletBoundariesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bndr), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(47, 771, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_202setBDDCDirichletBoundariesLocal(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_202setBDDCDirichletBoundariesLocal(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBDDCDirichletBoundariesLocal", 0);
/* "petsc4py/PETSc/PC.pyx":772
*
* def setBDDCDirichletBoundariesLocal(self, IS bndr):
* CHKERR( PCBDDCSetDirichletBoundariesLocal(self.pc, bndr.iset) ) # <<<<<<<<<<<<<<
*
* def setBDDCNeumannBoundaries(self, IS bndr):
*/
__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(47, 772, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":771
* CHKERR( PCBDDCSetDirichletBoundaries(self.pc, bndr.iset) )
*
* def setBDDCDirichletBoundariesLocal(self, IS bndr): # <<<<<<<<<<<<<<
* CHKERR( PCBDDCSetDirichletBoundariesLocal(self.pc, bndr.iset) )
*
*/
/* 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":774
* CHKERR( PCBDDCSetDirichletBoundariesLocal(self.pc, bndr.iset) )
*
* def setBDDCNeumannBoundaries(self, IS bndr): # <<<<<<<<<<<<<<
* CHKERR( PCBDDCSetNeumannBoundaries(self.pc, bndr.iset) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_205setBDDCNeumannBoundaries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_204setBDDCNeumannBoundaries[] = "PC.setBDDCNeumannBoundaries(self, IS bndr)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_205setBDDCNeumannBoundaries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_bndr = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bndr,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bndr)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCNeumannBoundaries") < 0)) __PYX_ERR(47, 774, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_bndr = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBDDCNeumannBoundaries", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 774, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCNeumannBoundaries", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bndr), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(47, 774, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_204setBDDCNeumannBoundaries(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_204setBDDCNeumannBoundaries(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBDDCNeumannBoundaries", 0);
/* "petsc4py/PETSc/PC.pyx":775
*
* def setBDDCNeumannBoundaries(self, IS bndr):
* CHKERR( PCBDDCSetNeumannBoundaries(self.pc, bndr.iset) ) # <<<<<<<<<<<<<<
*
* def setBDDCNeumannBoundariesLocal(self, IS bndr):
*/
__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(47, 775, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":774
* CHKERR( PCBDDCSetDirichletBoundariesLocal(self.pc, bndr.iset) )
*
* def setBDDCNeumannBoundaries(self, IS bndr): # <<<<<<<<<<<<<<
* CHKERR( PCBDDCSetNeumannBoundaries(self.pc, bndr.iset) )
*
*/
/* 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":777
* CHKERR( PCBDDCSetNeumannBoundaries(self.pc, bndr.iset) )
*
* def setBDDCNeumannBoundariesLocal(self, IS bndr): # <<<<<<<<<<<<<<
* CHKERR( PCBDDCSetNeumannBoundariesLocal(self.pc, bndr.iset) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_207setBDDCNeumannBoundariesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_206setBDDCNeumannBoundariesLocal[] = "PC.setBDDCNeumannBoundariesLocal(self, IS bndr)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_207setBDDCNeumannBoundariesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_bndr = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bndr,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bndr)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCNeumannBoundariesLocal") < 0)) __PYX_ERR(47, 777, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_bndr = ((struct PyPetscISObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBDDCNeumannBoundariesLocal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 777, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCNeumannBoundariesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bndr), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(47, 777, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_206setBDDCNeumannBoundariesLocal(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_206setBDDCNeumannBoundariesLocal(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBDDCNeumannBoundariesLocal", 0);
/* "petsc4py/PETSc/PC.pyx":778
*
* def setBDDCNeumannBoundariesLocal(self, IS bndr):
* CHKERR( PCBDDCSetNeumannBoundariesLocal(self.pc, bndr.iset) ) # <<<<<<<<<<<<<<
*
* def setBDDCDofsSplitting(self, isfields):
*/
__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(47, 778, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":777
* CHKERR( PCBDDCSetNeumannBoundaries(self.pc, bndr.iset) )
*
* def setBDDCNeumannBoundariesLocal(self, IS bndr): # <<<<<<<<<<<<<<
* CHKERR( PCBDDCSetNeumannBoundariesLocal(self.pc, bndr.iset) )
*
*/
/* 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":780
* CHKERR( PCBDDCSetNeumannBoundariesLocal(self.pc, bndr.iset) )
*
* def setBDDCDofsSplitting(self, isfields): # <<<<<<<<<<<<<<
* isfields = [isfields] if isinstance(isfields, IS) else list(isfields)
* cdef Py_ssize_t i, n = len(isfields)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_209setBDDCDofsSplitting(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_208setBDDCDofsSplitting[] = "PC.setBDDCDofsSplitting(self, isfields)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_209setBDDCDofsSplitting(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_isfields = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isfields,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isfields)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCDofsSplitting") < 0)) __PYX_ERR(47, 780, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_isfields = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBDDCDofsSplitting", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 780, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDofsSplitting", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_208setBDDCDofsSplitting(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_isfields);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_208setBDDCDofsSplitting(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_isfields) {
Py_ssize_t __pyx_v_i;
Py_ssize_t __pyx_v_n;
IS *__pyx_v_cisfields;
CYTHON_UNUSED PyObject *__pyx_v_tmp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
Py_ssize_t __pyx_t_4;
IS __pyx_t_5;
PetscErrorCode __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBDDCDofsSplitting", 0);
__Pyx_INCREF(__pyx_v_isfields);
/* "petsc4py/PETSc/PC.pyx":781
*
* def setBDDCDofsSplitting(self, isfields):
* isfields = [isfields] if isinstance(isfields, IS) else list(isfields) # <<<<<<<<<<<<<<
* cdef Py_ssize_t i, n = len(isfields)
* cdef PetscIS *cisfields = NULL
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_isfields, __pyx_ptype_8petsc4py_5PETSc_IS);
if ((__pyx_t_2 != 0)) {
__pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 781, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_isfields);
__Pyx_GIVEREF(__pyx_v_isfields);
PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_isfields);
__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(47, 781, __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":782
* def setBDDCDofsSplitting(self, isfields):
* isfields = [isfields] if isinstance(isfields, IS) else list(isfields)
* cdef Py_ssize_t i, n = len(isfields) # <<<<<<<<<<<<<<
* cdef PetscIS *cisfields = NULL
* cdef object tmp
*/
__pyx_t_4 = PyObject_Length(__pyx_v_isfields); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(47, 782, __pyx_L1_error)
__pyx_v_n = __pyx_t_4;
/* "petsc4py/PETSc/PC.pyx":783
* isfields = [isfields] if isinstance(isfields, IS) else list(isfields)
* cdef Py_ssize_t i, n = len(isfields)
* cdef PetscIS *cisfields = NULL # <<<<<<<<<<<<<<
* cdef object tmp
* tmp = oarray_p(empty_p(n), NULL, <void**>&cisfields)
*/
__pyx_v_cisfields = NULL;
/* "petsc4py/PETSc/PC.pyx":785
* cdef PetscIS *cisfields = NULL
* cdef object tmp
* tmp = oarray_p(empty_p(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(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 785, __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(47, 785, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_tmp = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":786
* cdef object tmp
* tmp = oarray_p(empty_p(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, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 786, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(47, 786, __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":787
* tmp = oarray_p(empty_p(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_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(47, 787, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":780
* CHKERR( PCBDDCSetNeumannBoundariesLocal(self.pc, bndr.iset) )
*
* def setBDDCDofsSplitting(self, isfields): # <<<<<<<<<<<<<<
* isfields = [isfields] if isinstance(isfields, IS) else list(isfields)
* cdef Py_ssize_t i, n = len(isfields)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDofsSplitting", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmp);
__Pyx_XDECREF(__pyx_v_isfields);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":790
*
*
* def setBDDCDofsSplittingLocal(self, isfields): # <<<<<<<<<<<<<<
* isfields = [isfields] if isinstance(isfields, IS) else list(isfields)
* cdef Py_ssize_t i, n = len(isfields)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_211setBDDCDofsSplittingLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_210setBDDCDofsSplittingLocal[] = "PC.setBDDCDofsSplittingLocal(self, isfields)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_211setBDDCDofsSplittingLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_isfields = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isfields,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isfields)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCDofsSplittingLocal") < 0)) __PYX_ERR(47, 790, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_isfields = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setBDDCDofsSplittingLocal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 790, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDofsSplittingLocal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_210setBDDCDofsSplittingLocal(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_isfields);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_210setBDDCDofsSplittingLocal(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_isfields) {
Py_ssize_t __pyx_v_i;
Py_ssize_t __pyx_v_n;
IS *__pyx_v_cisfields;
CYTHON_UNUSED PyObject *__pyx_v_tmp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
Py_ssize_t __pyx_t_4;
IS __pyx_t_5;
PetscErrorCode __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setBDDCDofsSplittingLocal", 0);
__Pyx_INCREF(__pyx_v_isfields);
/* "petsc4py/PETSc/PC.pyx":791
*
* def setBDDCDofsSplittingLocal(self, isfields):
* isfields = [isfields] if isinstance(isfields, IS) else list(isfields) # <<<<<<<<<<<<<<
* cdef Py_ssize_t i, n = len(isfields)
* cdef PetscIS *cisfields = NULL
*/
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_isfields, __pyx_ptype_8petsc4py_5PETSc_IS);
if ((__pyx_t_2 != 0)) {
__pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 791, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_isfields);
__Pyx_GIVEREF(__pyx_v_isfields);
PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_isfields);
__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(47, 791, __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":792
* def setBDDCDofsSplittingLocal(self, isfields):
* isfields = [isfields] if isinstance(isfields, IS) else list(isfields)
* cdef Py_ssize_t i, n = len(isfields) # <<<<<<<<<<<<<<
* cdef PetscIS *cisfields = NULL
* cdef object tmp
*/
__pyx_t_4 = PyObject_Length(__pyx_v_isfields); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(47, 792, __pyx_L1_error)
__pyx_v_n = __pyx_t_4;
/* "petsc4py/PETSc/PC.pyx":793
* isfields = [isfields] if isinstance(isfields, IS) else list(isfields)
* cdef Py_ssize_t i, n = len(isfields)
* cdef PetscIS *cisfields = NULL # <<<<<<<<<<<<<<
* cdef object tmp
* tmp = oarray_p(empty_p(n), NULL, <void**>&cisfields)
*/
__pyx_v_cisfields = NULL;
/* "petsc4py/PETSc/PC.pyx":795
* cdef PetscIS *cisfields = NULL
* cdef object tmp
* tmp = oarray_p(empty_p(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(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 795, __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(47, 795, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_tmp = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":796
* cdef object tmp
* tmp = oarray_p(empty_p(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, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 796, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(47, 796, __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":797
* tmp = oarray_p(empty_p(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(47, 797, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":790
*
*
* def setBDDCDofsSplittingLocal(self, isfields): # <<<<<<<<<<<<<<
* isfields = [isfields] if isinstance(isfields, IS) else list(isfields)
* cdef Py_ssize_t i, n = len(isfields)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDofsSplittingLocal", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tmp);
__Pyx_XDECREF(__pyx_v_isfields);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":800
*
* # --- Patch ---
* def setPatchCellNumbering(self, Section sec not None): # <<<<<<<<<<<<<<
* CHKERR( PCPatchSetCellNumbering(self.pc, sec.sec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_213setPatchCellNumbering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_212setPatchCellNumbering[] = "PC.setPatchCellNumbering(self, Section sec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_213setPatchCellNumbering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscSectionObject *__pyx_v_sec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchCellNumbering") < 0)) __PYX_ERR(47, 800, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_sec = ((struct PyPetscSectionObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPatchCellNumbering", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 800, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchCellNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(47, 800, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_212setPatchCellNumbering(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_sec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_212setPatchCellNumbering(struct PyPetscPCObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setPatchCellNumbering", 0);
/* "petsc4py/PETSc/PC.pyx":801
* # --- Patch ---
* def setPatchCellNumbering(self, Section sec not None):
* CHKERR( PCPatchSetCellNumbering(self.pc, sec.sec) ) # <<<<<<<<<<<<<<
*
* def setPatchDiscretisationInfo(self, dms, bs,
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetCellNumbering(__pyx_v_self->pc, __pyx_v_sec->sec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 801, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":800
*
* # --- Patch ---
* def setPatchCellNumbering(self, Section sec not None): # <<<<<<<<<<<<<<
* CHKERR( PCPatchSetCellNumbering(self.pc, sec.sec) )
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchCellNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":803
* CHKERR( PCPatchSetCellNumbering(self.pc, sec.sec) )
*
* def setPatchDiscretisationInfo(self, dms, bs, # <<<<<<<<<<<<<<
* cellNodeMaps,
* subspaceOffsets,
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_215setPatchDiscretisationInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_214setPatchDiscretisationInfo[] = "PC.setPatchDiscretisationInfo(self, dms, bs, cellNodeMaps, subspaceOffsets, ghostBcNodes, globalBcNodes)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_215setPatchDiscretisationInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setPatchDiscretisationInfo (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dms,&__pyx_n_s_bs,&__pyx_n_s_cellNodeMaps,&__pyx_n_s_subspaceOffsets,&__pyx_n_s_ghostBcNodes,&__pyx_n_s_globalBcNodes,0};
PyObject* values[6] = {0,0,0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
CYTHON_FALLTHROUGH;
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dms)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 1); __PYX_ERR(47, 803, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cellNodeMaps)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 2); __PYX_ERR(47, 803, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subspaceOffsets)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 3); __PYX_ERR(47, 803, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 4:
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ghostBcNodes)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 4); __PYX_ERR(47, 803, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 5:
if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_globalBcNodes)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 5); __PYX_ERR(47, 803, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchDiscretisationInfo") < 0)) __PYX_ERR(47, 803, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
}
__pyx_v_dms = values[0];
__pyx_v_bs = values[1];
__pyx_v_cellNodeMaps = values[2];
__pyx_v_subspaceOffsets = values[3];
__pyx_v_ghostBcNodes = values[4];
__pyx_v_globalBcNodes = values[5];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 803, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchDiscretisationInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_214setPatchDiscretisationInfo(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_dms, __pyx_v_bs, __pyx_v_cellNodeMaps, __pyx_v_subspaceOffsets, __pyx_v_ghostBcNodes, __pyx_v_globalBcNodes);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_214setPatchDiscretisationInfo(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_dms, PyObject *__pyx_v_bs, PyObject *__pyx_v_cellNodeMaps, PyObject *__pyx_v_subspaceOffsets, PyObject *__pyx_v_ghostBcNodes, PyObject *__pyx_v_globalBcNodes) {
PetscInt __pyx_v_numSubSpaces;
PetscInt __pyx_v_numGhostBcs;
PetscInt __pyx_v_numGlobalBcs;
PetscInt *__pyx_v_nodesPerCell;
PetscInt const **__pyx_v_ccellNodeMaps;
DM *__pyx_v_cdms;
PetscInt *__pyx_v_cbs;
PetscInt *__pyx_v_csubspaceOffsets;
PetscInt *__pyx_v_cghostBcNodes;
PetscInt *__pyx_v_cglobalBcNodes;
PetscInt __pyx_v_i;
CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
PyObject *__pyx_v_nodes = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
PetscInt __pyx_t_3;
PetscInt __pyx_t_4;
PetscInt __pyx_t_5;
DM __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
PyObject *(*__pyx_t_10)(PyObject *);
PetscInt __pyx_t_11;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setPatchDiscretisationInfo", 0);
__Pyx_INCREF(__pyx_v_bs);
__Pyx_INCREF(__pyx_v_subspaceOffsets);
__Pyx_INCREF(__pyx_v_ghostBcNodes);
__Pyx_INCREF(__pyx_v_globalBcNodes);
/* "petsc4py/PETSc/PC.pyx":808
* ghostBcNodes,
* globalBcNodes):
* cdef PetscInt numSubSpaces = 0 # <<<<<<<<<<<<<<
* cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0
* cdef PetscInt *nodesPerCell = NULL
*/
__pyx_v_numSubSpaces = 0;
/* "petsc4py/PETSc/PC.pyx":809
* globalBcNodes):
* cdef PetscInt numSubSpaces = 0
* cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 # <<<<<<<<<<<<<<
* cdef PetscInt *nodesPerCell = NULL
* cdef const PetscInt **ccellNodeMaps = NULL
*/
__pyx_v_numGhostBcs = 0;
__pyx_v_numGlobalBcs = 0;
/* "petsc4py/PETSc/PC.pyx":810
* 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":811
* 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":812
* 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":813
* 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":814
* 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":815
* 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":816
* cdef PetscInt *csubspaceOffsets = NULL
* cdef PetscInt *cghostBcNodes = NULL
* cdef PetscInt *cglobalBcNodes = NULL # <<<<<<<<<<<<<<
* cdef PetscInt i = 0
*
*/
__pyx_v_cglobalBcNodes = NULL;
/* "petsc4py/PETSc/PC.pyx":817
* 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":819
* 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(47, 819, __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":820
*
* 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(47, 820, __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":821
* 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(47, 821, __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":822
* 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(47, 822, __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":824
* 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(47, 824, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":825
*
* 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(47, 825, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":826
* 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(47, 826, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":827
* 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":828
* 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_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 828, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(47, 828, __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":829
* 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_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 829, __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(47, 829, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 829, __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(47, 829, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
#else
__pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 829, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(47, 829, __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(47, 829, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
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(47, 829, __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(47, 829, __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":830
* 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_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 830, __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(47, 830, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__Pyx_SetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, __pyx_t_8, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1) < 0)) __PYX_ERR(47, 830, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "petsc4py/PETSc/PC.pyx":831
* _, 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(47, 831, __pyx_L1_error)
(__pyx_v_nodesPerCell[__pyx_v_i]) = __pyx_t_11;
}
/* "petsc4py/PETSc/PC.pyx":834
*
* # 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(47, 834, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":839
* 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(47, 839, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":840
* 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(47, 840, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":841
* CHKERR( PetscFree(nodesPerCell) )
* CHKERR( PetscFree(cdms) )
* CHKERR( PetscFree(ccellNodeMaps) ) # <<<<<<<<<<<<<<
*
* def setPatchComputeOperator(self, operator, args=None, kargs=None):
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ccellNodeMaps)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 841, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":803
* 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":843
* CHKERR( PetscFree(ccellNodeMaps) )
*
* def setPatchComputeOperator(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_217setPatchComputeOperator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_216setPatchComputeOperator[] = "PC.setPatchComputeOperator(self, operator, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_217setPatchComputeOperator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_operator = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_operator,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_operator)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchComputeOperator") < 0)) __PYX_ERR(47, 843, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_operator = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPatchComputeOperator", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 843, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeOperator", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_216setPatchComputeOperator(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_operator, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_216setPatchComputeOperator(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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("setPatchComputeOperator", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/PC.pyx":844
*
* def setPatchComputeOperator(self, operator, args=None, kargs=None):
* if args is None: args = () # <<<<<<<<<<<<<<
* if kargs is None: kargs = {}
* context = (operator, args, kargs)
*/
__pyx_t_1 = (__pyx_v_args == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/PC.pyx":845
* def setPatchComputeOperator(self, operator, args=None, kargs=None):
* if args is None: args = ()
* if kargs is None: kargs = {} # <<<<<<<<<<<<<<
* context = (operator, args, kargs)
* self.set_attr("__patch_compute_operator__", context)
*/
__pyx_t_2 = (__pyx_v_kargs == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 845, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3);
__pyx_t_3 = 0;
}
/* "petsc4py/PETSc/PC.pyx":846
* 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_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 846, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_operator);
__Pyx_GIVEREF(__pyx_v_operator);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_operator);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":847
* 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_3 = ((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_3)) __PYX_ERR(47, 847, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":848
* 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):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetComputeOperator(__pyx_v_self->pc, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperator, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 848, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":843
* CHKERR( PetscFree(ccellNodeMaps) )
*
* def setPatchComputeOperator(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":850
* CHKERR( PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, <void*>context) )
*
* def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_219setPatchComputeOperatorInteriorFacets(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_218setPatchComputeOperatorInteriorFacets[] = "PC.setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_219setPatchComputeOperatorInteriorFacets(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_operator = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_operator,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_operator)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchComputeOperatorInteriorFacets") < 0)) __PYX_ERR(47, 850, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_operator = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPatchComputeOperatorInteriorFacets", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 850, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeOperatorInteriorFacets", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_218setPatchComputeOperatorInteriorFacets(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_operator, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_218setPatchComputeOperatorInteriorFacets(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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("setPatchComputeOperatorInteriorFacets", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/PC.pyx":851
*
* def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None):
* if args is None: args = () # <<<<<<<<<<<<<<
* if kargs is None: kargs = {}
* context = (operator, args, kargs)
*/
__pyx_t_1 = (__pyx_v_args == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/PC.pyx":852
* def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None):
* if args is None: args = ()
* if kargs is None: kargs = {} # <<<<<<<<<<<<<<
* context = (operator, args, kargs)
* self.set_attr("__patch_compute_operator_interior_facets__", context)
*/
__pyx_t_2 = (__pyx_v_kargs == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 852, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3);
__pyx_t_3 = 0;
}
/* "petsc4py/PETSc/PC.pyx":853
* 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_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 853, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_operator);
__Pyx_GIVEREF(__pyx_v_operator);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_operator);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":854
* 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_3 = ((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_3)) __PYX_ERR(47, 854, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":855
* 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):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetComputeOperatorInteriorFacets(__pyx_v_self->pc, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperatorInteriorFacets, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 855, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":850
* CHKERR( PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, <void*>context) )
*
* def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":857
* CHKERR( PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, <void*>context) )
*
* def setPatchComputeFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_221setPatchComputeFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_220setPatchComputeFunction[] = "PC.setPatchComputeFunction(self, function, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_221setPatchComputeFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_function = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchComputeFunction") < 0)) __PYX_ERR(47, 857, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_function = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPatchComputeFunction", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 857, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_220setPatchComputeFunction(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_220setPatchComputeFunction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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("setPatchComputeFunction", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/PC.pyx":858
*
* def setPatchComputeFunction(self, function, args=None, kargs=None):
* if args is None: args = () # <<<<<<<<<<<<<<
* if kargs is None: kargs = {}
* context = (function, args, kargs)
*/
__pyx_t_1 = (__pyx_v_args == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/PC.pyx":859
* def setPatchComputeFunction(self, function, args=None, kargs=None):
* if args is None: args = ()
* if kargs is None: kargs = {} # <<<<<<<<<<<<<<
* context = (function, args, kargs)
* self.set_attr("__patch_compute_function__", context)
*/
__pyx_t_2 = (__pyx_v_kargs == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 859, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3);
__pyx_t_3 = 0;
}
/* "petsc4py/PETSc/PC.pyx":860
* 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_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 860, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_function);
__Pyx_GIVEREF(__pyx_v_function);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_function);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":861
* 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_3 = ((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_3)) __PYX_ERR(47, 861, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":862
* 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):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetComputeFunction(__pyx_v_self->pc, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunction, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 862, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":857
* CHKERR( PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, <void*>context) )
*
* def setPatchComputeFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":864
* CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, <void*>context) )
*
* def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_223setPatchComputeFunctionInteriorFacets(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_222setPatchComputeFunctionInteriorFacets[] = "PC.setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_223setPatchComputeFunctionInteriorFacets(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_function = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchComputeFunctionInteriorFacets") < 0)) __PYX_ERR(47, 864, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_function = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPatchComputeFunctionInteriorFacets", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 864, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeFunctionInteriorFacets", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_222setPatchComputeFunctionInteriorFacets(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_222setPatchComputeFunctionInteriorFacets(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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("setPatchComputeFunctionInteriorFacets", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/PC.pyx":865
*
* def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None):
* if args is None: args = () # <<<<<<<<<<<<<<
* if kargs is None: kargs = {}
* context = (function, args, kargs)
*/
__pyx_t_1 = (__pyx_v_args == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/PC.pyx":866
* def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None):
* if args is None: args = ()
* if kargs is None: kargs = {} # <<<<<<<<<<<<<<
* context = (function, args, kargs)
* self.set_attr("__patch_compute_function_interior_facets__", context)
*/
__pyx_t_2 = (__pyx_v_kargs == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 866, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3);
__pyx_t_3 = 0;
}
/* "petsc4py/PETSc/PC.pyx":867
* 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_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 867, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_function);
__Pyx_GIVEREF(__pyx_v_function);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_function);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":868
* 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_3 = ((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_3)) __PYX_ERR(47, 868, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":869
* 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):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetComputeFunction(__pyx_v_self->pc, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunctionInteriorFacets, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 869, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":864
* CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, <void*>context) )
*
* def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":871
* CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, <void*>context) )
*
* def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_225setPatchConstructType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_224setPatchConstructType[] = "PC.setPatchConstructType(self, typ, operator=None, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_225setPatchConstructType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_typ = 0;
PyObject *__pyx_v_operator = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typ,&__pyx_n_s_operator,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[4] = {0,0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typ)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_operator);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchConstructType") < 0)) __PYX_ERR(47, 871, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_typ = values[0];
__pyx_v_operator = values[1];
__pyx_v_args = values[2];
__pyx_v_kargs = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPatchConstructType", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 871, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchConstructType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_224setPatchConstructType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_typ, __pyx_v_operator, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_224setPatchConstructType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PCPatchConstructType __pyx_t_7;
PetscErrorCode __pyx_t_8;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setPatchConstructType", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/PC.pyx":872
*
* def setPatchConstructType(self, typ, operator=None, args=None, kargs=None):
* if args is None: args = () # <<<<<<<<<<<<<<
* if kargs is None: kargs = {}
*
*/
__pyx_t_1 = (__pyx_v_args == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/PC.pyx":873
* def setPatchConstructType(self, typ, operator=None, args=None, kargs=None):
* if args is None: args = ()
* if kargs is None: kargs = {} # <<<<<<<<<<<<<<
*
* if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None:
*/
__pyx_t_2 = (__pyx_v_kargs == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 873, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3);
__pyx_t_3 = 0;
}
/* "petsc4py/PETSc/PC.pyx":875
* 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_3 = __pyx_v_typ;
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_n_s_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 875, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PYTHON); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 875, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 875, __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(47, 875, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!__pyx_t_6) {
} else {
__pyx_t_2 = __pyx_t_6;
goto __pyx_L8_bool_binop_done;
}
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_n_s_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 875, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_USER); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 875, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 875, __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(47, 875, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_2 = __pyx_t_6;
__pyx_L8_bool_binop_done:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = (__pyx_t_2 != 0);
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_2 = (__pyx_t_6 != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L6_bool_binop_done:;
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/PC.pyx":876
*
* 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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 876, __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(47, 876, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":875
* 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":877
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/PC.pyx":878
* raise ValueError("Must provide operator for USER or PYTHON type")
* if operator is not None:
* context = (operator, args, kargs) # <<<<<<<<<<<<<<
* else:
* context = None
*/
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 878, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_operator);
__Pyx_GIVEREF(__pyx_v_operator);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_operator);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":877
* 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":880
* 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":881
* else:
* context = None
* self.set_attr("__patch_construction_operator__", context) # <<<<<<<<<<<<<<
* CHKERR( PCPatchSetConstructType(self.pc, typ, PCPatch_UserConstructOperator, <void*>context) )
*
*/
__pyx_t_3 = ((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_3)) __PYX_ERR(47, 881, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/PC.pyx":882
* context = None
* self.set_attr("__patch_construction_operator__", context)
* CHKERR( PCPatchSetConstructType(self.pc, typ, PCPatch_UserConstructOperator, <void*>context) ) # <<<<<<<<<<<<<<
*
* # --- HPDDM ---
*/
__pyx_t_7 = ((PCPatchConstructType)__Pyx_PyInt_As_PCPatchConstructType(__pyx_v_typ)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 882, __pyx_L1_error)
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetConstructType(__pyx_v_self->pc, __pyx_t_7, __pyx_f_8petsc4py_5PETSc_PCPatch_UserConstructOperator, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 882, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":871
* CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, <void*>context) )
*
* def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":886
* # --- HPDDM ---
*
* def setHPDDMAuxiliaryMat(self, IS uis, Mat uaux): # <<<<<<<<<<<<<<
* CHKERR( PCHPDDMSetAuxiliaryMat(self.pc, uis.iset, uaux.mat, NULL, <void*>NULL) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_227setHPDDMAuxiliaryMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_226setHPDDMAuxiliaryMat[] = "PC.setHPDDMAuxiliaryMat(self, IS uis, Mat uaux)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_227setHPDDMAuxiliaryMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_uis = 0;
struct PyPetscMatObject *__pyx_v_uaux = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_uis,&__pyx_n_s_uaux,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_uis)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_uaux)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setHPDDMAuxiliaryMat", 1, 2, 2, 1); __PYX_ERR(47, 886, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHPDDMAuxiliaryMat") < 0)) __PYX_ERR(47, 886, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_uis = ((struct PyPetscISObject *)values[0]);
__pyx_v_uaux = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setHPDDMAuxiliaryMat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 886, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setHPDDMAuxiliaryMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uis), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "uis", 0))) __PYX_ERR(47, 886, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uaux), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "uaux", 0))) __PYX_ERR(47, 886, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_226setHPDDMAuxiliaryMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_uis, __pyx_v_uaux);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_226setHPDDMAuxiliaryMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_uis, struct PyPetscMatObject *__pyx_v_uaux) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setHPDDMAuxiliaryMat", 0);
/* "petsc4py/PETSc/PC.pyx":887
*
* def setHPDDMAuxiliaryMat(self, IS uis, Mat uaux):
* CHKERR( PCHPDDMSetAuxiliaryMat(self.pc, uis.iset, uaux.mat, NULL, <void*>NULL) ) # <<<<<<<<<<<<<<
*
* def setHPDDMRHSMat(self, Mat B):
*/
__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(47, 887, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":886
* # --- HPDDM ---
*
* def setHPDDMAuxiliaryMat(self, IS uis, Mat uaux): # <<<<<<<<<<<<<<
* CHKERR( PCHPDDMSetAuxiliaryMat(self.pc, uis.iset, uaux.mat, NULL, <void*>NULL) )
*
*/
/* 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":889
* CHKERR( PCHPDDMSetAuxiliaryMat(self.pc, uis.iset, uaux.mat, NULL, <void*>NULL) )
*
* def setHPDDMRHSMat(self, Mat B): # <<<<<<<<<<<<<<
* CHKERR( PCHPDDMSetRHSMat(self.pc, B.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_229setHPDDMRHSMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_228setHPDDMRHSMat[] = "PC.setHPDDMRHSMat(self, Mat B)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_229setHPDDMRHSMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_B = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_B,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHPDDMRHSMat") < 0)) __PYX_ERR(47, 889, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_B = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setHPDDMRHSMat", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 889, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setHPDDMRHSMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_B), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(47, 889, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_228setHPDDMRHSMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_B);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_228setHPDDMRHSMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setHPDDMRHSMat", 0);
/* "petsc4py/PETSc/PC.pyx":890
*
* def setHPDDMRHSMat(self, Mat B):
* CHKERR( PCHPDDMSetRHSMat(self.pc, B.mat) ) # <<<<<<<<<<<<<<
*
* def setHPDDMHasNeumannMat(self, has):
*/
__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(47, 890, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":889
* CHKERR( PCHPDDMSetAuxiliaryMat(self.pc, uis.iset, uaux.mat, NULL, <void*>NULL) )
*
* def setHPDDMRHSMat(self, Mat B): # <<<<<<<<<<<<<<
* CHKERR( PCHPDDMSetRHSMat(self.pc, B.mat) )
*
*/
/* 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":892
* CHKERR( PCHPDDMSetRHSMat(self.pc, B.mat) )
*
* def setHPDDMHasNeumannMat(self, has): # <<<<<<<<<<<<<<
* cdef PetscBool phas = has
* CHKERR( PCHPDDMHasNeumannMat(self.pc, phas) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_231setHPDDMHasNeumannMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_230setHPDDMHasNeumannMat[] = "PC.setHPDDMHasNeumannMat(self, has)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_231setHPDDMHasNeumannMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_has = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_has,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_has)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHPDDMHasNeumannMat") < 0)) __PYX_ERR(47, 892, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_has = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setHPDDMHasNeumannMat", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 892, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setHPDDMHasNeumannMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_230setHPDDMHasNeumannMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_has);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_230setHPDDMHasNeumannMat(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_has) {
PetscBool __pyx_v_phas;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscBool __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setHPDDMHasNeumannMat", 0);
/* "petsc4py/PETSc/PC.pyx":893
*
* def setHPDDMHasNeumannMat(self, has):
* cdef PetscBool phas = has # <<<<<<<<<<<<<<
* CHKERR( PCHPDDMHasNeumannMat(self.pc, phas) )
*
*/
__pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_has)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 893, __pyx_L1_error)
__pyx_v_phas = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":894
* def setHPDDMHasNeumannMat(self, has):
* cdef PetscBool phas = has
* CHKERR( PCHPDDMHasNeumannMat(self.pc, phas) ) # <<<<<<<<<<<<<<
*
* def setHPDDMCoarseCorrectionType(self, correction_type):
*/
__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(47, 894, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":892
* CHKERR( PCHPDDMSetRHSMat(self.pc, B.mat) )
*
* def setHPDDMHasNeumannMat(self, has): # <<<<<<<<<<<<<<
* cdef PetscBool phas = has
* CHKERR( PCHPDDMHasNeumannMat(self.pc, phas) )
*/
/* 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":896
* CHKERR( PCHPDDMHasNeumannMat(self.pc, phas) )
*
* def setHPDDMCoarseCorrectionType(self, correction_type): # <<<<<<<<<<<<<<
* cdef PetscPCHPDDMCoarseCorrectionType ctype = correction_type
* CHKERR( PCHPDDMSetCoarseCorrectionType(self.pc, ctype) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_233setHPDDMCoarseCorrectionType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_232setHPDDMCoarseCorrectionType[] = "PC.setHPDDMCoarseCorrectionType(self, correction_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_233setHPDDMCoarseCorrectionType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_correction_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_correction_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_correction_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHPDDMCoarseCorrectionType") < 0)) __PYX_ERR(47, 896, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_correction_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setHPDDMCoarseCorrectionType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 896, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setHPDDMCoarseCorrectionType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_232setHPDDMCoarseCorrectionType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_correction_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_232setHPDDMCoarseCorrectionType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_correction_type) {
PCHPDDMCoarseCorrectionType __pyx_v_ctype;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PCHPDDMCoarseCorrectionType __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setHPDDMCoarseCorrectionType", 0);
/* "petsc4py/PETSc/PC.pyx":897
*
* def setHPDDMCoarseCorrectionType(self, correction_type):
* cdef PetscPCHPDDMCoarseCorrectionType ctype = correction_type # <<<<<<<<<<<<<<
* CHKERR( PCHPDDMSetCoarseCorrectionType(self.pc, ctype) )
*
*/
__pyx_t_1 = ((PCHPDDMCoarseCorrectionType)__Pyx_PyInt_As_PCHPDDMCoarseCorrectionType(__pyx_v_correction_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 897, __pyx_L1_error)
__pyx_v_ctype = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":898
* def setHPDDMCoarseCorrectionType(self, correction_type):
* cdef PetscPCHPDDMCoarseCorrectionType ctype = correction_type
* CHKERR( PCHPDDMSetCoarseCorrectionType(self.pc, ctype) ) # <<<<<<<<<<<<<<
*
* def getHPDDMCoarseCorrectionType(self):
*/
__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(47, 898, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":896
* CHKERR( PCHPDDMHasNeumannMat(self.pc, phas) )
*
* def setHPDDMCoarseCorrectionType(self, correction_type): # <<<<<<<<<<<<<<
* cdef PetscPCHPDDMCoarseCorrectionType ctype = correction_type
* CHKERR( PCHPDDMSetCoarseCorrectionType(self.pc, ctype) )
*/
/* 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":900
* CHKERR( PCHPDDMSetCoarseCorrectionType(self.pc, ctype) )
*
* def getHPDDMCoarseCorrectionType(self): # <<<<<<<<<<<<<<
* cdef PetscPCHPDDMCoarseCorrectionType cval = PC_HPDDM_COARSE_CORRECTION_DEFLATED
* CHKERR( PCHPDDMGetCoarseCorrectionType(self.pc, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_235getHPDDMCoarseCorrectionType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_234getHPDDMCoarseCorrectionType[] = "PC.getHPDDMCoarseCorrectionType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_235getHPDDMCoarseCorrectionType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getHPDDMCoarseCorrectionType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getHPDDMCoarseCorrectionType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getHPDDMCoarseCorrectionType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_234getHPDDMCoarseCorrectionType(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_234getHPDDMCoarseCorrectionType(struct PyPetscPCObject *__pyx_v_self) {
PCHPDDMCoarseCorrectionType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getHPDDMCoarseCorrectionType", 0);
/* "petsc4py/PETSc/PC.pyx":901
*
* def getHPDDMCoarseCorrectionType(self):
* 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":902
* def getHPDDMCoarseCorrectionType(self):
* 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(47, 902, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":903
* cdef PetscPCHPDDMCoarseCorrectionType cval = PC_HPDDM_COARSE_CORRECTION_DEFLATED
* CHKERR( PCHPDDMGetCoarseCorrectionType(self.pc, &cval) )
* return cval # <<<<<<<<<<<<<<
*
* def getHPDDMSTShareSubKSP(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_PCHPDDMCoarseCorrectionType(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 903, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":900
* CHKERR( PCHPDDMSetCoarseCorrectionType(self.pc, ctype) )
*
* def getHPDDMCoarseCorrectionType(self): # <<<<<<<<<<<<<<
* cdef PetscPCHPDDMCoarseCorrectionType cval = PC_HPDDM_COARSE_CORRECTION_DEFLATED
* CHKERR( PCHPDDMGetCoarseCorrectionType(self.pc, &cval) )
*/
/* 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":905
* return cval
*
* def getHPDDMSTShareSubKSP(self): # <<<<<<<<<<<<<<
* cdef PetscBool cval = PETSC_FALSE
* CHKERR( PCHPDDMGetSTShareSubKSP(self.pc, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_237getHPDDMSTShareSubKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_236getHPDDMSTShareSubKSP[] = "PC.getHPDDMSTShareSubKSP(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_237getHPDDMSTShareSubKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getHPDDMSTShareSubKSP (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getHPDDMSTShareSubKSP", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getHPDDMSTShareSubKSP", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_236getHPDDMSTShareSubKSP(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_236getHPDDMSTShareSubKSP(struct PyPetscPCObject *__pyx_v_self) {
PetscBool __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getHPDDMSTShareSubKSP", 0);
/* "petsc4py/PETSc/PC.pyx":906
*
* def getHPDDMSTShareSubKSP(self):
* cdef PetscBool cval = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( PCHPDDMGetSTShareSubKSP(self.pc, &cval) )
* return toBool(cval)
*/
__pyx_v_cval = PETSC_FALSE;
/* "petsc4py/PETSc/PC.pyx":907
* def getHPDDMSTShareSubKSP(self):
* 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(47, 907, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":908
* cdef PetscBool cval = PETSC_FALSE
* CHKERR( PCHPDDMGetSTShareSubKSP(self.pc, &cval) )
* return toBool(cval) # <<<<<<<<<<<<<<
*
* def setHPDDMDeflationMat(self, IS uis, Mat U):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 908, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":905
* return cval
*
* def getHPDDMSTShareSubKSP(self): # <<<<<<<<<<<<<<
* cdef PetscBool cval = PETSC_FALSE
* CHKERR( PCHPDDMGetSTShareSubKSP(self.pc, &cval) )
*/
/* 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":910
* return toBool(cval)
*
* def setHPDDMDeflationMat(self, IS uis, Mat U): # <<<<<<<<<<<<<<
* CHKERR( PCHPDDMSetDeflationMat(self.pc, uis.iset, U.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_239setHPDDMDeflationMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_238setHPDDMDeflationMat[] = "PC.setHPDDMDeflationMat(self, IS uis, Mat U)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_239setHPDDMDeflationMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscISObject *__pyx_v_uis = 0;
struct PyPetscMatObject *__pyx_v_U = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_uis,&__pyx_n_s_U,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_uis)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setHPDDMDeflationMat", 1, 2, 2, 1); __PYX_ERR(47, 910, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHPDDMDeflationMat") < 0)) __PYX_ERR(47, 910, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_uis = ((struct PyPetscISObject *)values[0]);
__pyx_v_U = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setHPDDMDeflationMat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 910, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setHPDDMDeflationMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uis), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "uis", 0))) __PYX_ERR(47, 910, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_U), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "U", 0))) __PYX_ERR(47, 910, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_238setHPDDMDeflationMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_uis, __pyx_v_U);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_238setHPDDMDeflationMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_uis, struct PyPetscMatObject *__pyx_v_U) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setHPDDMDeflationMat", 0);
/* "petsc4py/PETSc/PC.pyx":911
*
* def setHPDDMDeflationMat(self, IS uis, Mat U):
* 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(47, 911, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":910
* return toBool(cval)
*
* def setHPDDMDeflationMat(self, IS uis, Mat U): # <<<<<<<<<<<<<<
* CHKERR( PCHPDDMSetDeflationMat(self.pc, uis.iset, U.mat) )
*
*/
/* 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":915
* # --- SPAI ---
*
* def setSPAIEpsilon(self, val): # <<<<<<<<<<<<<<
* cdef PetscReal cval = asReal(val)
* CHKERR( PCSPAISetEpsilon(self.pc, cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_241setSPAIEpsilon(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_240setSPAIEpsilon[] = "PC.setSPAIEpsilon(self, val)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_241setSPAIEpsilon(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_val = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_val,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSPAIEpsilon") < 0)) __PYX_ERR(47, 915, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_val = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setSPAIEpsilon", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 915, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAIEpsilon", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_240setSPAIEpsilon(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_val);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_240setSPAIEpsilon(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_val) {
PetscReal __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscReal __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setSPAIEpsilon", 0);
/* "petsc4py/PETSc/PC.pyx":916
*
* def setSPAIEpsilon(self, val):
* 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(47, 916, __pyx_L1_error)
__pyx_v_cval = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":917
* def setSPAIEpsilon(self, val):
* cdef PetscReal cval = asReal(val)
* CHKERR( PCSPAISetEpsilon(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def setSPAINBSteps(self, nbsteps):
*/
__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(47, 917, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":915
* # --- SPAI ---
*
* def setSPAIEpsilon(self, val): # <<<<<<<<<<<<<<
* cdef PetscReal cval = asReal(val)
* CHKERR( PCSPAISetEpsilon(self.pc, cval) )
*/
/* 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":919
* CHKERR( PCSPAISetEpsilon(self.pc, cval) )
*
* def setSPAINBSteps(self, nbsteps): # <<<<<<<<<<<<<<
* cdef PetscInt cval = asInt(nbsteps)
* CHKERR( PCSPAISetNBSteps(self.pc, cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_243setSPAINBSteps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_242setSPAINBSteps[] = "PC.setSPAINBSteps(self, nbsteps)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_243setSPAINBSteps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_nbsteps = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nbsteps,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbsteps)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSPAINBSteps") < 0)) __PYX_ERR(47, 919, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_nbsteps = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setSPAINBSteps", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 919, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAINBSteps", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_242setSPAINBSteps(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_nbsteps);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_242setSPAINBSteps(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nbsteps) {
PetscInt __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setSPAINBSteps", 0);
/* "petsc4py/PETSc/PC.pyx":920
*
* def setSPAINBSteps(self, nbsteps):
* 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(47, 920, __pyx_L1_error)
__pyx_v_cval = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":921
* def setSPAINBSteps(self, nbsteps):
* cdef PetscInt cval = asInt(nbsteps)
* CHKERR( PCSPAISetNBSteps(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def setSPAIMax(self, maxval):
*/
__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(47, 921, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":919
* CHKERR( PCSPAISetEpsilon(self.pc, cval) )
*
* def setSPAINBSteps(self, nbsteps): # <<<<<<<<<<<<<<
* cdef PetscInt cval = asInt(nbsteps)
* CHKERR( PCSPAISetNBSteps(self.pc, cval) )
*/
/* 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":923
* CHKERR( PCSPAISetNBSteps(self.pc, cval) )
*
* def setSPAIMax(self, maxval): # <<<<<<<<<<<<<<
* cdef PetscInt cval = asInt(maxval)
* CHKERR( PCSPAISetMax(self.pc, cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_245setSPAIMax(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_244setSPAIMax[] = "PC.setSPAIMax(self, maxval)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_245setSPAIMax(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_maxval = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxval,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxval)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSPAIMax") < 0)) __PYX_ERR(47, 923, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_maxval = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setSPAIMax", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 923, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAIMax", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_244setSPAIMax(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_maxval);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_244setSPAIMax(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_maxval) {
PetscInt __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setSPAIMax", 0);
/* "petsc4py/PETSc/PC.pyx":924
*
* def setSPAIMax(self, maxval):
* 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(47, 924, __pyx_L1_error)
__pyx_v_cval = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":925
* def setSPAIMax(self, maxval):
* cdef PetscInt cval = asInt(maxval)
* CHKERR( PCSPAISetMax(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def setSPAIMaxNew(self, maxval):
*/
__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(47, 925, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":923
* CHKERR( PCSPAISetNBSteps(self.pc, cval) )
*
* def setSPAIMax(self, maxval): # <<<<<<<<<<<<<<
* cdef PetscInt cval = asInt(maxval)
* CHKERR( PCSPAISetMax(self.pc, cval) )
*/
/* 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":927
* CHKERR( PCSPAISetMax(self.pc, cval) )
*
* def setSPAIMaxNew(self, maxval): # <<<<<<<<<<<<<<
* cdef PetscInt cval = asInt(maxval)
* CHKERR( PCSPAISetMaxNew(self.pc, cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_247setSPAIMaxNew(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_246setSPAIMaxNew[] = "PC.setSPAIMaxNew(self, maxval)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_247setSPAIMaxNew(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_maxval = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxval,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxval)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSPAIMaxNew") < 0)) __PYX_ERR(47, 927, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_maxval = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setSPAIMaxNew", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 927, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAIMaxNew", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_246setSPAIMaxNew(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_maxval);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_246setSPAIMaxNew(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_maxval) {
PetscInt __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setSPAIMaxNew", 0);
/* "petsc4py/PETSc/PC.pyx":928
*
* def setSPAIMaxNew(self, maxval):
* 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(47, 928, __pyx_L1_error)
__pyx_v_cval = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":929
* def setSPAIMaxNew(self, maxval):
* cdef PetscInt cval = asInt(maxval)
* CHKERR( PCSPAISetMaxNew(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def setSPAIBlockSize(self, n):
*/
__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(47, 929, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":927
* CHKERR( PCSPAISetMax(self.pc, cval) )
*
* def setSPAIMaxNew(self, maxval): # <<<<<<<<<<<<<<
* cdef PetscInt cval = asInt(maxval)
* CHKERR( PCSPAISetMaxNew(self.pc, cval) )
*/
/* 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":931
* CHKERR( PCSPAISetMaxNew(self.pc, cval) )
*
* def setSPAIBlockSize(self, n): # <<<<<<<<<<<<<<
* cdef PetscInt cval = asInt(n)
* CHKERR( PCSPAISetBlockSize(self.pc, cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_249setSPAIBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_248setSPAIBlockSize[] = "PC.setSPAIBlockSize(self, n)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_249setSPAIBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_n = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSPAIBlockSize") < 0)) __PYX_ERR(47, 931, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_n = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setSPAIBlockSize", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 931, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAIBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_248setSPAIBlockSize(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_n);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_248setSPAIBlockSize(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_n) {
PetscInt __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setSPAIBlockSize", 0);
/* "petsc4py/PETSc/PC.pyx":932
*
* def setSPAIBlockSize(self, n):
* 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(47, 932, __pyx_L1_error)
__pyx_v_cval = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":933
* def setSPAIBlockSize(self, n):
* cdef PetscInt cval = asInt(n)
* CHKERR( PCSPAISetBlockSize(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def setSPAICacheSize(self, size):
*/
__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(47, 933, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":931
* CHKERR( PCSPAISetMaxNew(self.pc, cval) )
*
* def setSPAIBlockSize(self, n): # <<<<<<<<<<<<<<
* cdef PetscInt cval = asInt(n)
* CHKERR( PCSPAISetBlockSize(self.pc, cval) )
*/
/* 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":935
* CHKERR( PCSPAISetBlockSize(self.pc, cval) )
*
* def setSPAICacheSize(self, size): # <<<<<<<<<<<<<<
* cdef PetscInt cval = asInt(size)
* CHKERR( PCSPAISetCacheSize(self.pc, cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_251setSPAICacheSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_250setSPAICacheSize[] = "PC.setSPAICacheSize(self, size)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_251setSPAICacheSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_size = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSPAICacheSize") < 0)) __PYX_ERR(47, 935, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_size = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setSPAICacheSize", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 935, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAICacheSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_250setSPAICacheSize(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_size);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_250setSPAICacheSize(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_size) {
PetscInt __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setSPAICacheSize", 0);
/* "petsc4py/PETSc/PC.pyx":936
*
* def setSPAICacheSize(self, size):
* 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(47, 936, __pyx_L1_error)
__pyx_v_cval = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":937
* def setSPAICacheSize(self, size):
* cdef PetscInt cval = asInt(size)
* CHKERR( PCSPAISetCacheSize(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def setSPAIVerbose(self, level):
*/
__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(47, 937, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":935
* CHKERR( PCSPAISetBlockSize(self.pc, cval) )
*
* def setSPAICacheSize(self, size): # <<<<<<<<<<<<<<
* cdef PetscInt cval = asInt(size)
* CHKERR( PCSPAISetCacheSize(self.pc, cval) )
*/
/* 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":939
* CHKERR( PCSPAISetCacheSize(self.pc, cval) )
*
* def setSPAIVerbose(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt cval = asInt(level)
* CHKERR( PCSPAISetVerbose(self.pc, cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_253setSPAIVerbose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_252setSPAIVerbose[] = "PC.setSPAIVerbose(self, level)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_253setSPAIVerbose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSPAIVerbose") < 0)) __PYX_ERR(47, 939, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_level = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setSPAIVerbose", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 939, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAIVerbose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_252setSPAIVerbose(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_252setSPAIVerbose(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) {
PetscInt __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setSPAIVerbose", 0);
/* "petsc4py/PETSc/PC.pyx":940
*
* def setSPAIVerbose(self, level):
* 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(47, 940, __pyx_L1_error)
__pyx_v_cval = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":941
* def setSPAIVerbose(self, level):
* cdef PetscInt cval = asInt(level)
* CHKERR( PCSPAISetVerbose(self.pc, cval) ) # <<<<<<<<<<<<<<
*
* def setSPAISp(self, sym):
*/
__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(47, 941, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":939
* CHKERR( PCSPAISetCacheSize(self.pc, cval) )
*
* def setSPAIVerbose(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt cval = asInt(level)
* CHKERR( PCSPAISetVerbose(self.pc, cval) )
*/
/* 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":943
* CHKERR( PCSPAISetVerbose(self.pc, cval) )
*
* def setSPAISp(self, sym): # <<<<<<<<<<<<<<
* cdef PetscInt cval = asInt(sym)
* CHKERR( PCSPAISetSp(self.pc, cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_255setSPAISp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_254setSPAISp[] = "PC.setSPAISp(self, sym)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_255setSPAISp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_sym = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sym,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sym)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSPAISp") < 0)) __PYX_ERR(47, 943, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_sym = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setSPAISp", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 943, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setSPAISp", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_254setSPAISp(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_sym);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_254setSPAISp(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_sym) {
PetscInt __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setSPAISp", 0);
/* "petsc4py/PETSc/PC.pyx":944
*
* def setSPAISp(self, sym):
* 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(47, 944, __pyx_L1_error)
__pyx_v_cval = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":945
* def setSPAISp(self, sym):
* 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(47, 945, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":943
* CHKERR( PCSPAISetVerbose(self.pc, cval) )
*
* def setSPAISp(self, sym): # <<<<<<<<<<<<<<
* cdef PetscInt cval = asInt(sym)
* CHKERR( PCSPAISetSp(self.pc, cval) )
*/
/* 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":949
* # --- DEFLATION ---
*
* def setDeflationInitOnly(self, flg): # <<<<<<<<<<<<<<
* cdef PetscBool cflg = asBool(flg)
* CHKERR( PCDeflationSetInitOnly(self.pc, cflg) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_257setDeflationInitOnly(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_256setDeflationInitOnly[] = "PC.setDeflationInitOnly(self, flg)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_257setDeflationInitOnly(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flg = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flg,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flg)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDeflationInitOnly") < 0)) __PYX_ERR(47, 949, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flg = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDeflationInitOnly", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 949, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationInitOnly", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_256setDeflationInitOnly(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_flg);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_256setDeflationInitOnly(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_flg) {
PetscBool __pyx_v_cflg;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscBool __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setDeflationInitOnly", 0);
/* "petsc4py/PETSc/PC.pyx":950
*
* def setDeflationInitOnly(self, flg):
* 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(47, 950, __pyx_L1_error)
__pyx_v_cflg = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":951
* def setDeflationInitOnly(self, flg):
* cdef PetscBool cflg = asBool(flg)
* CHKERR( PCDeflationSetInitOnly(self.pc, cflg) ) # <<<<<<<<<<<<<<
*
* def setDeflationLevels(self, levels):
*/
__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(47, 951, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":949
* # --- DEFLATION ---
*
* def setDeflationInitOnly(self, flg): # <<<<<<<<<<<<<<
* cdef PetscBool cflg = asBool(flg)
* CHKERR( PCDeflationSetInitOnly(self.pc, cflg) )
*/
/* 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":953
* CHKERR( PCDeflationSetInitOnly(self.pc, cflg) )
*
* def setDeflationLevels(self, levels): # <<<<<<<<<<<<<<
* cdef PetscInt clevels = asInt(levels)
* CHKERR( PCDeflationSetLevels(self.pc, clevels) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_259setDeflationLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_258setDeflationLevels[] = "PC.setDeflationLevels(self, levels)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_259setDeflationLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_levels = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDeflationLevels") < 0)) __PYX_ERR(47, 953, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_levels = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDeflationLevels", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 953, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationLevels", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_258setDeflationLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_258setDeflationLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels) {
PetscInt __pyx_v_clevels;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setDeflationLevels", 0);
/* "petsc4py/PETSc/PC.pyx":954
*
* def setDeflationLevels(self, levels):
* 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(47, 954, __pyx_L1_error)
__pyx_v_clevels = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":955
* def setDeflationLevels(self, levels):
* cdef PetscInt clevels = asInt(levels)
* CHKERR( PCDeflationSetLevels(self.pc, clevels) ) # <<<<<<<<<<<<<<
*
* def setDeflationReductionFactor(self, red):
*/
__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(47, 955, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":953
* CHKERR( PCDeflationSetInitOnly(self.pc, cflg) )
*
* def setDeflationLevels(self, levels): # <<<<<<<<<<<<<<
* cdef PetscInt clevels = asInt(levels)
* CHKERR( PCDeflationSetLevels(self.pc, clevels) )
*/
/* 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":957
* CHKERR( PCDeflationSetLevels(self.pc, clevels) )
*
* def setDeflationReductionFactor(self, red): # <<<<<<<<<<<<<<
* cdef PetscInt cred = asInt(red)
* CHKERR( PCDeflationSetReductionFactor(self.pc, cred) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_261setDeflationReductionFactor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_260setDeflationReductionFactor[] = "PC.setDeflationReductionFactor(self, red)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_261setDeflationReductionFactor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_red = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_red,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDeflationReductionFactor") < 0)) __PYX_ERR(47, 957, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_red = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDeflationReductionFactor", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 957, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationReductionFactor", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_260setDeflationReductionFactor(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_red);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_260setDeflationReductionFactor(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_red) {
PetscInt __pyx_v_cred;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setDeflationReductionFactor", 0);
/* "petsc4py/PETSc/PC.pyx":958
*
* def setDeflationReductionFactor(self, red):
* 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(47, 958, __pyx_L1_error)
__pyx_v_cred = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":959
* def setDeflationReductionFactor(self, red):
* cdef PetscInt cred = asInt(red)
* CHKERR( PCDeflationSetReductionFactor(self.pc, cred) ) # <<<<<<<<<<<<<<
*
* def setDeflationCorrectionFactor(self, fact):
*/
__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(47, 959, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":957
* CHKERR( PCDeflationSetLevels(self.pc, clevels) )
*
* def setDeflationReductionFactor(self, red): # <<<<<<<<<<<<<<
* cdef PetscInt cred = asInt(red)
* CHKERR( PCDeflationSetReductionFactor(self.pc, cred) )
*/
/* 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":961
* CHKERR( PCDeflationSetReductionFactor(self.pc, cred) )
*
* def setDeflationCorrectionFactor(self, fact): # <<<<<<<<<<<<<<
* cdef PetscScalar cfact = asScalar(fact)
* CHKERR( PCDeflationSetCorrectionFactor(self.pc, fact) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_263setDeflationCorrectionFactor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_262setDeflationCorrectionFactor[] = "PC.setDeflationCorrectionFactor(self, fact)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_263setDeflationCorrectionFactor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_fact = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fact,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fact)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDeflationCorrectionFactor") < 0)) __PYX_ERR(47, 961, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_fact = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDeflationCorrectionFactor", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 961, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationCorrectionFactor", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_262setDeflationCorrectionFactor(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_fact);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_262setDeflationCorrectionFactor(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_fact) {
CYTHON_UNUSED PetscScalar __pyx_v_cfact;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscScalar __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setDeflationCorrectionFactor", 0);
/* "petsc4py/PETSc/PC.pyx":962
*
* def setDeflationCorrectionFactor(self, fact):
* cdef PetscScalar cfact = asScalar(fact) # <<<<<<<<<<<<<<
* CHKERR( PCDeflationSetCorrectionFactor(self.pc, fact) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_fact); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(47, 962, __pyx_L1_error)
__pyx_v_cfact = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":963
* def setDeflationCorrectionFactor(self, fact):
* cdef PetscScalar cfact = asScalar(fact)
* CHKERR( PCDeflationSetCorrectionFactor(self.pc, fact) ) # <<<<<<<<<<<<<<
*
* def setDeflationSpaceToCompute(self, space_type, size):
*/
__pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_fact); if (unlikely((__pyx_t_1 == ((PetscScalar)-1)) && PyErr_Occurred())) __PYX_ERR(47, 963, __pyx_L1_error)
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationSetCorrectionFactor(__pyx_v_self->pc, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 963, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":961
* CHKERR( PCDeflationSetReductionFactor(self.pc, cred) )
*
* def setDeflationCorrectionFactor(self, fact): # <<<<<<<<<<<<<<
* cdef PetscScalar cfact = asScalar(fact)
* CHKERR( PCDeflationSetCorrectionFactor(self.pc, fact) )
*/
/* 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":965
* CHKERR( PCDeflationSetCorrectionFactor(self.pc, fact) )
*
* def setDeflationSpaceToCompute(self, space_type, size): # <<<<<<<<<<<<<<
* cdef PetscInt csize = asInt(size)
* cdef PetscPCDeflationSpaceType ctype = space_type
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_265setDeflationSpaceToCompute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_264setDeflationSpaceToCompute[] = "PC.setDeflationSpaceToCompute(self, space_type, size)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_265setDeflationSpaceToCompute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_space_type = 0;
PyObject *__pyx_v_size = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_space_type,&__pyx_n_s_size,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_space_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setDeflationSpaceToCompute", 1, 2, 2, 1); __PYX_ERR(47, 965, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDeflationSpaceToCompute") < 0)) __PYX_ERR(47, 965, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_space_type = values[0];
__pyx_v_size = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDeflationSpaceToCompute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 965, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationSpaceToCompute", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_264setDeflationSpaceToCompute(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_space_type, __pyx_v_size);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_264setDeflationSpaceToCompute(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_space_type, PyObject *__pyx_v_size) {
PetscInt __pyx_v_csize;
CYTHON_UNUSED PCDeflationSpaceType __pyx_v_ctype;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PCDeflationSpaceType __pyx_t_2;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setDeflationSpaceToCompute", 0);
/* "petsc4py/PETSc/PC.pyx":966
*
* def setDeflationSpaceToCompute(self, space_type, size):
* cdef PetscInt csize = asInt(size) # <<<<<<<<<<<<<<
* cdef PetscPCDeflationSpaceType ctype = space_type
* CHKERR( PCDeflationSetSpaceToCompute(self.pc, space_type, csize) )
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_size); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 966, __pyx_L1_error)
__pyx_v_csize = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":967
* def setDeflationSpaceToCompute(self, space_type, size):
* cdef PetscInt csize = asInt(size)
* cdef PetscPCDeflationSpaceType ctype = space_type # <<<<<<<<<<<<<<
* CHKERR( PCDeflationSetSpaceToCompute(self.pc, space_type, csize) )
*
*/
__pyx_t_2 = ((PCDeflationSpaceType)__Pyx_PyInt_As_PCDeflationSpaceType(__pyx_v_space_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 967, __pyx_L1_error)
__pyx_v_ctype = __pyx_t_2;
/* "petsc4py/PETSc/PC.pyx":968
* cdef PetscInt csize = asInt(size)
* cdef PetscPCDeflationSpaceType ctype = space_type
* CHKERR( PCDeflationSetSpaceToCompute(self.pc, space_type, csize) ) # <<<<<<<<<<<<<<
*
* def setDeflationSpace(self, Mat W, transpose):
*/
__pyx_t_2 = ((PCDeflationSpaceType)__Pyx_PyInt_As_PCDeflationSpaceType(__pyx_v_space_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 968, __pyx_L1_error)
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationSetSpaceToCompute(__pyx_v_self->pc, __pyx_t_2, __pyx_v_csize)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 968, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":965
* CHKERR( PCDeflationSetCorrectionFactor(self.pc, fact) )
*
* def setDeflationSpaceToCompute(self, space_type, size): # <<<<<<<<<<<<<<
* cdef PetscInt csize = asInt(size)
* cdef PetscPCDeflationSpaceType ctype = 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":970
* CHKERR( PCDeflationSetSpaceToCompute(self.pc, space_type, csize) )
*
* def setDeflationSpace(self, Mat W, transpose): # <<<<<<<<<<<<<<
* cdef PetscBool ctranspose = asBool(transpose)
* CHKERR( PCDeflationSetSpace(self.pc, W.mat, ctranspose) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_267setDeflationSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_266setDeflationSpace[] = "PC.setDeflationSpace(self, Mat W, transpose)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_267setDeflationSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_W = 0;
PyObject *__pyx_v_transpose = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_W,&__pyx_n_s_transpose,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_W)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transpose)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setDeflationSpace", 1, 2, 2, 1); __PYX_ERR(47, 970, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDeflationSpace") < 0)) __PYX_ERR(47, 970, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_W = ((struct PyPetscMatObject *)values[0]);
__pyx_v_transpose = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDeflationSpace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 970, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationSpace", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_W), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "W", 0))) __PYX_ERR(47, 970, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_266setDeflationSpace(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_W, __pyx_v_transpose);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_266setDeflationSpace(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_W, PyObject *__pyx_v_transpose) {
PetscBool __pyx_v_ctranspose;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscBool __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setDeflationSpace", 0);
/* "petsc4py/PETSc/PC.pyx":971
*
* def setDeflationSpace(self, Mat W, transpose):
* 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(47, 971, __pyx_L1_error)
__pyx_v_ctranspose = __pyx_t_1;
/* "petsc4py/PETSc/PC.pyx":972
* def setDeflationSpace(self, Mat W, transpose):
* cdef PetscBool ctranspose = asBool(transpose)
* CHKERR( PCDeflationSetSpace(self.pc, W.mat, ctranspose) ) # <<<<<<<<<<<<<<
*
* def setDeflationProjectionNullSpaceMat(self, Mat mat):
*/
__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(47, 972, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":970
* CHKERR( PCDeflationSetSpaceToCompute(self.pc, space_type, csize) )
*
* def setDeflationSpace(self, Mat W, transpose): # <<<<<<<<<<<<<<
* cdef PetscBool ctranspose = asBool(transpose)
* CHKERR( PCDeflationSetSpace(self.pc, W.mat, ctranspose) )
*/
/* 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":974
* CHKERR( PCDeflationSetSpace(self.pc, W.mat, ctranspose) )
*
* def setDeflationProjectionNullSpaceMat(self, Mat mat): # <<<<<<<<<<<<<<
* CHKERR( PCDeflationSetProjectionNullSpaceMat(self.pc, mat.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_269setDeflationProjectionNullSpaceMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_268setDeflationProjectionNullSpaceMat[] = "PC.setDeflationProjectionNullSpaceMat(self, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_269setDeflationProjectionNullSpaceMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDeflationProjectionNullSpaceMat") < 0)) __PYX_ERR(47, 974, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDeflationProjectionNullSpaceMat", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 974, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationProjectionNullSpaceMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(47, 974, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_268setDeflationProjectionNullSpaceMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_268setDeflationProjectionNullSpaceMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setDeflationProjectionNullSpaceMat", 0);
/* "petsc4py/PETSc/PC.pyx":975
*
* def setDeflationProjectionNullSpaceMat(self, Mat mat):
* CHKERR( PCDeflationSetProjectionNullSpaceMat(self.pc, mat.mat) ) # <<<<<<<<<<<<<<
*
* def setDeflationCoarseMat(self, Mat mat):
*/
__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(47, 975, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":974
* CHKERR( PCDeflationSetSpace(self.pc, W.mat, ctranspose) )
*
* def setDeflationProjectionNullSpaceMat(self, Mat mat): # <<<<<<<<<<<<<<
* CHKERR( PCDeflationSetProjectionNullSpaceMat(self.pc, mat.mat) )
*
*/
/* 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":977
* CHKERR( PCDeflationSetProjectionNullSpaceMat(self.pc, mat.mat) )
*
* def setDeflationCoarseMat(self, Mat mat): # <<<<<<<<<<<<<<
* CHKERR( PCDeflationSetCoarseMat(self.pc, mat.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_271setDeflationCoarseMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_270setDeflationCoarseMat[] = "PC.setDeflationCoarseMat(self, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_271setDeflationCoarseMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDeflationCoarseMat") < 0)) __PYX_ERR(47, 977, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDeflationCoarseMat", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 977, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.PC.setDeflationCoarseMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(47, 977, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_270setDeflationCoarseMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_270setDeflationCoarseMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setDeflationCoarseMat", 0);
/* "petsc4py/PETSc/PC.pyx":978
*
* def setDeflationCoarseMat(self, Mat mat):
* CHKERR( PCDeflationSetCoarseMat(self.pc, mat.mat) ) # <<<<<<<<<<<<<<
*
* def getDeflationCoarseKSP(self):
*/
__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(47, 978, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":977
* CHKERR( PCDeflationSetProjectionNullSpaceMat(self.pc, mat.mat) )
*
* def setDeflationCoarseMat(self, Mat mat): # <<<<<<<<<<<<<<
* CHKERR( PCDeflationSetCoarseMat(self.pc, mat.mat) )
*
*/
/* 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":980
* CHKERR( PCDeflationSetCoarseMat(self.pc, mat.mat) )
*
* def getDeflationCoarseKSP(self): # <<<<<<<<<<<<<<
* cdef KSP ksp = KSP()
* CHKERR( PCDeflationGetCoarseKSP(self.pc, &ksp.ksp) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_273getDeflationCoarseKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_272getDeflationCoarseKSP[] = "PC.getDeflationCoarseKSP(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_273getDeflationCoarseKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDeflationCoarseKSP (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDeflationCoarseKSP", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDeflationCoarseKSP", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_272getDeflationCoarseKSP(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_272getDeflationCoarseKSP(struct PyPetscPCObject *__pyx_v_self) {
struct PyPetscKSPObject *__pyx_v_ksp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDeflationCoarseKSP", 0);
/* "petsc4py/PETSc/PC.pyx":981
*
* def getDeflationCoarseKSP(self):
* cdef KSP ksp = KSP() # <<<<<<<<<<<<<<
* CHKERR( PCDeflationGetCoarseKSP(self.pc, &ksp.ksp) )
* PetscINCREF(ksp.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 981, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/PC.pyx":982
* def getDeflationCoarseKSP(self):
* cdef KSP ksp = KSP()
* CHKERR( PCDeflationGetCoarseKSP(self.pc, &ksp.ksp) ) # <<<<<<<<<<<<<<
* PetscINCREF(ksp.obj)
* return ksp
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationGetCoarseKSP(__pyx_v_self->pc, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 982, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":983
* cdef KSP ksp = KSP()
* CHKERR( PCDeflationGetCoarseKSP(self.pc, &ksp.ksp) )
* PetscINCREF(ksp.obj) # <<<<<<<<<<<<<<
* return ksp
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj));
/* "petsc4py/PETSc/PC.pyx":984
* CHKERR( PCDeflationGetCoarseKSP(self.pc, &ksp.ksp) )
* PetscINCREF(ksp.obj)
* return ksp # <<<<<<<<<<<<<<
*
* def getDeflationPC(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_ksp));
__pyx_r = ((PyObject *)__pyx_v_ksp);
goto __pyx_L0;
/* "petsc4py/PETSc/PC.pyx":980
* CHKERR( PCDeflationSetCoarseMat(self.pc, mat.mat) )
*
* def getDeflationCoarseKSP(self): # <<<<<<<<<<<<<<
* cdef KSP ksp = KSP()
* CHKERR( PCDeflationGetCoarseKSP(self.pc, &ksp.ksp) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.PC.getDeflationCoarseKSP", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ksp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/PC.pyx":986
* return ksp
*
* def getDeflationPC(self): # <<<<<<<<<<<<<<
* cdef PC apc = PC()
* CHKERR( PCDeflationGetPC(self.pc, &apc.pc) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_275getDeflationPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2PC_274getDeflationPC[] = "PC.getDeflationPC(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_275getDeflationPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDeflationPC (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDeflationPC", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDeflationPC", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_274getDeflationPC(((struct PyPetscPCObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_274getDeflationPC(struct PyPetscPCObject *__pyx_v_self) {
struct PyPetscPCObject *__pyx_v_apc = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDeflationPC", 0);
/* "petsc4py/PETSc/PC.pyx":987
*
* def getDeflationPC(self):
* cdef PC apc = PC() # <<<<<<<<<<<<<<
* CHKERR( PCDeflationGetPC(self.pc, &apc.pc) )
* PetscINCREF(apc.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 987, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_apc = ((struct PyPetscPCObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/PC.pyx":988
* def getDeflationPC(self):
* cdef PC apc = PC()
* CHKERR( PCDeflationGetPC(self.pc, &apc.pc) ) # <<<<<<<<<<<<<<
* PetscINCREF(apc.obj)
* return apc
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationGetPC(__pyx_v_self->pc, (&__pyx_v_apc->pc))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(47, 988, __pyx_L1_error)
/* "petsc4py/PETSc/PC.pyx":989
* cdef PC apc = PC()
* CHKERR( PCDeflationGetPC(self.pc, &apc.pc) )
* PetscINCREF(apc.obj) # <<<<<<<<<<<<<<
* return apc
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_apc->__pyx_base.obj));
/* "petsc4py/PETSc/PC.pyx":990
* CHKERR( PCDeflationGetPC(self.pc, &apc.pc) )
* 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":986
* return ksp
*
* def getDeflationPC(self): # <<<<<<<<<<<<<<
* cdef PC apc = PC()
* CHKERR( PCDeflationGetPC(self.pc, &apc.pc) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.PC.getDeflationPC", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_apc);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":102
* # --- 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP___cinit__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3KSP___cinit__(struct PyPetscKSPObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/KSP.pyx":103
*
* 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":104
* def __cinit__(self):
* self.obj = <PetscObject*> &self.ksp
* self.ksp = NULL # <<<<<<<<<<<<<<
*
* def __call__(self, b, x=None):
*/
__pyx_v_self->ksp = NULL;
/* "petsc4py/PETSc/KSP.pyx":102
* # --- xxx ---
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.ksp
* self.ksp = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":106
* self.ksp = NULL
*
* def __call__(self, b, x=None): # <<<<<<<<<<<<<<
* if x is None: # XXX do this better
* x = self.getOperators()[0].createVecLeft()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_b = 0;
PyObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(48, 106, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_b = values[0];
__pyx_v_x = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 106, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_2__call__(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2__call__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_b, PyObject *__pyx_v_x) {
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;
int __pyx_t_7;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__call__", 0);
__Pyx_INCREF(__pyx_v_x);
/* "petsc4py/PETSc/KSP.pyx":107
*
* def __call__(self, b, x=None):
* if x is None: # XXX do this better # <<<<<<<<<<<<<<
* x = self.getOperators()[0].createVecLeft()
* self.solve(b, x)
*/
__pyx_t_1 = (__pyx_v_x == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/KSP.pyx":108
* def __call__(self, b, x=None):
* if x is None: # XXX do this better
* x = self.getOperators()[0].createVecLeft() # <<<<<<<<<<<<<<
* self.solve(b, x)
* return x
*/
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOperators); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
__pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_createVecLeft); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
}
}
__pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/KSP.pyx":107
*
* def __call__(self, b, x=None):
* if x is None: # XXX do this better # <<<<<<<<<<<<<<
* x = self.getOperators()[0].createVecLeft()
* self.solve(b, x)
*/
}
/* "petsc4py/PETSc/KSP.pyx":109
* if x is None: # XXX do this better
* x = self.getOperators()[0].createVecLeft()
* self.solve(b, x) # <<<<<<<<<<<<<<
* return x
*
*/
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_solve); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
__pyx_t_7 = 0;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_7 = 1;
}
}
#if CYTHON_FAST_PYCALL
if (PyFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_b, __pyx_v_x};
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 109, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
#if CYTHON_FAST_PYCCALL
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_b, __pyx_v_x};
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 109, __pyx_L1_error)
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else
#endif
{
__pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
if (__pyx_t_5) {
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
}
__Pyx_INCREF(__pyx_v_b);
__Pyx_GIVEREF(__pyx_v_b);
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_b);
__Pyx_INCREF(__pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_x);
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/KSP.pyx":110
* x = self.getOperators()[0].createVecLeft()
* self.solve(b, x)
* return x # <<<<<<<<<<<<<<
*
* # --- xxx ---
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_x);
__pyx_r = __pyx_v_x;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":106
* self.ksp = NULL
*
* def __call__(self, b, x=None): # <<<<<<<<<<<<<<
* if x is None: # XXX do this better
* x = self.getOperators()[0].createVecLeft()
*/
/* 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.KSP.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_x);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":114
* # --- xxx ---
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_4view[] = "KSP.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(48, 114, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 114, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(48, 114, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4view(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/KSP.pyx":115
*
* def view(self, Viewer viewer=None):
* 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":116
* def view(self, Viewer viewer=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_vwr = __pyx_t_3;
}
/* "petsc4py/PETSc/KSP.pyx":117
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
* CHKERR( KSPView(self.ksp, vwr) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPView(__pyx_v_self->ksp, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 117, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":114
* # --- xxx ---
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer vwr = NULL
* if viewer is not None: vwr = viewer.vwr
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("petsc4py.PETSc.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":119
* CHKERR( KSPView(self.ksp, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( KSPDestroy(&self.ksp) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_6destroy[] = "KSP.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6destroy(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6destroy(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/KSP.pyx":120
*
* def destroy(self):
* 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(48, 120, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":121
* def destroy(self):
* CHKERR( KSPDestroy(&self.ksp) )
* return self # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":119
* CHKERR( KSPView(self.ksp, vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( KSPDestroy(&self.ksp) )
* return self
*/
/* 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":123
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscKSP newksp = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_8create[] = "KSP.create(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(48, 123, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 123, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":124
*
* def create(self, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(48, 124, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/KSP.pyx":125
* def create(self, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscKSP newksp = NULL # <<<<<<<<<<<<<<
* CHKERR( KSPCreate(ccomm, &newksp) )
* PetscCLEAR(self.obj); self.ksp = newksp
*/
__pyx_v_newksp = NULL;
/* "petsc4py/PETSc/KSP.pyx":126
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscKSP newksp = NULL
* CHKERR( KSPCreate(ccomm, &newksp) ) # <<<<<<<<<<<<<<
* 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(48, 126, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":127
* cdef PetscKSP newksp = NULL
* CHKERR( KSPCreate(ccomm, &newksp) )
* PetscCLEAR(self.obj); self.ksp = newksp # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->ksp = __pyx_v_newksp;
/* "petsc4py/PETSc/KSP.pyx":128
* CHKERR( KSPCreate(ccomm, &newksp) )
* PetscCLEAR(self.obj); self.ksp = newksp
* return self # <<<<<<<<<<<<<<
*
* def setType(self, ksp_type):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":123
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscKSP newksp = NULL
*/
/* 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":130
* return self
*
* def setType(self, ksp_type): # <<<<<<<<<<<<<<
* cdef PetscKSPType cval = NULL
* ksp_type = str2bytes(ksp_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_10setType[] = "KSP.setType(self, ksp_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ksp_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ksp_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ksp_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(48, 130, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_ksp_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 130, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":131
*
* def setType(self, ksp_type):
* cdef PetscKSPType cval = NULL # <<<<<<<<<<<<<<
* ksp_type = str2bytes(ksp_type, &cval)
* CHKERR( KSPSetType(self.ksp, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/KSP.pyx":132
* def setType(self, ksp_type):
* 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(48, 132, __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":133
* cdef PetscKSPType cval = NULL
* ksp_type = str2bytes(ksp_type, &cval)
* CHKERR( KSPSetType(self.ksp, cval) ) # <<<<<<<<<<<<<<
*
* def getType(self):
*/
__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(48, 133, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":130
* return self
*
* def setType(self, ksp_type): # <<<<<<<<<<<<<<
* cdef PetscKSPType cval = NULL
* ksp_type = str2bytes(ksp_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":135
* CHKERR( KSPSetType(self.ksp, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscKSPType cval = NULL
* CHKERR( KSPGetType(self.ksp, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_12getType[] = "KSP.getType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_12getType(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_12getType(struct PyPetscKSPObject *__pyx_v_self) {
KSPType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getType", 0);
/* "petsc4py/PETSc/KSP.pyx":136
*
* def getType(self):
* cdef PetscKSPType cval = NULL # <<<<<<<<<<<<<<
* CHKERR( KSPGetType(self.ksp, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/KSP.pyx":137
* def getType(self):
* 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(48, 137, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":138
* cdef PetscKSPType cval = NULL
* CHKERR( KSPGetType(self.ksp, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def setOptionsPrefix(self, prefix):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 138, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":135
* CHKERR( KSPSetType(self.ksp, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscKSPType cval = NULL
* CHKERR( KSPGetType(self.ksp, &cval) )
*/
/* 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":140
* return bytes2str(cval)
*
* def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_15setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_14setOptionsPrefix[] = "KSP.setOptionsPrefix(self, prefix)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_15setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(48, 140, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_prefix = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 140, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":141
*
* def setOptionsPrefix(self, prefix):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* prefix = str2bytes(prefix, &cval)
* CHKERR( KSPSetOptionsPrefix(self.ksp, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/KSP.pyx":142
* def setOptionsPrefix(self, prefix):
* 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(48, 142, __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":143
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
* CHKERR( KSPSetOptionsPrefix(self.ksp, cval) ) # <<<<<<<<<<<<<<
*
* def getOptionsPrefix(self):
*/
__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(48, 143, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":140
* return bytes2str(cval)
*
* def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":145
* CHKERR( KSPSetOptionsPrefix(self.ksp, cval) )
*
* def getOptionsPrefix(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( KSPGetOptionsPrefix(self.ksp, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_17getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_16getOptionsPrefix[] = "KSP.getOptionsPrefix(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_17getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_16getOptionsPrefix(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_16getOptionsPrefix(struct PyPetscKSPObject *__pyx_v_self) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getOptionsPrefix", 0);
/* "petsc4py/PETSc/KSP.pyx":146
*
* def getOptionsPrefix(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( KSPGetOptionsPrefix(self.ksp, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/KSP.pyx":147
* def getOptionsPrefix(self):
* 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(48, 147, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":148
* cdef const char *cval = NULL
* CHKERR( KSPGetOptionsPrefix(self.ksp, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def appendOptionsPrefix(self, prefix):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 148, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":145
* CHKERR( KSPSetOptionsPrefix(self.ksp, cval) )
*
* def getOptionsPrefix(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( KSPGetOptionsPrefix(self.ksp, &cval) )
*/
/* 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":150
* return bytes2str(cval)
*
* def appendOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_19appendOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_18appendOptionsPrefix[] = "KSP.appendOptionsPrefix(self, prefix)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_19appendOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "appendOptionsPrefix") < 0)) __PYX_ERR(48, 150, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_prefix = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 150, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":151
*
* def appendOptionsPrefix(self, prefix):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* prefix = str2bytes(prefix, &cval)
* CHKERR( KSPAppendOptionsPrefix(self.ksp, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/KSP.pyx":152
* def appendOptionsPrefix(self, prefix):
* 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(48, 152, __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":153
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
* CHKERR( KSPAppendOptionsPrefix(self.ksp, cval) ) # <<<<<<<<<<<<<<
*
* def setFromOptions(self):
*/
__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(48, 153, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":150
* return bytes2str(cval)
*
* def appendOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":155
* CHKERR( KSPAppendOptionsPrefix(self.ksp, cval) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( KSPSetFromOptions(self.ksp) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_21setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_20setFromOptions[] = "KSP.setFromOptions(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_21setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_20setFromOptions(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_20setFromOptions(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFromOptions", 0);
/* "petsc4py/PETSc/KSP.pyx":156
*
* def setFromOptions(self):
* 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(48, 156, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":155
* CHKERR( KSPAppendOptionsPrefix(self.ksp, cval) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( KSPSetFromOptions(self.ksp) )
*
*/
/* 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":160
* # --- application context ---
*
* def setAppCtx(self, appctx): # <<<<<<<<<<<<<<
* self.set_attr('__appctx__', appctx)
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_23setAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_22setAppCtx[] = "KSP.setAppCtx(self, appctx)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_23setAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_appctx = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_appctx,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_appctx)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setAppCtx") < 0)) __PYX_ERR(48, 160, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_appctx = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 160, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":161
*
* def setAppCtx(self, appctx):
* self.set_attr('__appctx__', appctx) # <<<<<<<<<<<<<<
*
* def getAppCtx(self):
*/
__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(48, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/KSP.pyx":160
* # --- application context ---
*
* def setAppCtx(self, appctx): # <<<<<<<<<<<<<<
* self.set_attr('__appctx__', appctx)
*
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":163
* self.set_attr('__appctx__', appctx)
*
* def getAppCtx(self): # <<<<<<<<<<<<<<
* return self.get_attr('__appctx__')
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_25getAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_24getAppCtx[] = "KSP.getAppCtx(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_25getAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getAppCtx (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getAppCtx", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAppCtx", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_24getAppCtx(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_24getAppCtx(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getAppCtx", 0);
/* "petsc4py/PETSc/KSP.pyx":164
*
* def getAppCtx(self):
* 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(48, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":163
* self.set_attr('__appctx__', appctx)
*
* def getAppCtx(self): # <<<<<<<<<<<<<<
* return self.get_attr('__appctx__')
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":168
* # --- discretization space ---
*
* def getDM(self): # <<<<<<<<<<<<<<
* cdef PetscDM newdm = NULL
* CHKERR( KSPGetDM(self.ksp, &newdm) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_27getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_26getDM[] = "KSP.getDM(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_27getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDM (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_26getDM(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_26getDM(struct PyPetscKSPObject *__pyx_v_self) {
DM __pyx_v_newdm;
struct PyPetscDMObject *__pyx_v_dm = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDM", 0);
/* "petsc4py/PETSc/KSP.pyx":169
*
* def getDM(self):
* cdef PetscDM newdm = NULL # <<<<<<<<<<<<<<
* CHKERR( KSPGetDM(self.ksp, &newdm) )
* cdef DM dm = subtype_DM(newdm)()
*/
__pyx_v_newdm = NULL;
/* "petsc4py/PETSc/KSP.pyx":170
* def getDM(self):
* 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(48, 170, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":171
* cdef PetscDM newdm = NULL
* CHKERR( KSPGetDM(self.ksp, &newdm) )
* cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<<
* dm.dm = newdm
* PetscINCREF(dm.obj)
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(48, 171, __pyx_L1_error)
__pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/KSP.pyx":172
* CHKERR( KSPGetDM(self.ksp, &newdm) )
* cdef DM dm = subtype_DM(newdm)()
* dm.dm = newdm # <<<<<<<<<<<<<<
* PetscINCREF(dm.obj)
* return dm
*/
__pyx_v_dm->dm = __pyx_v_newdm;
/* "petsc4py/PETSc/KSP.pyx":173
* cdef DM dm = subtype_DM(newdm)()
* dm.dm = newdm
* PetscINCREF(dm.obj) # <<<<<<<<<<<<<<
* return dm
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj));
/* "petsc4py/PETSc/KSP.pyx":174
* dm.dm = newdm
* PetscINCREF(dm.obj)
* return dm # <<<<<<<<<<<<<<
*
* def setDM(self, DM dm):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_dm));
__pyx_r = ((PyObject *)__pyx_v_dm);
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":168
* # --- discretization space ---
*
* def getDM(self): # <<<<<<<<<<<<<<
* cdef PetscDM newdm = NULL
* CHKERR( KSPGetDM(self.ksp, &newdm) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_dm);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":176
* return dm
*
* def setDM(self, DM dm): # <<<<<<<<<<<<<<
* CHKERR( KSPSetDM(self.ksp, dm.dm) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_29setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_28setDM[] = "KSP.setDM(self, DM dm)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_29setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscDMObject *__pyx_v_dm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDM") < 0)) __PYX_ERR(48, 176, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_dm = ((struct PyPetscDMObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 176, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(48, 176, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_28setDM(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_dm);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":177
*
* def setDM(self, DM dm):
* CHKERR( KSPSetDM(self.ksp, dm.dm) ) # <<<<<<<<<<<<<<
*
* def setDMActive(self, bint flag):
*/
__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(48, 177, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":176
* return dm
*
* def setDM(self, DM dm): # <<<<<<<<<<<<<<
* CHKERR( KSPSetDM(self.ksp, dm.dm) )
*
*/
/* 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":179
* CHKERR( KSPSetDM(self.ksp, dm.dm) )
*
* def setDMActive(self, bint flag): # <<<<<<<<<<<<<<
* cdef PetscBool cflag = PETSC_FALSE
* if flag: cflag = PETSC_TRUE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_31setDMActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_30setDMActive[] = "KSP.setDMActive(self, bool flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_31setDMActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_flag;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setDMActive (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDMActive") < 0)) __PYX_ERR(48, 179, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(48, 179, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDMActive", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 179, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setDMActive", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_30setDMActive(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_30setDMActive(struct PyPetscKSPObject *__pyx_v_self, int __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("setDMActive", 0);
/* "petsc4py/PETSc/KSP.pyx":180
*
* def setDMActive(self, bint flag):
* cdef PetscBool cflag = PETSC_FALSE # <<<<<<<<<<<<<<
* if flag: cflag = PETSC_TRUE
* CHKERR( KSPSetDMActive(self.ksp, cflag) )
*/
__pyx_v_cflag = PETSC_FALSE;
/* "petsc4py/PETSc/KSP.pyx":181
* def setDMActive(self, bint flag):
* cdef PetscBool cflag = PETSC_FALSE
* if flag: cflag = PETSC_TRUE # <<<<<<<<<<<<<<
* CHKERR( KSPSetDMActive(self.ksp, cflag) )
*
*/
__pyx_t_1 = (__pyx_v_flag != 0);
if (__pyx_t_1) {
__pyx_v_cflag = PETSC_TRUE;
}
/* "petsc4py/PETSc/KSP.pyx":182
* cdef PetscBool cflag = PETSC_FALSE
* if flag: cflag = PETSC_TRUE
* CHKERR( KSPSetDMActive(self.ksp, cflag) ) # <<<<<<<<<<<<<<
*
* # --- operators and preconditioner ---
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetDMActive(__pyx_v_self->ksp, __pyx_v_cflag)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 182, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":179
* CHKERR( KSPSetDM(self.ksp, dm.dm) )
*
* def setDMActive(self, bint flag): # <<<<<<<<<<<<<<
* cdef PetscBool cflag = PETSC_FALSE
* if flag: cflag = PETSC_TRUE
*/
/* 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":186
* # --- operators and preconditioner ---
*
* def setComputeRHS(self, rhs, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_33setComputeRHS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_32setComputeRHS[] = "KSP.setComputeRHS(self, rhs, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_33setComputeRHS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rhs = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rhs,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setComputeRHS") < 0)) __PYX_ERR(48, 186, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_rhs = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setComputeRHS", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 186, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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;
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("setComputeRHS", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/KSP.pyx":187
*
* def setComputeRHS(self, rhs, args=None, kargs=None):
* if args is None: args = () # <<<<<<<<<<<<<<
* if kargs is None: kargs = {}
* context = (rhs, args, kargs)
*/
__pyx_t_1 = (__pyx_v_args == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/KSP.pyx":188
* def setComputeRHS(self, rhs, args=None, kargs=None):
* if args is None: args = ()
* if kargs is None: kargs = {} # <<<<<<<<<<<<<<
* context = (rhs, args, kargs)
* self.set_attr('__rhs__', context)
*/
__pyx_t_2 = (__pyx_v_kargs == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 188, __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":189
* 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_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 189, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_rhs);
__Pyx_GIVEREF(__pyx_v_rhs);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_rhs);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/KSP.pyx":190
* if kargs is None: kargs = {}
* context = (rhs, args, kargs)
* self.set_attr('__rhs__', context) # <<<<<<<<<<<<<<
* CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, <void*>context) )
*
*/
__pyx_t_3 = ((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_3)) __PYX_ERR(48, 190, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/KSP.pyx":191
* context = (rhs, args, kargs)
* self.set_attr('__rhs__', context)
* CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, <void*>context) ) # <<<<<<<<<<<<<<
*
* def setComputeOperators(self, operators, args=None, kargs=None):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetComputeRHS(__pyx_v_self->ksp, __pyx_f_8petsc4py_5PETSc_KSP_ComputeRHS, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 191, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":186
* # --- operators and preconditioner ---
*
* def setComputeRHS(self, rhs, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":193
* CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, <void*>context) )
*
* def setComputeOperators(self, operators, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_35setComputeOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_34setComputeOperators[] = "KSP.setComputeOperators(self, operators, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_35setComputeOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_operators = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_operators,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_operators)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setComputeOperators") < 0)) __PYX_ERR(48, 193, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_operators = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setComputeOperators", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 193, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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;
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("setComputeOperators", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/KSP.pyx":194
*
* def setComputeOperators(self, operators, args=None, kargs=None):
* if args is None: args = () # <<<<<<<<<<<<<<
* if kargs is None: kargs = {}
* context = (operators, args, kargs)
*/
__pyx_t_1 = (__pyx_v_args == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/KSP.pyx":195
* def setComputeOperators(self, operators, args=None, kargs=None):
* if args is None: args = ()
* if kargs is None: kargs = {} # <<<<<<<<<<<<<<
* context = (operators, args, kargs)
* self.set_attr('__operators__', context)
*/
__pyx_t_2 = (__pyx_v_kargs == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 195, __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":196
* 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_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_operators);
__Pyx_GIVEREF(__pyx_v_operators);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_operators);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/KSP.pyx":197
* if kargs is None: kargs = {}
* context = (operators, args, kargs)
* self.set_attr('__operators__', context) # <<<<<<<<<<<<<<
* CHKERR( KSPSetComputeOperators(self.ksp, KSP_ComputeOps, <void*>context) )
*
*/
__pyx_t_3 = ((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_3)) __PYX_ERR(48, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/KSP.pyx":198
* 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):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetComputeOperators(__pyx_v_self->ksp, __pyx_f_8petsc4py_5PETSc_KSP_ComputeOps, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 198, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":193
* CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, <void*>context) )
*
* def setComputeOperators(self, operators, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":200
* CHKERR( KSPSetComputeOperators(self.ksp, KSP_ComputeOps, <void*>context) )
*
* def setOperators(self, Mat A=None, Mat P=None): # <<<<<<<<<<<<<<
* cdef PetscMat amat=NULL
* if A is not None: amat = A.mat
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_37setOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_36setOperators[] = "KSP.setOperators(self, Mat A=None, Mat P=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_37setOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_A = 0;
struct PyPetscMatObject *__pyx_v_P = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_P,0};
PyObject* values[2] = {0,0};
values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None);
values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOperators") < 0)) __PYX_ERR(48, 200, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_A = ((struct PyPetscMatObject *)values[0]);
__pyx_v_P = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setOperators", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 200, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setOperators", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(48, 200, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(48, 200, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_36setOperators(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_A, __pyx_v_P);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
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("setOperators", 0);
/* "petsc4py/PETSc/KSP.pyx":201
*
* def setOperators(self, Mat A=None, Mat P=None):
* cdef PetscMat amat=NULL # <<<<<<<<<<<<<<
* if A is not None: amat = A.mat
* cdef PetscMat pmat=amat
*/
__pyx_v_amat = NULL;
/* "petsc4py/PETSc/KSP.pyx":202
* def setOperators(self, Mat A=None, Mat P=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_A->mat;
__pyx_v_amat = __pyx_t_3;
}
/* "petsc4py/PETSc/KSP.pyx":203
* 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":204
* 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_2 = (((PyObject *)__pyx_v_P) != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __pyx_v_P->mat;
__pyx_v_pmat = __pyx_t_3;
}
/* "petsc4py/PETSc/KSP.pyx":205
* cdef PetscMat pmat=amat
* if P is not None: pmat = P.mat
* CHKERR( KSPSetOperators(self.ksp, amat, pmat) ) # <<<<<<<<<<<<<<
*
* def getOperators(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetOperators(__pyx_v_self->ksp, __pyx_v_amat, __pyx_v_pmat)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 205, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":200
* CHKERR( KSPSetComputeOperators(self.ksp, KSP_ComputeOps, <void*>context) )
*
* def setOperators(self, Mat A=None, Mat P=None): # <<<<<<<<<<<<<<
* cdef PetscMat amat=NULL
* if A is not None: amat = A.mat
*/
/* 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":207
* CHKERR( KSPSetOperators(self.ksp, amat, pmat) )
*
* def getOperators(self): # <<<<<<<<<<<<<<
* cdef Mat A = Mat(), P = Mat()
* CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_39getOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_38getOperators[] = "KSP.getOperators(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_39getOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOperators (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOperators", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOperators", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_38getOperators(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_38getOperators(struct PyPetscKSPObject *__pyx_v_self) {
struct PyPetscMatObject *__pyx_v_A = 0;
struct PyPetscMatObject *__pyx_v_P = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getOperators", 0);
/* "petsc4py/PETSc/KSP.pyx":208
*
* def getOperators(self):
* cdef Mat A = Mat(), P = Mat() # <<<<<<<<<<<<<<
* CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) )
* PetscINCREF(A.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 208, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_A = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 208, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/KSP.pyx":209
* def getOperators(self):
* cdef Mat A = Mat(), P = Mat()
* CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) ) # <<<<<<<<<<<<<<
* PetscINCREF(A.obj)
* PetscINCREF(P.obj)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetOperators(__pyx_v_self->ksp, (&__pyx_v_A->mat), (&__pyx_v_P->mat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 209, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":210
* cdef Mat A = Mat(), P = Mat()
* CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) )
* PetscINCREF(A.obj) # <<<<<<<<<<<<<<
* PetscINCREF(P.obj)
* return (A, P)
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A->__pyx_base.obj));
/* "petsc4py/PETSc/KSP.pyx":211
* CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) )
* PetscINCREF(A.obj)
* PetscINCREF(P.obj) # <<<<<<<<<<<<<<
* return (A, P)
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj));
/* "petsc4py/PETSc/KSP.pyx":212
* PetscINCREF(A.obj)
* PetscINCREF(P.obj)
* return (A, P) # <<<<<<<<<<<<<<
*
* def setPC(self, PC pc):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 212, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_A));
__Pyx_GIVEREF(((PyObject *)__pyx_v_A));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_A));
__Pyx_INCREF(((PyObject *)__pyx_v_P));
__Pyx_GIVEREF(((PyObject *)__pyx_v_P));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P));
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":207
* CHKERR( KSPSetOperators(self.ksp, amat, pmat) )
*
* def getOperators(self): # <<<<<<<<<<<<<<
* cdef Mat A = Mat(), P = Mat()
* CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.getOperators", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_A);
__Pyx_XDECREF((PyObject *)__pyx_v_P);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":214
* return (A, P)
*
* def setPC(self, PC pc): # <<<<<<<<<<<<<<
* CHKERR( KSPSetPC(self.ksp, pc.pc) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_41setPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_40setPC[] = "KSP.setPC(self, PC pc)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_41setPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscPCObject *__pyx_v_pc = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pc,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pc)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPC") < 0)) __PYX_ERR(48, 214, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_pc = ((struct PyPetscPCObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPC", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 214, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setPC", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pc), __pyx_ptype_8petsc4py_5PETSc_PC, 0, "pc", 0))) __PYX_ERR(48, 214, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_40setPC(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_pc);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":215
*
* def setPC(self, PC pc):
* CHKERR( KSPSetPC(self.ksp, pc.pc) ) # <<<<<<<<<<<<<<
*
* def getPC(self):
*/
__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(48, 215, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":214
* return (A, P)
*
* def setPC(self, PC pc): # <<<<<<<<<<<<<<
* CHKERR( KSPSetPC(self.ksp, pc.pc) )
*
*/
/* 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":217
* CHKERR( KSPSetPC(self.ksp, pc.pc) )
*
* def getPC(self): # <<<<<<<<<<<<<<
* cdef PC pc = PC()
* CHKERR( KSPGetPC(self.ksp, &pc.pc) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_43getPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_42getPC[] = "KSP.getPC(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_43getPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getPC (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getPC", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPC", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_42getPC(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_42getPC(struct PyPetscKSPObject *__pyx_v_self) {
struct PyPetscPCObject *__pyx_v_pc = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getPC", 0);
/* "petsc4py/PETSc/KSP.pyx":218
*
* def getPC(self):
* cdef PC pc = PC() # <<<<<<<<<<<<<<
* CHKERR( KSPGetPC(self.ksp, &pc.pc) )
* PetscINCREF(pc.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_pc = ((struct PyPetscPCObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/KSP.pyx":219
* def getPC(self):
* cdef PC pc = PC()
* CHKERR( KSPGetPC(self.ksp, &pc.pc) ) # <<<<<<<<<<<<<<
* PetscINCREF(pc.obj)
* return pc
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetPC(__pyx_v_self->ksp, (&__pyx_v_pc->pc))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 219, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":220
* cdef PC pc = PC()
* CHKERR( KSPGetPC(self.ksp, &pc.pc) )
* PetscINCREF(pc.obj) # <<<<<<<<<<<<<<
* return pc
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_pc->__pyx_base.obj));
/* "petsc4py/PETSc/KSP.pyx":221
* CHKERR( KSPGetPC(self.ksp, &pc.pc) )
* 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":217
* CHKERR( KSPSetPC(self.ksp, pc.pc) )
*
* def getPC(self): # <<<<<<<<<<<<<<
* cdef PC pc = PC()
* CHKERR( KSPGetPC(self.ksp, &pc.pc) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.getPC", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_pc);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":225
* # --- tolerances and convergence ---
*
* def setTolerances(self, rtol=None, atol=None, divtol=None, max_it=None): # <<<<<<<<<<<<<<
* cdef PetscReal crtol, catol, cdivtol
* crtol = catol = cdivtol = PETSC_DEFAULT;
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_45setTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_44setTolerances[] = "KSP.setTolerances(self, rtol=None, atol=None, divtol=None, max_it=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_45setTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rtol = 0;
PyObject *__pyx_v_atol = 0;
PyObject *__pyx_v_divtol = 0;
PyObject *__pyx_v_max_it = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rtol,&__pyx_n_s_atol,&__pyx_n_s_divtol,&__pyx_n_s_max_it,0};
PyObject* values[4] = {0,0,0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rtol);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_atol);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_divtol);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_it);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTolerances") < 0)) __PYX_ERR(48, 225, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_rtol = values[0];
__pyx_v_atol = values[1];
__pyx_v_divtol = values[2];
__pyx_v_max_it = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setTolerances", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 225, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__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;
int __pyx_t_2;
PetscReal __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("setTolerances", 0);
/* "petsc4py/PETSc/KSP.pyx":227
* def setTolerances(self, rtol=None, atol=None, divtol=None, max_it=None):
* cdef PetscReal crtol, catol, cdivtol
* crtol = catol = cdivtol = PETSC_DEFAULT; # <<<<<<<<<<<<<<
* if rtol is not None: crtol = asReal(rtol)
* if atol is not None: catol = asReal(atol)
*/
__pyx_v_crtol = PETSC_DEFAULT;
__pyx_v_catol = PETSC_DEFAULT;
__pyx_v_cdivtol = PETSC_DEFAULT;
/* "petsc4py/PETSc/KSP.pyx":228
* cdef PetscReal crtol, catol, cdivtol
* crtol = catol = cdivtol = PETSC_DEFAULT;
* if rtol is not None: crtol = asReal(rtol) # <<<<<<<<<<<<<<
* if atol is not None: catol = asReal(atol)
* if divtol is not None: cdivtol = asReal(divtol)
*/
__pyx_t_1 = (__pyx_v_rtol != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(48, 228, __pyx_L1_error)
__pyx_v_crtol = __pyx_t_3;
}
/* "petsc4py/PETSc/KSP.pyx":229
* crtol = catol = cdivtol = PETSC_DEFAULT;
* if rtol is not None: crtol = asReal(rtol)
* if atol is not None: catol = asReal(atol) # <<<<<<<<<<<<<<
* if divtol is not None: cdivtol = asReal(divtol)
* cdef PetscInt cmaxits = PETSC_DEFAULT
*/
__pyx_t_2 = (__pyx_v_atol != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_atol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(48, 229, __pyx_L1_error)
__pyx_v_catol = __pyx_t_3;
}
/* "petsc4py/PETSc/KSP.pyx":230
* if rtol is not None: crtol = asReal(rtol)
* if atol is not None: catol = asReal(atol)
* if divtol is not None: cdivtol = asReal(divtol) # <<<<<<<<<<<<<<
* cdef PetscInt cmaxits = PETSC_DEFAULT
* if max_it is not None: cmaxits = asInt(max_it)
*/
__pyx_t_1 = (__pyx_v_divtol != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_divtol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(48, 230, __pyx_L1_error)
__pyx_v_cdivtol = __pyx_t_3;
}
/* "petsc4py/PETSc/KSP.pyx":231
* if atol is not None: catol = asReal(atol)
* if divtol is not None: cdivtol = asReal(divtol)
* cdef PetscInt cmaxits = PETSC_DEFAULT # <<<<<<<<<<<<<<
* if max_it is not None: cmaxits = asInt(max_it)
* CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) )
*/
__pyx_v_cmaxits = PETSC_DEFAULT;
/* "petsc4py/PETSc/KSP.pyx":232
* if divtol is not None: cdivtol = asReal(divtol)
* cdef PetscInt cmaxits = PETSC_DEFAULT
* if max_it is not None: cmaxits = asInt(max_it) # <<<<<<<<<<<<<<
* CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) )
*
*/
__pyx_t_2 = (__pyx_v_max_it != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_it); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 232, __pyx_L1_error)
__pyx_v_cmaxits = __pyx_t_4;
}
/* "petsc4py/PETSc/KSP.pyx":233
* cdef PetscInt cmaxits = PETSC_DEFAULT
* if max_it is not None: cmaxits = asInt(max_it)
* CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) ) # <<<<<<<<<<<<<<
*
* def getTolerances(self):
*/
__pyx_t_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 233, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":225
* # --- tolerances and convergence ---
*
* def setTolerances(self, rtol=None, atol=None, divtol=None, max_it=None): # <<<<<<<<<<<<<<
* cdef PetscReal crtol, catol, cdivtol
* crtol = catol = cdivtol = PETSC_DEFAULT;
*/
/* 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":235
* CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) )
*
* def getTolerances(self): # <<<<<<<<<<<<<<
* cdef PetscReal crtol=0, catol=0, cdivtol=0
* cdef PetscInt cmaxits=0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_47getTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_46getTolerances[] = "KSP.getTolerances(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_47getTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getTolerances (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getTolerances", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTolerances", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_46getTolerances(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_46getTolerances(struct PyPetscKSPObject *__pyx_v_self) {
PetscReal __pyx_v_crtol;
PetscReal __pyx_v_catol;
PetscReal __pyx_v_cdivtol;
PetscInt __pyx_v_cmaxits;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getTolerances", 0);
/* "petsc4py/PETSc/KSP.pyx":236
*
* def getTolerances(self):
* 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":237
* def getTolerances(self):
* 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":238
* 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(48, 238, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":239
* cdef PetscInt cmaxits=0
* CHKERR( KSPGetTolerances(self.ksp, &crtol, &catol, &cdivtol, &cmaxits) )
* return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits)) # <<<<<<<<<<<<<<
*
* def setConvergenceTest(self, converged, args=None, kargs=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_crtol); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 239, __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(48, 239, __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(48, 239, __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(48, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5);
__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":235
* CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) )
*
* def getTolerances(self): # <<<<<<<<<<<<<<
* cdef PetscReal crtol=0, catol=0, cdivtol=0
* cdef PetscInt cmaxits=0
*/
/* 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":241
* return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits))
*
* def setConvergenceTest(self, converged, args=None, kargs=None): # <<<<<<<<<<<<<<
* cdef PetscKSPNormType normtype = KSP_NORM_NONE
* cdef void* cctx = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_49setConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_48setConvergenceTest[] = "KSP.setConvergenceTest(self, converged, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_49setConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_converged = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_converged,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_converged)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConvergenceTest") < 0)) __PYX_ERR(48, 241, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_converged = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setConvergenceTest", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 241, __pyx_L3_error)
__pyx_L3_error:;
__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);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_48setConvergenceTest(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
KSPNormType __pyx_v_normtype;
void *__pyx_v_cctx;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PetscErrorCode __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("setConvergenceTest", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/KSP.pyx":242
*
* def setConvergenceTest(self, converged, args=None, kargs=None):
* cdef PetscKSPNormType normtype = KSP_NORM_NONE # <<<<<<<<<<<<<<
* cdef void* cctx = NULL
* if converged is not None:
*/
__pyx_v_normtype = KSP_NORM_NONE;
/* "petsc4py/PETSc/KSP.pyx":243
* def setConvergenceTest(self, converged, args=None, kargs=None):
* cdef PetscKSPNormType normtype = KSP_NORM_NONE
* cdef void* cctx = NULL # <<<<<<<<<<<<<<
* if converged is not None:
* CHKERR( KSPSetConvergenceTest(
*/
__pyx_v_cctx = NULL;
/* "petsc4py/PETSc/KSP.pyx":244
* cdef PetscKSPNormType normtype = KSP_NORM_NONE
* cdef void* cctx = NULL
* if converged is not None: # <<<<<<<<<<<<<<
* CHKERR( KSPSetConvergenceTest(
* self.ksp, KSP_Converged, NULL, NULL) )
*/
__pyx_t_1 = (__pyx_v_converged != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/KSP.pyx":245
* cdef void* cctx = NULL
* if converged is not None:
* CHKERR( KSPSetConvergenceTest( # <<<<<<<<<<<<<<
* self.ksp, KSP_Converged, NULL, NULL) )
* if args is None: args = ()
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetConvergenceTest(__pyx_v_self->ksp, __pyx_f_8petsc4py_5PETSc_KSP_Converged, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 245, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":247
* 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_2 = (__pyx_v_args == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/KSP.pyx":248
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4);
__pyx_t_4 = 0;
}
/* "petsc4py/PETSc/KSP.pyx":249
* if args is None: args = ()
* if kargs is None: kargs = {}
* self.set_attr('__converged__', (converged, args, kargs)) # <<<<<<<<<<<<<<
* else:
* CHKERR( KSPGetNormType(self.ksp, &normtype) )
*/
__pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_converged);
__Pyx_GIVEREF(__pyx_v_converged);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_converged);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs);
__pyx_t_5 = ((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_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/KSP.pyx":244
* cdef PetscKSPNormType normtype = KSP_NORM_NONE
* cdef void* cctx = NULL
* if converged is not None: # <<<<<<<<<<<<<<
* CHKERR( KSPSetConvergenceTest(
* self.ksp, KSP_Converged, NULL, NULL) )
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/KSP.pyx":251
* self.set_attr('__converged__', (converged, args, kargs))
* else:
* CHKERR( KSPGetNormType(self.ksp, &normtype) ) # <<<<<<<<<<<<<<
* if normtype != KSP_NORM_NONE:
* CHKERR( KSPConvergedDefaultCreate(&cctx) )
*/
/*else*/ {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetNormType(__pyx_v_self->ksp, (&__pyx_v_normtype))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 251, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":252
* else:
* CHKERR( KSPGetNormType(self.ksp, &normtype) )
* if normtype != KSP_NORM_NONE: # <<<<<<<<<<<<<<
* CHKERR( KSPConvergedDefaultCreate(&cctx) )
* CHKERR( KSPSetConvergenceTest(
*/
__pyx_t_2 = ((__pyx_v_normtype != KSP_NORM_NONE) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/KSP.pyx":253
* CHKERR( KSPGetNormType(self.ksp, &normtype) )
* if normtype != KSP_NORM_NONE:
* CHKERR( KSPConvergedDefaultCreate(&cctx) ) # <<<<<<<<<<<<<<
* CHKERR( KSPSetConvergenceTest(
* self.ksp, KSPConvergedDefault,
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPConvergedDefaultCreate((&__pyx_v_cctx))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 253, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":254
* if normtype != KSP_NORM_NONE:
* CHKERR( KSPConvergedDefaultCreate(&cctx) )
* CHKERR( KSPSetConvergenceTest( # <<<<<<<<<<<<<<
* self.ksp, KSPConvergedDefault,
* cctx, KSPConvergedDefaultDestroy) )
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetConvergenceTest(__pyx_v_self->ksp, KSPConvergedDefault, __pyx_v_cctx, KSPConvergedDefaultDestroy)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 254, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":252
* else:
* CHKERR( KSPGetNormType(self.ksp, &normtype) )
* if normtype != KSP_NORM_NONE: # <<<<<<<<<<<<<<
* CHKERR( KSPConvergedDefaultCreate(&cctx) )
* CHKERR( KSPSetConvergenceTest(
*/
goto __pyx_L6;
}
/* "petsc4py/PETSc/KSP.pyx":258
* cctx, KSPConvergedDefaultDestroy) )
* else:
* CHKERR( KSPSetConvergenceTest( # <<<<<<<<<<<<<<
* self.ksp, KSPConvergedSkip,
* NULL, NULL) )
*/
/*else*/ {
/* "petsc4py/PETSc/KSP.pyx":260
* CHKERR( KSPSetConvergenceTest(
* self.ksp, KSPConvergedSkip,
* NULL, NULL) ) # <<<<<<<<<<<<<<
* self.set_attr('__converged__', None)
*
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetConvergenceTest(__pyx_v_self->ksp, KSPConvergedSkip, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 258, __pyx_L1_error)
}
__pyx_L6:;
/* "petsc4py/PETSc/KSP.pyx":261
* self.ksp, KSPConvergedSkip,
* NULL, NULL) )
* self.set_attr('__converged__', None) # <<<<<<<<<<<<<<
*
* def getConvergenceTest(self):
*/
__pyx_t_5 = ((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_5)) __PYX_ERR(48, 261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__pyx_L3:;
/* "petsc4py/PETSc/KSP.pyx":241
* return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits))
*
* def setConvergenceTest(self, converged, args=None, kargs=None): # <<<<<<<<<<<<<<
* cdef PetscKSPNormType normtype = KSP_NORM_NONE
* cdef void* cctx = NULL
*/
/* 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.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":263
* self.set_attr('__converged__', None)
*
* def getConvergenceTest(self): # <<<<<<<<<<<<<<
* return self.get_attr('__converged__')
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_51getConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_50getConvergenceTest[] = "KSP.getConvergenceTest(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_51getConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getConvergenceTest (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getConvergenceTest", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergenceTest", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_50getConvergenceTest(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_50getConvergenceTest(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getConvergenceTest", 0);
/* "petsc4py/PETSc/KSP.pyx":264
*
* def getConvergenceTest(self):
* return self.get_attr('__converged__') # <<<<<<<<<<<<<<
*
* def callConvergenceTest(self, its, rnorm):
*/
__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(48, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":263
* self.set_attr('__converged__', None)
*
* def getConvergenceTest(self): # <<<<<<<<<<<<<<
* return self.get_attr('__converged__')
*
*/
/* 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":266
* return self.get_attr('__converged__')
*
* def callConvergenceTest(self, its, rnorm): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(its)
* cdef PetscReal rval = asReal(rnorm)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_53callConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_52callConvergenceTest[] = "KSP.callConvergenceTest(self, its, rnorm)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_53callConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_its = 0;
PyObject *__pyx_v_rnorm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,&__pyx_n_s_rnorm,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_its)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rnorm)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 2, 2, 1); __PYX_ERR(48, 266, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "callConvergenceTest") < 0)) __PYX_ERR(48, 266, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_its = values[0];
__pyx_v_rnorm = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 266, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.callConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_52callConvergenceTest(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_its, __pyx_v_rnorm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_52callConvergenceTest(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm) {
PetscInt __pyx_v_ival;
PetscReal __pyx_v_rval;
KSPConvergedReason __pyx_v_reason;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscReal __pyx_t_2;
PetscErrorCode __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("callConvergenceTest", 0);
/* "petsc4py/PETSc/KSP.pyx":267
*
* def callConvergenceTest(self, its, rnorm):
* 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(48, 267, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/KSP.pyx":268
* def callConvergenceTest(self, its, rnorm):
* 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(48, 268, __pyx_L1_error)
__pyx_v_rval = __pyx_t_2;
/* "petsc4py/PETSc/KSP.pyx":269
* 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":270
* 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(48, 270, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":271
* cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING
* CHKERR( KSPConvergenceTestCall(self.ksp, ival, rval, &reason) )
* return reason # <<<<<<<<<<<<<<
*
* def setConvergenceHistory(self, length=None, reset=False):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __Pyx_PyInt_From_KSPConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":266
* return self.get_attr('__converged__')
*
* def callConvergenceTest(self, its, rnorm): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(its)
* cdef PetscReal rval = asReal(rnorm)
*/
/* 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":273
* return reason
*
* def setConvergenceHistory(self, length=None, reset=False): # <<<<<<<<<<<<<<
* cdef PetscReal *data = NULL
* cdef PetscInt size = 10000
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_55setConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_54setConvergenceHistory[] = "KSP.setConvergenceHistory(self, length=None, reset=False)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_55setConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_length = 0;
PyObject *__pyx_v_reset = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_reset,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_False);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reset);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConvergenceHistory") < 0)) __PYX_ERR(48, 273, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_length = values[0];
__pyx_v_reset = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setConvergenceHistory", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 273, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_54setConvergenceHistory(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_length, __pyx_v_reset);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_54setConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_reset) {
PetscReal *__pyx_v_data;
PetscInt __pyx_v_size;
PetscBool __pyx_v_flag;
PyObject *__pyx_v_hist = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PetscInt __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PetscErrorCode __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setConvergenceHistory", 0);
/* "petsc4py/PETSc/KSP.pyx":274
*
* def setConvergenceHistory(self, length=None, reset=False):
* cdef PetscReal *data = NULL # <<<<<<<<<<<<<<
* cdef PetscInt size = 10000
* cdef PetscBool flag = PETSC_FALSE
*/
__pyx_v_data = NULL;
/* "petsc4py/PETSc/KSP.pyx":275
* def setConvergenceHistory(self, length=None, reset=False):
* 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":276
* 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":277
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
goto __pyx_L3;
}
/* "petsc4py/PETSc/KSP.pyx":278
* 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_2 = (__pyx_v_length != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_length); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 278, __pyx_L1_error)
__pyx_v_size = __pyx_t_3;
}
__pyx_L3:;
/* "petsc4py/PETSc/KSP.pyx":279
* 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) != 0);
if (__pyx_t_1) {
__pyx_v_size = 0x2710;
}
/* "petsc4py/PETSc/KSP.pyx":280
* 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(48, 280, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_v_flag = PETSC_TRUE;
}
/* "petsc4py/PETSc/KSP.pyx":281
* 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_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_r(__pyx_v_size)); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_t_4, NULL, (&__pyx_v_data))); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_hist = __pyx_t_5;
__pyx_t_5 = 0;
/* "petsc4py/PETSc/KSP.pyx":282
* 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_5 = ((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_5)) __PYX_ERR(48, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/KSP.pyx":283
* 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):
*/
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetResidualHistory(__pyx_v_self->ksp, __pyx_v_data, __pyx_v_size, __pyx_v_flag)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 283, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":273
* return reason
*
* def setConvergenceHistory(self, length=None, reset=False): # <<<<<<<<<<<<<<
* cdef PetscReal *data = NULL
* cdef PetscInt size = 10000
*/
/* 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.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":285
* CHKERR( KSPSetResidualHistory(self.ksp, data, size, flag) )
*
* def getConvergenceHistory(self): # <<<<<<<<<<<<<<
* cdef const PetscReal *data = NULL
* cdef PetscInt size = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_57getConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_56getConvergenceHistory[] = "KSP.getConvergenceHistory(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_57getConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getConvergenceHistory (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getConvergenceHistory", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergenceHistory", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_56getConvergenceHistory(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_56getConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self) {
PetscReal const *__pyx_v_data;
PetscInt __pyx_v_size;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getConvergenceHistory", 0);
/* "petsc4py/PETSc/KSP.pyx":286
*
* def getConvergenceHistory(self):
* cdef const PetscReal *data = NULL # <<<<<<<<<<<<<<
* cdef PetscInt size = 0
* CHKERR( KSPGetResidualHistory(self.ksp, &data, &size) )
*/
__pyx_v_data = NULL;
/* "petsc4py/PETSc/KSP.pyx":287
* def getConvergenceHistory(self):
* 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":288
* 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(48, 288, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":289
* cdef PetscInt size = 0
* CHKERR( KSPGetResidualHistory(self.ksp, &data, &size) )
* return array_r(size, data) # <<<<<<<<<<<<<<
*
* def logConvergenceHistory(self, rnorm):
*/
__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(48, 289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":285
* CHKERR( KSPSetResidualHistory(self.ksp, data, size, flag) )
*
* def getConvergenceHistory(self): # <<<<<<<<<<<<<<
* cdef const PetscReal *data = NULL
* cdef PetscInt size = 0
*/
/* 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":291
* return array_r(size, data)
*
* def logConvergenceHistory(self, rnorm): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(rnorm)
* CHKERR( KSPLogResidualHistory(self.ksp, rval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_59logConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_58logConvergenceHistory[] = "KSP.logConvergenceHistory(self, rnorm)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_59logConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rnorm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rnorm,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rnorm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "logConvergenceHistory") < 0)) __PYX_ERR(48, 291, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_rnorm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("logConvergenceHistory", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 291, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.logConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_58logConvergenceHistory(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_rnorm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_58logConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rnorm) {
PetscReal __pyx_v_rval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscReal __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("logConvergenceHistory", 0);
/* "petsc4py/PETSc/KSP.pyx":292
*
* def logConvergenceHistory(self, rnorm):
* 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(48, 292, __pyx_L1_error)
__pyx_v_rval = __pyx_t_1;
/* "petsc4py/PETSc/KSP.pyx":293
* def logConvergenceHistory(self, rnorm):
* 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(48, 293, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":291
* return array_r(size, data)
*
* def logConvergenceHistory(self, rnorm): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(rnorm)
* CHKERR( KSPLogResidualHistory(self.ksp, rval) )
*/
/* 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":297
* # --- monitoring ---
*
* def setMonitor(self, monitor, args=None, kargs=None): # <<<<<<<<<<<<<<
* if monitor is None: return
* cdef object monitorlist = self.get_attr('__monitor__')
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_61setMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_60setMonitor[] = "KSP.setMonitor(self, monitor, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_61setMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_monitor = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_monitor,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_monitor)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMonitor") < 0)) __PYX_ERR(48, 297, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_monitor = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMonitor", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 297, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_60setMonitor(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_monitor, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_60setMonitor(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
PyObject *__pyx_v_monitorlist = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setMonitor", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/KSP.pyx":298
*
* def setMonitor(self, monitor, args=None, kargs=None):
* if monitor is None: return # <<<<<<<<<<<<<<
* cdef object monitorlist = self.get_attr('__monitor__')
* if monitorlist is None:
*/
__pyx_t_1 = (__pyx_v_monitor == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/KSP.pyx":299
* def setMonitor(self, monitor, args=None, kargs=None):
* if monitor is None: return
* cdef object monitorlist = self.get_attr('__monitor__') # <<<<<<<<<<<<<<
* if monitorlist is None:
* monitorlist = []
*/
__pyx_t_3 = ((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_3)) __PYX_ERR(48, 299, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_monitorlist = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/KSP.pyx":300
* if monitor is None: return
* cdef object monitorlist = self.get_attr('__monitor__')
* if monitorlist is None: # <<<<<<<<<<<<<<
* monitorlist = []
* self.set_attr('__monitor__', monitorlist)
*/
__pyx_t_2 = (__pyx_v_monitorlist == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/KSP.pyx":301
* 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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 301, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_monitorlist, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/KSP.pyx":302
* 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_3 = ((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_3)) __PYX_ERR(48, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/KSP.pyx":303
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPMonitorSet(__pyx_v_self->ksp, __pyx_f_8petsc4py_5PETSc_KSP_Monitor, NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 303, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":300
* 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":304
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/KSP.pyx":305
* 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_2 = (__pyx_v_kargs == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 305, __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":306
* if args is None: args = ()
* if kargs is None: kargs = {}
* monitorlist.append((monitor, args, kargs)) # <<<<<<<<<<<<<<
*
* def getMonitor(self):
*/
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_monitor);
__Pyx_GIVEREF(__pyx_v_monitor);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_monitor);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_monitorlist, __pyx_t_3); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(48, 306, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/KSP.pyx":297
* # --- monitoring ---
*
* def setMonitor(self, monitor, args=None, kargs=None): # <<<<<<<<<<<<<<
* if monitor is None: return
* cdef object monitorlist = self.get_attr('__monitor__')
*/
/* 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.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":308
* monitorlist.append((monitor, args, kargs))
*
* def getMonitor(self): # <<<<<<<<<<<<<<
* return self.get_attr('__monitor__')
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_63getMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_62getMonitor[] = "KSP.getMonitor(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_63getMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getMonitor (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getMonitor", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMonitor", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_62getMonitor(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_62getMonitor(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getMonitor", 0);
/* "petsc4py/PETSc/KSP.pyx":309
*
* def getMonitor(self):
* return self.get_attr('__monitor__') # <<<<<<<<<<<<<<
*
* def monitorCancel(self):
*/
__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(48, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":308
* monitorlist.append((monitor, args, kargs))
*
* def getMonitor(self): # <<<<<<<<<<<<<<
* return self.get_attr('__monitor__')
*
*/
/* 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":311
* return self.get_attr('__monitor__')
*
* def monitorCancel(self): # <<<<<<<<<<<<<<
* CHKERR( KSPMonitorCancel(self.ksp) )
* self.set_attr('__monitor__', None)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_65monitorCancel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_64monitorCancel[] = "KSP.monitorCancel(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_65monitorCancel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("monitorCancel (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("monitorCancel", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "monitorCancel", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_64monitorCancel(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_64monitorCancel(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("monitorCancel", 0);
/* "petsc4py/PETSc/KSP.pyx":312
*
* def monitorCancel(self):
* 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(48, 312, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":313
* def monitorCancel(self):
* 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(48, 313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/KSP.pyx":311
* return self.get_attr('__monitor__')
*
* def monitorCancel(self): # <<<<<<<<<<<<<<
* CHKERR( KSPMonitorCancel(self.ksp) )
* self.set_attr('__monitor__', 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.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":317
* cancelMonitor = monitorCancel
*
* def monitor(self, its, rnorm): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(its)
* cdef PetscReal rval = asReal(rnorm)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_67monitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_66monitor[] = "KSP.monitor(self, its, rnorm)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_67monitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_its = 0;
PyObject *__pyx_v_rnorm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,&__pyx_n_s_rnorm,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_its)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rnorm)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("monitor", 1, 2, 2, 1); __PYX_ERR(48, 317, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "monitor") < 0)) __PYX_ERR(48, 317, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_its = values[0];
__pyx_v_rnorm = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("monitor", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 317, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_66monitor(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_its, __pyx_v_rnorm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_66monitor(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm) {
PetscInt __pyx_v_ival;
PetscReal __pyx_v_rval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscReal __pyx_t_2;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("monitor", 0);
/* "petsc4py/PETSc/KSP.pyx":318
*
* def monitor(self, its, rnorm):
* 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(48, 318, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/KSP.pyx":319
* def monitor(self, its, rnorm):
* 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(48, 319, __pyx_L1_error)
__pyx_v_rval = __pyx_t_2;
/* "petsc4py/PETSc/KSP.pyx":320
* 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(48, 320, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":317
* cancelMonitor = monitorCancel
*
* def monitor(self, its, rnorm): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(its)
* 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.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":324
* # --- customization ---
*
* def setPCSide(self, side): # <<<<<<<<<<<<<<
* CHKERR( KSPSetPCSide(self.ksp, side) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_69setPCSide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_68setPCSide[] = "KSP.setPCSide(self, side)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_69setPCSide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_side = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_side,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_side)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPCSide") < 0)) __PYX_ERR(48, 324, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_side = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPCSide", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 324, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setPCSide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_68setPCSide(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_side);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_68setPCSide(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_side) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PCSide __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setPCSide", 0);
/* "petsc4py/PETSc/KSP.pyx":325
*
* def setPCSide(self, side):
* CHKERR( KSPSetPCSide(self.ksp, side) ) # <<<<<<<<<<<<<<
*
* def getPCSide(self):
*/
__pyx_t_1 = ((PCSide)__Pyx_PyInt_As_PCSide(__pyx_v_side)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 325, __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(48, 325, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":324
* # --- customization ---
*
* def setPCSide(self, side): # <<<<<<<<<<<<<<
* CHKERR( KSPSetPCSide(self.ksp, 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":327
* CHKERR( KSPSetPCSide(self.ksp, side) )
*
* def getPCSide(self): # <<<<<<<<<<<<<<
* cdef PetscPCSide side = PC_LEFT
* CHKERR( KSPGetPCSide(self.ksp, &side) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_71getPCSide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_70getPCSide[] = "KSP.getPCSide(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_71getPCSide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getPCSide (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getPCSide", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPCSide", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_70getPCSide(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_70getPCSide(struct PyPetscKSPObject *__pyx_v_self) {
PCSide __pyx_v_side;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getPCSide", 0);
/* "petsc4py/PETSc/KSP.pyx":328
*
* def getPCSide(self):
* cdef PetscPCSide side = PC_LEFT # <<<<<<<<<<<<<<
* CHKERR( KSPGetPCSide(self.ksp, &side) )
* return side
*/
__pyx_v_side = PC_LEFT;
/* "petsc4py/PETSc/KSP.pyx":329
* def getPCSide(self):
* 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(48, 329, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":330
* cdef PetscPCSide side = PC_LEFT
* CHKERR( KSPGetPCSide(self.ksp, &side) )
* return side # <<<<<<<<<<<<<<
*
* def setNormType(self, normtype):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_PCSide(__pyx_v_side); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 330, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":327
* CHKERR( KSPSetPCSide(self.ksp, side) )
*
* def getPCSide(self): # <<<<<<<<<<<<<<
* cdef PetscPCSide side = PC_LEFT
* CHKERR( KSPGetPCSide(self.ksp, &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":332
* return side
*
* def setNormType(self, normtype): # <<<<<<<<<<<<<<
* CHKERR( KSPSetNormType(self.ksp, normtype) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_73setNormType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_72setNormType[] = "KSP.setNormType(self, normtype)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_73setNormType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_normtype = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_normtype,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_normtype)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNormType") < 0)) __PYX_ERR(48, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_normtype = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setNormType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 332, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setNormType", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_72setNormType(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_normtype);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_72setNormType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_normtype) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
KSPNormType __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setNormType", 0);
/* "petsc4py/PETSc/KSP.pyx":333
*
* def setNormType(self, normtype):
* CHKERR( KSPSetNormType(self.ksp, normtype) ) # <<<<<<<<<<<<<<
*
* def getNormType(self):
*/
__pyx_t_1 = ((KSPNormType)__Pyx_PyInt_As_KSPNormType(__pyx_v_normtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 333, __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(48, 333, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":332
* return side
*
* def setNormType(self, normtype): # <<<<<<<<<<<<<<
* CHKERR( KSPSetNormType(self.ksp, normtype) )
*
*/
/* 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":335
* CHKERR( KSPSetNormType(self.ksp, normtype) )
*
* def getNormType(self): # <<<<<<<<<<<<<<
* cdef PetscKSPNormType normtype = KSP_NORM_NONE
* CHKERR( KSPGetNormType(self.ksp, &normtype) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_75getNormType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_74getNormType[] = "KSP.getNormType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_75getNormType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNormType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNormType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNormType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_74getNormType(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_74getNormType(struct PyPetscKSPObject *__pyx_v_self) {
KSPNormType __pyx_v_normtype;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNormType", 0);
/* "petsc4py/PETSc/KSP.pyx":336
*
* def getNormType(self):
* cdef PetscKSPNormType normtype = KSP_NORM_NONE # <<<<<<<<<<<<<<
* CHKERR( KSPGetNormType(self.ksp, &normtype) )
* return normtype
*/
__pyx_v_normtype = KSP_NORM_NONE;
/* "petsc4py/PETSc/KSP.pyx":337
* def getNormType(self):
* 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(48, 337, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":338
* cdef PetscKSPNormType normtype = KSP_NORM_NONE
* CHKERR( KSPGetNormType(self.ksp, &normtype) )
* return normtype # <<<<<<<<<<<<<<
*
* def setComputeEigenvalues(self, bint flag):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_KSPNormType(__pyx_v_normtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 338, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":335
* CHKERR( KSPSetNormType(self.ksp, normtype) )
*
* def getNormType(self): # <<<<<<<<<<<<<<
* cdef PetscKSPNormType normtype = KSP_NORM_NONE
* CHKERR( KSPGetNormType(self.ksp, &normtype) )
*/
/* 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":340
* return normtype
*
* def setComputeEigenvalues(self, bint flag): # <<<<<<<<<<<<<<
* cdef PetscBool compute = PETSC_FALSE
* if flag: compute = PETSC_TRUE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_77setComputeEigenvalues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_76setComputeEigenvalues[] = "KSP.setComputeEigenvalues(self, bool flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_77setComputeEigenvalues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_flag;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setComputeEigenvalues (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setComputeEigenvalues") < 0)) __PYX_ERR(48, 340, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(48, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setComputeEigenvalues", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 340, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeEigenvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_76setComputeEigenvalues(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_76setComputeEigenvalues(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag) {
PetscBool __pyx_v_compute;
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("setComputeEigenvalues", 0);
/* "petsc4py/PETSc/KSP.pyx":341
*
* def setComputeEigenvalues(self, bint flag):
* cdef PetscBool compute = PETSC_FALSE # <<<<<<<<<<<<<<
* if flag: compute = PETSC_TRUE
* CHKERR( KSPSetComputeEigenvalues(self.ksp, compute) )
*/
__pyx_v_compute = PETSC_FALSE;
/* "petsc4py/PETSc/KSP.pyx":342
* def setComputeEigenvalues(self, bint flag):
* cdef PetscBool compute = PETSC_FALSE
* if flag: compute = PETSC_TRUE # <<<<<<<<<<<<<<
* CHKERR( KSPSetComputeEigenvalues(self.ksp, compute) )
*
*/
__pyx_t_1 = (__pyx_v_flag != 0);
if (__pyx_t_1) {
__pyx_v_compute = PETSC_TRUE;
}
/* "petsc4py/PETSc/KSP.pyx":343
* cdef PetscBool compute = PETSC_FALSE
* if flag: compute = PETSC_TRUE
* CHKERR( KSPSetComputeEigenvalues(self.ksp, compute) ) # <<<<<<<<<<<<<<
*
* def getComputeEigenvalues(self):
*/
__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(48, 343, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":340
* return normtype
*
* def setComputeEigenvalues(self, bint flag): # <<<<<<<<<<<<<<
* cdef PetscBool compute = PETSC_FALSE
* if flag: compute = PETSC_TRUE
*/
/* 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":345
* CHKERR( KSPSetComputeEigenvalues(self.ksp, compute) )
*
* def getComputeEigenvalues(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( KSPGetComputeEigenvalues(self.ksp, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_79getComputeEigenvalues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_78getComputeEigenvalues[] = "KSP.getComputeEigenvalues(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_79getComputeEigenvalues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getComputeEigenvalues (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getComputeEigenvalues", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getComputeEigenvalues", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_78getComputeEigenvalues(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_78getComputeEigenvalues(struct PyPetscKSPObject *__pyx_v_self) {
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getComputeEigenvalues", 0);
/* "petsc4py/PETSc/KSP.pyx":346
*
* def getComputeEigenvalues(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( KSPGetComputeEigenvalues(self.ksp, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/KSP.pyx":347
* def getComputeEigenvalues(self):
* 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(48, 347, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":348
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( KSPGetComputeEigenvalues(self.ksp, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def setComputeSingularValues(self, bint flag):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":345
* CHKERR( KSPSetComputeEigenvalues(self.ksp, compute) )
*
* def getComputeEigenvalues(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( KSPGetComputeEigenvalues(self.ksp, &flag) )
*/
/* 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":350
* return toBool(flag)
*
* def setComputeSingularValues(self, bint flag): # <<<<<<<<<<<<<<
* cdef PetscBool compute = PETSC_FALSE
* if flag: compute = PETSC_TRUE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_81setComputeSingularValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_80setComputeSingularValues[] = "KSP.setComputeSingularValues(self, bool flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_81setComputeSingularValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_flag;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setComputeSingularValues (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setComputeSingularValues") < 0)) __PYX_ERR(48, 350, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(48, 350, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setComputeSingularValues", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 350, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeSingularValues", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_80setComputeSingularValues(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_80setComputeSingularValues(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag) {
PetscBool __pyx_v_compute;
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("setComputeSingularValues", 0);
/* "petsc4py/PETSc/KSP.pyx":351
*
* def setComputeSingularValues(self, bint flag):
* cdef PetscBool compute = PETSC_FALSE # <<<<<<<<<<<<<<
* if flag: compute = PETSC_TRUE
* CHKERR( KSPSetComputeSingularValues(self.ksp, compute) )
*/
__pyx_v_compute = PETSC_FALSE;
/* "petsc4py/PETSc/KSP.pyx":352
* def setComputeSingularValues(self, bint flag):
* cdef PetscBool compute = PETSC_FALSE
* if flag: compute = PETSC_TRUE # <<<<<<<<<<<<<<
* CHKERR( KSPSetComputeSingularValues(self.ksp, compute) )
*
*/
__pyx_t_1 = (__pyx_v_flag != 0);
if (__pyx_t_1) {
__pyx_v_compute = PETSC_TRUE;
}
/* "petsc4py/PETSc/KSP.pyx":353
* cdef PetscBool compute = PETSC_FALSE
* if flag: compute = PETSC_TRUE
* CHKERR( KSPSetComputeSingularValues(self.ksp, compute) ) # <<<<<<<<<<<<<<
*
* def getComputeSingularValues(self):
*/
__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(48, 353, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":350
* return toBool(flag)
*
* def setComputeSingularValues(self, bint flag): # <<<<<<<<<<<<<<
* cdef PetscBool compute = PETSC_FALSE
* if flag: compute = PETSC_TRUE
*/
/* 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":355
* CHKERR( KSPSetComputeSingularValues(self.ksp, compute) )
*
* def getComputeSingularValues(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( KSPGetComputeSingularValues(self.ksp, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_83getComputeSingularValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_82getComputeSingularValues[] = "KSP.getComputeSingularValues(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_83getComputeSingularValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getComputeSingularValues (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getComputeSingularValues", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getComputeSingularValues", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_82getComputeSingularValues(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_82getComputeSingularValues(struct PyPetscKSPObject *__pyx_v_self) {
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getComputeSingularValues", 0);
/* "petsc4py/PETSc/KSP.pyx":356
*
* def getComputeSingularValues(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( KSPGetComputeSingularValues(self.ksp, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/KSP.pyx":357
* def getComputeSingularValues(self):
* 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(48, 357, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":358
* 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(48, 358, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":355
* CHKERR( KSPSetComputeSingularValues(self.ksp, compute) )
*
* def getComputeSingularValues(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( KSPGetComputeSingularValues(self.ksp, &flag) )
*/
/* 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":362
* # --- initial guess ---
*
* def setInitialGuessNonzero(self, bint flag): # <<<<<<<<<<<<<<
* cdef PetscBool guess_nonzero = PETSC_FALSE
* if flag: guess_nonzero = PETSC_TRUE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_85setInitialGuessNonzero(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_84setInitialGuessNonzero[] = "KSP.setInitialGuessNonzero(self, bool flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_85setInitialGuessNonzero(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_flag;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setInitialGuessNonzero (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setInitialGuessNonzero") < 0)) __PYX_ERR(48, 362, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(48, 362, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setInitialGuessNonzero", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 362, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setInitialGuessNonzero", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_84setInitialGuessNonzero(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_84setInitialGuessNonzero(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag) {
PetscBool __pyx_v_guess_nonzero;
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("setInitialGuessNonzero", 0);
/* "petsc4py/PETSc/KSP.pyx":363
*
* def setInitialGuessNonzero(self, bint flag):
* cdef PetscBool guess_nonzero = PETSC_FALSE # <<<<<<<<<<<<<<
* if flag: guess_nonzero = PETSC_TRUE
* CHKERR( KSPSetInitialGuessNonzero(self.ksp, guess_nonzero) )
*/
__pyx_v_guess_nonzero = PETSC_FALSE;
/* "petsc4py/PETSc/KSP.pyx":364
* def setInitialGuessNonzero(self, bint flag):
* cdef PetscBool guess_nonzero = PETSC_FALSE
* if flag: guess_nonzero = PETSC_TRUE # <<<<<<<<<<<<<<
* CHKERR( KSPSetInitialGuessNonzero(self.ksp, guess_nonzero) )
*
*/
__pyx_t_1 = (__pyx_v_flag != 0);
if (__pyx_t_1) {
__pyx_v_guess_nonzero = PETSC_TRUE;
}
/* "petsc4py/PETSc/KSP.pyx":365
* cdef PetscBool guess_nonzero = PETSC_FALSE
* if flag: guess_nonzero = PETSC_TRUE
* CHKERR( KSPSetInitialGuessNonzero(self.ksp, guess_nonzero) ) # <<<<<<<<<<<<<<
*
* def getInitialGuessNonzero(self):
*/
__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(48, 365, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":362
* # --- initial guess ---
*
* def setInitialGuessNonzero(self, bint flag): # <<<<<<<<<<<<<<
* cdef PetscBool guess_nonzero = PETSC_FALSE
* if flag: guess_nonzero = PETSC_TRUE
*/
/* 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":367
* CHKERR( KSPSetInitialGuessNonzero(self.ksp, guess_nonzero) )
*
* def getInitialGuessNonzero(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( KSPGetInitialGuessNonzero(self.ksp, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_87getInitialGuessNonzero(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_86getInitialGuessNonzero[] = "KSP.getInitialGuessNonzero(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_87getInitialGuessNonzero(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getInitialGuessNonzero (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getInitialGuessNonzero", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInitialGuessNonzero", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_86getInitialGuessNonzero(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_86getInitialGuessNonzero(struct PyPetscKSPObject *__pyx_v_self) {
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getInitialGuessNonzero", 0);
/* "petsc4py/PETSc/KSP.pyx":368
*
* def getInitialGuessNonzero(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( KSPGetInitialGuessNonzero(self.ksp, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/KSP.pyx":369
* def getInitialGuessNonzero(self):
* 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(48, 369, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":370
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( KSPGetInitialGuessNonzero(self.ksp, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def setInitialGuessKnoll(self, bint flag):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 370, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":367
* CHKERR( KSPSetInitialGuessNonzero(self.ksp, guess_nonzero) )
*
* def getInitialGuessNonzero(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( KSPGetInitialGuessNonzero(self.ksp, &flag) )
*/
/* 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":372
* return toBool(flag)
*
* def setInitialGuessKnoll(self, bint flag): # <<<<<<<<<<<<<<
* cdef PetscBool guess_knoll = PETSC_FALSE
* if flag: guess_knoll = PETSC_TRUE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_89setInitialGuessKnoll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_88setInitialGuessKnoll[] = "KSP.setInitialGuessKnoll(self, bool flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_89setInitialGuessKnoll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_flag;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setInitialGuessKnoll (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setInitialGuessKnoll") < 0)) __PYX_ERR(48, 372, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(48, 372, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setInitialGuessKnoll", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 372, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setInitialGuessKnoll", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_88setInitialGuessKnoll(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_88setInitialGuessKnoll(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag) {
PetscBool __pyx_v_guess_knoll;
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("setInitialGuessKnoll", 0);
/* "petsc4py/PETSc/KSP.pyx":373
*
* def setInitialGuessKnoll(self, bint flag):
* cdef PetscBool guess_knoll = PETSC_FALSE # <<<<<<<<<<<<<<
* if flag: guess_knoll = PETSC_TRUE
* CHKERR( KSPSetInitialGuessKnoll(self.ksp, guess_knoll) )
*/
__pyx_v_guess_knoll = PETSC_FALSE;
/* "petsc4py/PETSc/KSP.pyx":374
* def setInitialGuessKnoll(self, bint flag):
* cdef PetscBool guess_knoll = PETSC_FALSE
* if flag: guess_knoll = PETSC_TRUE # <<<<<<<<<<<<<<
* CHKERR( KSPSetInitialGuessKnoll(self.ksp, guess_knoll) )
*
*/
__pyx_t_1 = (__pyx_v_flag != 0);
if (__pyx_t_1) {
__pyx_v_guess_knoll = PETSC_TRUE;
}
/* "petsc4py/PETSc/KSP.pyx":375
* cdef PetscBool guess_knoll = PETSC_FALSE
* if flag: guess_knoll = PETSC_TRUE
* CHKERR( KSPSetInitialGuessKnoll(self.ksp, guess_knoll) ) # <<<<<<<<<<<<<<
*
* def getInitialGuessKnoll(self):
*/
__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(48, 375, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":372
* return toBool(flag)
*
* def setInitialGuessKnoll(self, bint flag): # <<<<<<<<<<<<<<
* cdef PetscBool guess_knoll = PETSC_FALSE
* if flag: guess_knoll = PETSC_TRUE
*/
/* 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":377
* CHKERR( KSPSetInitialGuessKnoll(self.ksp, guess_knoll) )
*
* def getInitialGuessKnoll(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( KSPGetInitialGuessKnoll(self.ksp, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_91getInitialGuessKnoll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_90getInitialGuessKnoll[] = "KSP.getInitialGuessKnoll(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_91getInitialGuessKnoll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getInitialGuessKnoll (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getInitialGuessKnoll", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInitialGuessKnoll", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_90getInitialGuessKnoll(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_90getInitialGuessKnoll(struct PyPetscKSPObject *__pyx_v_self) {
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getInitialGuessKnoll", 0);
/* "petsc4py/PETSc/KSP.pyx":378
*
* def getInitialGuessKnoll(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( KSPGetInitialGuessKnoll(self.ksp, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/KSP.pyx":379
* def getInitialGuessKnoll(self):
* 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(48, 379, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":380
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( KSPGetInitialGuessKnoll(self.ksp, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def setUseFischerGuess(self, model, size):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":377
* CHKERR( KSPSetInitialGuessKnoll(self.ksp, guess_knoll) )
*
* def getInitialGuessKnoll(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( KSPGetInitialGuessKnoll(self.ksp, &flag) )
*/
/* 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":382
* return toBool(flag)
*
* def setUseFischerGuess(self, model, size): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = asInt(model)
* cdef PetscInt ival2 = asInt(size)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_93setUseFischerGuess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_92setUseFischerGuess[] = "KSP.setUseFischerGuess(self, model, size)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_93setUseFischerGuess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_model = 0;
PyObject *__pyx_v_size = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_model,&__pyx_n_s_size,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_model)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setUseFischerGuess", 1, 2, 2, 1); __PYX_ERR(48, 382, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setUseFischerGuess") < 0)) __PYX_ERR(48, 382, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_model = values[0];
__pyx_v_size = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setUseFischerGuess", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 382, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setUseFischerGuess", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_92setUseFischerGuess(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_model, __pyx_v_size);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_92setUseFischerGuess(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_model, PyObject *__pyx_v_size) {
PetscInt __pyx_v_ival1;
PetscInt __pyx_v_ival2;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setUseFischerGuess", 0);
/* "petsc4py/PETSc/KSP.pyx":383
*
* def setUseFischerGuess(self, model, size):
* 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(48, 383, __pyx_L1_error)
__pyx_v_ival1 = __pyx_t_1;
/* "petsc4py/PETSc/KSP.pyx":384
* def setUseFischerGuess(self, model, size):
* 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(48, 384, __pyx_L1_error)
__pyx_v_ival2 = __pyx_t_1;
/* "petsc4py/PETSc/KSP.pyx":385
* 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(48, 385, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":382
* return toBool(flag)
*
* def setUseFischerGuess(self, model, size): # <<<<<<<<<<<<<<
* cdef PetscInt ival1 = asInt(model)
* cdef PetscInt ival2 = asInt(size)
*/
/* 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":389
* # --- solving ---
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( KSPSetUp(self.ksp) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_95setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_94setUp[] = "KSP.setUp(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_95setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setUp (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_94setUp(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_94setUp(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setUp", 0);
/* "petsc4py/PETSc/KSP.pyx":390
*
* def setUp(self):
* CHKERR( KSPSetUp(self.ksp) ) # <<<<<<<<<<<<<<
*
* def reset(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetUp(__pyx_v_self->ksp)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 390, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":389
* # --- solving ---
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( KSPSetUp(self.ksp) )
*
*/
/* 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":392
* CHKERR( KSPSetUp(self.ksp) )
*
* def reset(self): # <<<<<<<<<<<<<<
* CHKERR( KSPReset(self.ksp) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_97reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_96reset[] = "KSP.reset(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_97reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_96reset(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_96reset(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reset", 0);
/* "petsc4py/PETSc/KSP.pyx":393
*
* def reset(self):
* CHKERR( KSPReset(self.ksp) ) # <<<<<<<<<<<<<<
*
* def setUpOnBlocks(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPReset(__pyx_v_self->ksp)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 393, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":392
* CHKERR( KSPSetUp(self.ksp) )
*
* def reset(self): # <<<<<<<<<<<<<<
* CHKERR( KSPReset(self.ksp) )
*
*/
/* 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":395
* CHKERR( KSPReset(self.ksp) )
*
* def setUpOnBlocks(self): # <<<<<<<<<<<<<<
* CHKERR( KSPSetUpOnBlocks(self.ksp) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_99setUpOnBlocks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_98setUpOnBlocks[] = "KSP.setUpOnBlocks(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_99setUpOnBlocks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setUpOnBlocks (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setUpOnBlocks", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUpOnBlocks", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_98setUpOnBlocks(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_98setUpOnBlocks(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setUpOnBlocks", 0);
/* "petsc4py/PETSc/KSP.pyx":396
*
* def setUpOnBlocks(self):
* CHKERR( KSPSetUpOnBlocks(self.ksp) ) # <<<<<<<<<<<<<<
*
* def solve(self, Vec b or None, Vec x or None):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetUpOnBlocks(__pyx_v_self->ksp)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 396, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":395
* CHKERR( KSPReset(self.ksp) )
*
* def setUpOnBlocks(self): # <<<<<<<<<<<<<<
* CHKERR( KSPSetUpOnBlocks(self.ksp) )
*
*/
/* 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":398
* CHKERR( KSPSetUpOnBlocks(self.ksp) )
*
* def solve(self, Vec b or None, Vec x or None): # <<<<<<<<<<<<<<
* cdef PetscVec b_vec = NULL
* cdef PetscVec x_vec = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_101solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_100solve[] = "KSP.solve(self, Vec b, Vec x)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_101solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_b = 0;
struct PyPetscVecObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, 1); __PYX_ERR(48, 398, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solve") < 0)) __PYX_ERR(48, 398, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_b = ((struct PyPetscVecObject *)values[0]);
__pyx_v_x = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 398, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(48, 398, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(48, 398, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_100solve(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_100solve(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) {
Vec __pyx_v_b_vec;
Vec __pyx_v_x_vec;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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("solve", 0);
/* "petsc4py/PETSc/KSP.pyx":399
*
* def solve(self, Vec b or None, Vec x or None):
* 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":400
* def solve(self, Vec b or None, Vec x or None):
* 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":401
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_b->vec;
__pyx_v_b_vec = __pyx_t_3;
}
/* "petsc4py/PETSc/KSP.pyx":402
* 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_2 = (((PyObject *)__pyx_v_x) != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __pyx_v_x->vec;
__pyx_v_x_vec = __pyx_t_3;
}
/* "petsc4py/PETSc/KSP.pyx":403
* 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):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSolve(__pyx_v_self->ksp, __pyx_v_b_vec, __pyx_v_x_vec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 403, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":398
* CHKERR( KSPSetUpOnBlocks(self.ksp) )
*
* def solve(self, Vec b or None, Vec x or None): # <<<<<<<<<<<<<<
* cdef PetscVec b_vec = NULL
* cdef PetscVec x_vec = NULL
*/
/* 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":405
* CHKERR( KSPSolve(self.ksp, b_vec, x_vec) )
*
* def solveTranspose(self, Vec b, Vec x): # <<<<<<<<<<<<<<
* CHKERR( KSPSolveTranspose(self.ksp, b.vec, x.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_103solveTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_102solveTranspose[] = "KSP.solveTranspose(self, Vec b, Vec x)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_103solveTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_b = 0;
struct PyPetscVecObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("solveTranspose", 1, 2, 2, 1); __PYX_ERR(48, 405, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solveTranspose") < 0)) __PYX_ERR(48, 405, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_b = ((struct PyPetscVecObject *)values[0]);
__pyx_v_x = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("solveTranspose", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 405, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.solveTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(48, 405, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(48, 405, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_102solveTranspose(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_102solveTranspose(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("solveTranspose", 0);
/* "petsc4py/PETSc/KSP.pyx":406
*
* def solveTranspose(self, Vec b, Vec x):
* CHKERR( KSPSolveTranspose(self.ksp, b.vec, x.vec) ) # <<<<<<<<<<<<<<
*
* def matSolve(self, Mat B, Mat X):
*/
__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(48, 406, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":405
* CHKERR( KSPSolve(self.ksp, b_vec, x_vec) )
*
* def solveTranspose(self, Vec b, Vec x): # <<<<<<<<<<<<<<
* CHKERR( KSPSolveTranspose(self.ksp, b.vec, x.vec) )
*
*/
/* 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":408
* CHKERR( KSPSolveTranspose(self.ksp, b.vec, x.vec) )
*
* def matSolve(self, Mat B, Mat X): # <<<<<<<<<<<<<<
* CHKERR( KSPMatSolve(self.ksp, B.mat, X.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_105matSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_104matSolve[] = "KSP.matSolve(self, Mat B, Mat X)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_105matSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_B = 0;
struct PyPetscMatObject *__pyx_v_X = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_B,&__pyx_n_s_X,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("matSolve", 1, 2, 2, 1); __PYX_ERR(48, 408, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matSolve") < 0)) __PYX_ERR(48, 408, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_B = ((struct PyPetscMatObject *)values[0]);
__pyx_v_X = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("matSolve", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 408, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.matSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_B), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(48, 408, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(48, 408, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_104matSolve(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_B, __pyx_v_X);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_104matSolve(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("matSolve", 0);
/* "petsc4py/PETSc/KSP.pyx":409
*
* def matSolve(self, Mat B, Mat X):
* CHKERR( KSPMatSolve(self.ksp, B.mat, X.mat) ) # <<<<<<<<<<<<<<
*
* def matSolveTranspose(self, Mat B, Mat X):
*/
__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(48, 409, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":408
* CHKERR( KSPSolveTranspose(self.ksp, b.vec, x.vec) )
*
* def matSolve(self, Mat B, Mat X): # <<<<<<<<<<<<<<
* CHKERR( KSPMatSolve(self.ksp, B.mat, X.mat) )
*
*/
/* 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":411
* CHKERR( KSPMatSolve(self.ksp, B.mat, X.mat) )
*
* def matSolveTranspose(self, Mat B, Mat X): # <<<<<<<<<<<<<<
* CHKERR( KSPMatSolveTranspose(self.ksp, B.mat, X.mat) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_107matSolveTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_106matSolveTranspose[] = "KSP.matSolveTranspose(self, Mat B, Mat X)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_107matSolveTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscMatObject *__pyx_v_B = 0;
struct PyPetscMatObject *__pyx_v_X = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_B,&__pyx_n_s_X,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("matSolveTranspose", 1, 2, 2, 1); __PYX_ERR(48, 411, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matSolveTranspose") < 0)) __PYX_ERR(48, 411, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_B = ((struct PyPetscMatObject *)values[0]);
__pyx_v_X = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("matSolveTranspose", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 411, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.matSolveTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_B), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(48, 411, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(48, 411, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_106matSolveTranspose(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_B, __pyx_v_X);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_106matSolveTranspose(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("matSolveTranspose", 0);
/* "petsc4py/PETSc/KSP.pyx":412
*
* def matSolveTranspose(self, Mat B, Mat X):
* CHKERR( KSPMatSolveTranspose(self.ksp, B.mat, X.mat) ) # <<<<<<<<<<<<<<
*
* def setIterationNumber(self, its):
*/
__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(48, 412, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":411
* CHKERR( KSPMatSolve(self.ksp, B.mat, X.mat) )
*
* def matSolveTranspose(self, Mat B, Mat X): # <<<<<<<<<<<<<<
* CHKERR( KSPMatSolveTranspose(self.ksp, B.mat, X.mat) )
*
*/
/* 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":414
* CHKERR( KSPMatSolveTranspose(self.ksp, B.mat, X.mat) )
*
* def setIterationNumber(self, its): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(its)
* CHKERR( KSPSetIterationNumber(self.ksp, ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_109setIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_108setIterationNumber[] = "KSP.setIterationNumber(self, its)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_109setIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_its = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_its)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setIterationNumber") < 0)) __PYX_ERR(48, 414, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_its = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setIterationNumber", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 414, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_108setIterationNumber(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_its);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_108setIterationNumber(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its) {
PetscInt __pyx_v_ival;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setIterationNumber", 0);
/* "petsc4py/PETSc/KSP.pyx":415
*
* def setIterationNumber(self, its):
* 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(48, 415, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/KSP.pyx":416
* def setIterationNumber(self, its):
* cdef PetscInt ival = asInt(its)
* CHKERR( KSPSetIterationNumber(self.ksp, ival) ) # <<<<<<<<<<<<<<
*
* def getIterationNumber(self):
*/
__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(48, 416, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":414
* CHKERR( KSPMatSolveTranspose(self.ksp, B.mat, X.mat) )
*
* def setIterationNumber(self, its): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(its)
* CHKERR( KSPSetIterationNumber(self.ksp, ival) )
*/
/* 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":418
* CHKERR( KSPSetIterationNumber(self.ksp, ival) )
*
* def getIterationNumber(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( KSPGetIterationNumber(self.ksp, &ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_111getIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_110getIterationNumber[] = "KSP.getIterationNumber(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_111getIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getIterationNumber (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getIterationNumber", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIterationNumber", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_110getIterationNumber(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_110getIterationNumber(struct PyPetscKSPObject *__pyx_v_self) {
PetscInt __pyx_v_ival;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getIterationNumber", 0);
/* "petsc4py/PETSc/KSP.pyx":419
*
* def getIterationNumber(self):
* cdef PetscInt ival = 0 # <<<<<<<<<<<<<<
* CHKERR( KSPGetIterationNumber(self.ksp, &ival) )
* return toInt(ival)
*/
__pyx_v_ival = 0;
/* "petsc4py/PETSc/KSP.pyx":420
* def getIterationNumber(self):
* 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(48, 420, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":421
* cdef PetscInt ival = 0
* CHKERR( KSPGetIterationNumber(self.ksp, &ival) )
* return toInt(ival) # <<<<<<<<<<<<<<
*
* def setResidualNorm(self, rnorm):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 421, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":418
* CHKERR( KSPSetIterationNumber(self.ksp, ival) )
*
* def getIterationNumber(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( KSPGetIterationNumber(self.ksp, &ival) )
*/
/* 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":423
* return toInt(ival)
*
* def setResidualNorm(self, rnorm): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(rnorm)
* CHKERR( KSPSetResidualNorm(self.ksp, rval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_113setResidualNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_112setResidualNorm[] = "KSP.setResidualNorm(self, rnorm)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_113setResidualNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rnorm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rnorm,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rnorm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setResidualNorm") < 0)) __PYX_ERR(48, 423, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_rnorm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setResidualNorm", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 423, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setResidualNorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_112setResidualNorm(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_rnorm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_112setResidualNorm(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rnorm) {
PetscReal __pyx_v_rval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscReal __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setResidualNorm", 0);
/* "petsc4py/PETSc/KSP.pyx":424
*
* def setResidualNorm(self, rnorm):
* 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(48, 424, __pyx_L1_error)
__pyx_v_rval = __pyx_t_1;
/* "petsc4py/PETSc/KSP.pyx":425
* def setResidualNorm(self, rnorm):
* cdef PetscReal rval = asReal(rnorm)
* CHKERR( KSPSetResidualNorm(self.ksp, rval) ) # <<<<<<<<<<<<<<
*
* def getResidualNorm(self):
*/
__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(48, 425, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":423
* return toInt(ival)
*
* def setResidualNorm(self, rnorm): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(rnorm)
* CHKERR( KSPSetResidualNorm(self.ksp, rval) )
*/
/* 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":427
* CHKERR( KSPSetResidualNorm(self.ksp, rval) )
*
* def getResidualNorm(self): # <<<<<<<<<<<<<<
* cdef PetscReal rval = 0
* CHKERR( KSPGetResidualNorm(self.ksp, &rval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_115getResidualNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_114getResidualNorm[] = "KSP.getResidualNorm(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_115getResidualNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getResidualNorm (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getResidualNorm", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getResidualNorm", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_114getResidualNorm(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_114getResidualNorm(struct PyPetscKSPObject *__pyx_v_self) {
PetscReal __pyx_v_rval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getResidualNorm", 0);
/* "petsc4py/PETSc/KSP.pyx":428
*
* def getResidualNorm(self):
* cdef PetscReal rval = 0 # <<<<<<<<<<<<<<
* CHKERR( KSPGetResidualNorm(self.ksp, &rval) )
* return toReal(rval)
*/
__pyx_v_rval = 0.0;
/* "petsc4py/PETSc/KSP.pyx":429
* def getResidualNorm(self):
* 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(48, 429, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":430
* cdef PetscReal rval = 0
* CHKERR( KSPGetResidualNorm(self.ksp, &rval) )
* return toReal(rval) # <<<<<<<<<<<<<<
*
* def setConvergedReason(self, reason):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 430, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":427
* CHKERR( KSPSetResidualNorm(self.ksp, rval) )
*
* def getResidualNorm(self): # <<<<<<<<<<<<<<
* cdef PetscReal rval = 0
* CHKERR( KSPGetResidualNorm(self.ksp, &rval) )
*/
/* 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":432
* return toReal(rval)
*
* def setConvergedReason(self, reason): # <<<<<<<<<<<<<<
* cdef PetscKSPConvergedReason val = reason
* CHKERR( KSPSetConvergedReason(self.ksp, val) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_117setConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_116setConvergedReason[] = "KSP.setConvergedReason(self, reason)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_117setConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_reason = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reason,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reason)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConvergedReason") < 0)) __PYX_ERR(48, 432, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_reason = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 432, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_116setConvergedReason(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_reason);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_116setConvergedReason(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_reason) {
KSPConvergedReason __pyx_v_val;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
KSPConvergedReason __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setConvergedReason", 0);
/* "petsc4py/PETSc/KSP.pyx":433
*
* def setConvergedReason(self, reason):
* cdef PetscKSPConvergedReason val = reason # <<<<<<<<<<<<<<
* CHKERR( KSPSetConvergedReason(self.ksp, val) )
*
*/
__pyx_t_1 = ((KSPConvergedReason)__Pyx_PyInt_As_KSPConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 433, __pyx_L1_error)
__pyx_v_val = __pyx_t_1;
/* "petsc4py/PETSc/KSP.pyx":434
* def setConvergedReason(self, reason):
* cdef PetscKSPConvergedReason val = reason
* CHKERR( KSPSetConvergedReason(self.ksp, val) ) # <<<<<<<<<<<<<<
*
* def getConvergedReason(self):
*/
__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(48, 434, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":432
* return toReal(rval)
*
* def setConvergedReason(self, reason): # <<<<<<<<<<<<<<
* cdef PetscKSPConvergedReason val = reason
* CHKERR( KSPSetConvergedReason(self.ksp, val) )
*/
/* 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":436
* CHKERR( KSPSetConvergedReason(self.ksp, val) )
*
* def getConvergedReason(self): # <<<<<<<<<<<<<<
* cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING
* CHKERR( KSPGetConvergedReason(self.ksp, &reason) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_119getConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_118getConvergedReason[] = "KSP.getConvergedReason(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_119getConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getConvergedReason (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getConvergedReason", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergedReason", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_118getConvergedReason(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_118getConvergedReason(struct PyPetscKSPObject *__pyx_v_self) {
KSPConvergedReason __pyx_v_reason;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getConvergedReason", 0);
/* "petsc4py/PETSc/KSP.pyx":437
*
* def getConvergedReason(self):
* cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING # <<<<<<<<<<<<<<
* CHKERR( KSPGetConvergedReason(self.ksp, &reason) )
* return reason
*/
__pyx_v_reason = KSP_CONVERGED_ITERATING;
/* "petsc4py/PETSc/KSP.pyx":438
* def getConvergedReason(self):
* 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(48, 438, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":439
* cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING
* CHKERR( KSPGetConvergedReason(self.ksp, &reason) )
* return reason # <<<<<<<<<<<<<<
*
* def setErrorIfNotConverged(self, bint flag):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_KSPConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 439, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":436
* CHKERR( KSPSetConvergedReason(self.ksp, val) )
*
* def getConvergedReason(self): # <<<<<<<<<<<<<<
* cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING
* CHKERR( KSPGetConvergedReason(self.ksp, &reason) )
*/
/* 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":441
* return reason
*
* def setErrorIfNotConverged(self, bint flag): # <<<<<<<<<<<<<<
* cdef PetscBool ernc = PETSC_FALSE
* if flag: ernc = PETSC_TRUE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_121setErrorIfNotConverged(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_120setErrorIfNotConverged[] = "KSP.setErrorIfNotConverged(self, bool flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_121setErrorIfNotConverged(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_flag;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setErrorIfNotConverged (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setErrorIfNotConverged") < 0)) __PYX_ERR(48, 441, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(48, 441, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setErrorIfNotConverged", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 441, __pyx_L3_error)
__pyx_L3_error:;
__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_120setErrorIfNotConverged(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_120setErrorIfNotConverged(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag) {
PetscBool __pyx_v_ernc;
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("setErrorIfNotConverged", 0);
/* "petsc4py/PETSc/KSP.pyx":442
*
* def setErrorIfNotConverged(self, bint flag):
* cdef PetscBool ernc = PETSC_FALSE # <<<<<<<<<<<<<<
* if flag: ernc = PETSC_TRUE
* CHKERR( KSPSetErrorIfNotConverged(self.ksp, ernc) )
*/
__pyx_v_ernc = PETSC_FALSE;
/* "petsc4py/PETSc/KSP.pyx":443
* def setErrorIfNotConverged(self, bint flag):
* cdef PetscBool ernc = PETSC_FALSE
* if flag: ernc = PETSC_TRUE # <<<<<<<<<<<<<<
* CHKERR( KSPSetErrorIfNotConverged(self.ksp, ernc) )
*
*/
__pyx_t_1 = (__pyx_v_flag != 0);
if (__pyx_t_1) {
__pyx_v_ernc = PETSC_TRUE;
}
/* "petsc4py/PETSc/KSP.pyx":444
* cdef PetscBool ernc = PETSC_FALSE
* if flag: ernc = PETSC_TRUE
* CHKERR( KSPSetErrorIfNotConverged(self.ksp, ernc) ) # <<<<<<<<<<<<<<
*
* def getErrorIfNotConverged(self):
*/
__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(48, 444, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":441
* return reason
*
* def setErrorIfNotConverged(self, bint flag): # <<<<<<<<<<<<<<
* cdef PetscBool ernc = PETSC_FALSE
* if flag: ernc = PETSC_TRUE
*/
/* 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":446
* CHKERR( KSPSetErrorIfNotConverged(self.ksp, ernc) )
*
* def getErrorIfNotConverged(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( KSPGetErrorIfNotConverged(self.ksp, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_123getErrorIfNotConverged(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_122getErrorIfNotConverged[] = "KSP.getErrorIfNotConverged(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_123getErrorIfNotConverged(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getErrorIfNotConverged (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getErrorIfNotConverged", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getErrorIfNotConverged", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_122getErrorIfNotConverged(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_122getErrorIfNotConverged(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":447
*
* def getErrorIfNotConverged(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( KSPGetErrorIfNotConverged(self.ksp, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/KSP.pyx":448
* def getErrorIfNotConverged(self):
* 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(48, 448, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":449
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( KSPGetErrorIfNotConverged(self.ksp, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def getRhs(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 449, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":446
* CHKERR( KSPSetErrorIfNotConverged(self.ksp, ernc) )
*
* def getErrorIfNotConverged(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( KSPGetErrorIfNotConverged(self.ksp, &flag) )
*/
/* 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":451
* return toBool(flag)
*
* def getRhs(self): # <<<<<<<<<<<<<<
* cdef Vec vec = Vec()
* CHKERR( KSPGetRhs(self.ksp, &vec.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_125getRhs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_124getRhs[] = "KSP.getRhs(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_125getRhs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getRhs (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getRhs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRhs", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_124getRhs(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_124getRhs(struct PyPetscKSPObject *__pyx_v_self) {
struct PyPetscVecObject *__pyx_v_vec = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getRhs", 0);
/* "petsc4py/PETSc/KSP.pyx":452
*
* def getRhs(self):
* cdef Vec vec = Vec() # <<<<<<<<<<<<<<
* CHKERR( KSPGetRhs(self.ksp, &vec.vec) )
* PetscINCREF(vec.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 452, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/KSP.pyx":453
* def getRhs(self):
* cdef Vec vec = Vec()
* CHKERR( KSPGetRhs(self.ksp, &vec.vec) ) # <<<<<<<<<<<<<<
* PetscINCREF(vec.obj)
* return vec
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetRhs(__pyx_v_self->ksp, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 453, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":454
* cdef Vec vec = Vec()
* CHKERR( KSPGetRhs(self.ksp, &vec.vec) )
* PetscINCREF(vec.obj) # <<<<<<<<<<<<<<
* return vec
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj));
/* "petsc4py/PETSc/KSP.pyx":455
* CHKERR( KSPGetRhs(self.ksp, &vec.vec) )
* PetscINCREF(vec.obj)
* return vec # <<<<<<<<<<<<<<
*
* def getSolution(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_vec));
__pyx_r = ((PyObject *)__pyx_v_vec);
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":451
* return toBool(flag)
*
* def getRhs(self): # <<<<<<<<<<<<<<
* cdef Vec vec = Vec()
* CHKERR( KSPGetRhs(self.ksp, &vec.vec) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.getRhs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_vec);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":457
* return vec
*
* def getSolution(self): # <<<<<<<<<<<<<<
* cdef Vec vec = Vec()
* CHKERR( KSPGetSolution(self.ksp, &vec.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_127getSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_126getSolution[] = "KSP.getSolution(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_127getSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getSolution (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getSolution", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolution", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_126getSolution(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_126getSolution(struct PyPetscKSPObject *__pyx_v_self) {
struct PyPetscVecObject *__pyx_v_vec = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getSolution", 0);
/* "petsc4py/PETSc/KSP.pyx":458
*
* def getSolution(self):
* cdef Vec vec = Vec() # <<<<<<<<<<<<<<
* CHKERR( KSPGetSolution(self.ksp, &vec.vec) )
* PetscINCREF(vec.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/KSP.pyx":459
* def getSolution(self):
* cdef Vec vec = Vec()
* CHKERR( KSPGetSolution(self.ksp, &vec.vec) ) # <<<<<<<<<<<<<<
* PetscINCREF(vec.obj)
* return vec
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetSolution(__pyx_v_self->ksp, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 459, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":460
* cdef Vec vec = Vec()
* CHKERR( KSPGetSolution(self.ksp, &vec.vec) )
* PetscINCREF(vec.obj) # <<<<<<<<<<<<<<
* return vec
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj));
/* "petsc4py/PETSc/KSP.pyx":461
* CHKERR( KSPGetSolution(self.ksp, &vec.vec) )
* PetscINCREF(vec.obj)
* return vec # <<<<<<<<<<<<<<
*
* def getWorkVecs(self, right=None, left=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_vec));
__pyx_r = ((PyObject *)__pyx_v_vec);
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":457
* return vec
*
* def getSolution(self): # <<<<<<<<<<<<<<
* cdef Vec vec = Vec()
* CHKERR( KSPGetSolution(self.ksp, &vec.vec) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_vec);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":463
* return vec
*
* def getWorkVecs(self, right=None, left=None): # <<<<<<<<<<<<<<
* cdef bint R = right is not None
* cdef bint L = left is not None
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_129getWorkVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_128getWorkVecs[] = "KSP.getWorkVecs(self, right=None, left=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_129getWorkVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_right = 0;
PyObject *__pyx_v_left = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_right,&__pyx_n_s_left,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_right);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_left);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getWorkVecs") < 0)) __PYX_ERR(48, 463, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_right = values[0];
__pyx_v_left = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getWorkVecs", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 463, __pyx_L3_error)
__pyx_L3_error:;
__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_128getWorkVecs(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_right, __pyx_v_left);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_128getWorkVecs(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":464
*
* def getWorkVecs(self, right=None, left=None):
* 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":465
* def getWorkVecs(self, right=None, left=None):
* 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":466
* 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":467
* 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":468
* 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
*/
__pyx_t_1 = (__pyx_v_R != 0);
if (__pyx_t_1) {
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_right); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 468, __pyx_L1_error)
__pyx_v_nr = __pyx_t_2;
}
/* "petsc4py/PETSc/KSP.pyx":469
* 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
*/
__pyx_t_1 = (__pyx_v_L != 0);
if (__pyx_t_1) {
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_left); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 469, __pyx_L1_error)
__pyx_v_nl = __pyx_t_2;
}
/* "petsc4py/PETSc/KSP.pyx":470
* 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 != 0)) {
__pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 470, __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":471
* 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 != 0)) {
__pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 471, __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":472
* 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(48, 472, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":473
* 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":474
* 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":475
* 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(48, 475, __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(48, 475, __pyx_L6_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
/* "petsc4py/PETSc/KSP.pyx":476
* 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":477
* 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(48, 477, __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(48, 477, __pyx_L6_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
}
/* "petsc4py/PETSc/KSP.pyx":479
* 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) != 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) != 0);
__pyx_t_1 = __pyx_t_7;
__pyx_L13_bool_binop_done:;
if (__pyx_t_1) {
/* "petsc4py/PETSc/KSP.pyx":480
* 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":479
* 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":481
* 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) != 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) != 0);
__pyx_t_1 = __pyx_t_7;
__pyx_L16_bool_binop_done:;
if (__pyx_t_1) {
/* "petsc4py/PETSc/KSP.pyx":482
* 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":481
* if nr > 0 and vr != NULL:
* VecDestroyVecs(nr, &vr) # XXX errors?
* if nl > 0 and vl !=NULL: # <<<<<<<<<<<<<<
* VecDestroyVecs(nl, &vl) # XXX errors?
* #
*/
}
goto __pyx_L7;
}
__pyx_L6_error:;
/*exception exit:*/{
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
__Pyx_XGOTREF(__pyx_t_11);
__Pyx_XGOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_t_13);
__Pyx_XGOTREF(__pyx_t_14);
__Pyx_XGOTREF(__pyx_t_15);
__Pyx_XGOTREF(__pyx_t_16);
__pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
{
/* "petsc4py/PETSc/KSP.pyx":479
* 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) != 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) != 0);
__pyx_t_1 = __pyx_t_7;
__pyx_L21_bool_binop_done:;
if (__pyx_t_1) {
/* "petsc4py/PETSc/KSP.pyx":480
* 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":479
* 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":481
* 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) != 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) != 0);
__pyx_t_1 = __pyx_t_7;
__pyx_L24_bool_binop_done:;
if (__pyx_t_1) {
/* "petsc4py/PETSc/KSP.pyx":482
* 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":481
* if nr > 0 and vr != NULL:
* VecDestroyVecs(nr, &vr) # XXX errors?
* if nl > 0 and vl !=NULL: # <<<<<<<<<<<<<<
* VecDestroyVecs(nl, &vl) # XXX errors?
* #
*/
}
}
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_14);
__Pyx_XGIVEREF(__pyx_t_15);
__Pyx_XGIVEREF(__pyx_t_16);
__Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
}
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
__pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
__pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
goto __pyx_L1_error;
}
__pyx_L7:;
}
/* "petsc4py/PETSc/KSP.pyx":484
* VecDestroyVecs(nl, &vl) # XXX errors?
* #
* if R and L: return (vecsr, vecsl) # <<<<<<<<<<<<<<
* elif R: return vecsr
* elif L: return vecsl
*/
__pyx_t_7 = (__pyx_v_R != 0);
if (__pyx_t_7) {
} else {
__pyx_t_1 = __pyx_t_7;
goto __pyx_L27_bool_binop_done;
}
__pyx_t_7 = (__pyx_v_L != 0);
__pyx_t_1 = __pyx_t_7;
__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(48, 484, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_vecsr);
__Pyx_GIVEREF(__pyx_v_vecsr);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_vecsr);
__Pyx_INCREF(__pyx_v_vecsl);
__Pyx_GIVEREF(__pyx_v_vecsl);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vecsl);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
/* "petsc4py/PETSc/KSP.pyx":485
* #
* if R and L: return (vecsr, vecsl)
* elif R: return vecsr # <<<<<<<<<<<<<<
* elif L: return vecsl
* else: return None
*/
__pyx_t_1 = (__pyx_v_R != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_vecsr);
__pyx_r = __pyx_v_vecsr;
goto __pyx_L0;
}
/* "petsc4py/PETSc/KSP.pyx":486
* if R and L: return (vecsr, vecsl)
* elif R: return vecsr
* elif L: return vecsl # <<<<<<<<<<<<<<
* else: return None
*
*/
__pyx_t_1 = (__pyx_v_L != 0);
if (__pyx_t_1) {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_vecsl);
__pyx_r = __pyx_v_vecsl;
goto __pyx_L0;
}
/* "petsc4py/PETSc/KSP.pyx":487
* elif R: return vecsr
* elif L: return vecsl
* else: return None # <<<<<<<<<<<<<<
*
* def buildSolution(self, Vec x=None):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/KSP.pyx":463
* return vec
*
* def getWorkVecs(self, right=None, left=None): # <<<<<<<<<<<<<<
* cdef bint R = right is not None
* cdef bint L = left is not 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":489
* else: return None
*
* def buildSolution(self, Vec x=None): # <<<<<<<<<<<<<<
* if x is None: x = Vec()
* if x.vec == NULL:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_131buildSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_130buildSolution[] = "KSP.buildSolution(self, Vec x=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_131buildSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildSolution") < 0)) __PYX_ERR(48, 489, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("buildSolution", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 489, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.buildSolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(48, 489, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_130buildSolution(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_x);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_130buildSolution(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("buildSolution", 0);
__Pyx_INCREF((PyObject *)__pyx_v_x);
/* "petsc4py/PETSc/KSP.pyx":490
*
* def buildSolution(self, Vec x=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 490, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_x, ((struct PyPetscVecObject *)__pyx_t_3));
__pyx_t_3 = 0;
}
/* "petsc4py/PETSc/KSP.pyx":491
* def buildSolution(self, Vec x=None):
* if x is None: x = Vec()
* if x.vec == NULL: # <<<<<<<<<<<<<<
* CHKERR( KSPGetSolution(self.ksp, &x.vec) )
* CHKERR( VecDuplicate(x.vec, &x.vec) )
*/
__pyx_t_2 = ((__pyx_v_x->vec == NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/KSP.pyx":492
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetSolution(__pyx_v_self->ksp, (&__pyx_v_x->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 492, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":493
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_x->vec, (&__pyx_v_x->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 493, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":491
* def buildSolution(self, Vec x=None):
* 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":494
* CHKERR( KSPGetSolution(self.ksp, &x.vec) )
* CHKERR( VecDuplicate(x.vec, &x.vec) )
* CHKERR( KSPBuildSolution(self.ksp, x.vec, NULL) ) # <<<<<<<<<<<<<<
* return x
*
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPBuildSolution(__pyx_v_self->ksp, __pyx_v_x->vec, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 494, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":495
* CHKERR( VecDuplicate(x.vec, &x.vec) )
* CHKERR( KSPBuildSolution(self.ksp, x.vec, NULL) )
* return x # <<<<<<<<<<<<<<
*
* def buildResidual(self, Vec r=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_x));
__pyx_r = ((PyObject *)__pyx_v_x);
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":489
* else: return None
*
* def buildSolution(self, Vec x=None): # <<<<<<<<<<<<<<
* if x is None: x = Vec()
* if x.vec == NULL:
*/
/* function exit code */
__pyx_L1_error:;
__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":497
* return x
*
* def buildResidual(self, Vec r=None): # <<<<<<<<<<<<<<
* if r is None: r = Vec()
* if r.vec == NULL:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_133buildResidual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_132buildResidual[] = "KSP.buildResidual(self, Vec r=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_133buildResidual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_r = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_r,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildResidual") < 0)) __PYX_ERR(48, 497, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_r = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("buildResidual", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 497, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.KSP.buildResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_r), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "r", 0))) __PYX_ERR(48, 497, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_132buildResidual(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_r);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_132buildResidual(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_r) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("buildResidual", 0);
__Pyx_INCREF((PyObject *)__pyx_v_r);
/* "petsc4py/PETSc/KSP.pyx":498
*
* def buildResidual(self, Vec r=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 498, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_r, ((struct PyPetscVecObject *)__pyx_t_3));
__pyx_t_3 = 0;
}
/* "petsc4py/PETSc/KSP.pyx":499
* def buildResidual(self, Vec r=None):
* if r is None: r = Vec()
* if r.vec == NULL: # <<<<<<<<<<<<<<
* CHKERR( KSPGetRhs(self.ksp, &r.vec) )
* CHKERR( VecDuplicate(r.vec, &r.vec) )
*/
__pyx_t_2 = ((__pyx_v_r->vec == NULL) != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/KSP.pyx":500
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetRhs(__pyx_v_self->ksp, (&__pyx_v_r->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 500, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":501
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_r->vec, (&__pyx_v_r->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 501, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":499
* def buildResidual(self, Vec r=None):
* 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":502
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPBuildResidual(__pyx_v_self->ksp, NULL, __pyx_v_r->vec, (&__pyx_v_r->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 502, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":503
* CHKERR( VecDuplicate(r.vec, &r.vec) )
* CHKERR( KSPBuildResidual(self.ksp , NULL, r.vec, &r.vec) )
* return r # <<<<<<<<<<<<<<
*
* def computeEigenvalues(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_r));
__pyx_r = ((PyObject *)__pyx_v_r);
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":497
* return x
*
* def buildResidual(self, Vec r=None): # <<<<<<<<<<<<<<
* if r is None: r = Vec()
* if r.vec == NULL:
*/
/* function exit code */
__pyx_L1_error:;
__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":505
* return r
*
* def computeEigenvalues(self): # <<<<<<<<<<<<<<
* cdef PetscInt its = 0
* cdef PetscInt neig = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_135computeEigenvalues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_134computeEigenvalues[] = "KSP.computeEigenvalues(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_135computeEigenvalues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("computeEigenvalues (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("computeEigenvalues", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "computeEigenvalues", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_134computeEigenvalues(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_134computeEigenvalues(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":506
*
* def computeEigenvalues(self):
* cdef PetscInt its = 0 # <<<<<<<<<<<<<<
* cdef PetscInt neig = 0
* cdef PetscReal *rdata = NULL
*/
__pyx_v_its = 0;
/* "petsc4py/PETSc/KSP.pyx":507
* def computeEigenvalues(self):
* cdef PetscInt its = 0
* cdef PetscInt neig = 0 # <<<<<<<<<<<<<<
* cdef PetscReal *rdata = NULL
* cdef PetscReal *idata = NULL
*/
__pyx_v_neig = 0;
/* "petsc4py/PETSc/KSP.pyx":508
* 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":509
* 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":510
* 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(48, 510, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":511
* 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(48, 511, __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(48, 511, __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":512
* 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(48, 512, __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(48, 512, __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":513
* 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(48, 513, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":514
* 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(48, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_eigen = ((PyArrayObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/KSP.pyx":515
* 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(48, 515, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_eigen), __pyx_n_s_real, __pyx_t_2) < 0) __PYX_ERR(48, 515, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/KSP.pyx":516
* 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(48, 516, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_eigen), __pyx_n_s_imag, __pyx_t_2) < 0) __PYX_ERR(48, 516, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/KSP.pyx":517
* eigen.real = r[:neig]
* eigen.imag = i[:neig]
* return eigen # <<<<<<<<<<<<<<
*
* def computeExtremeSingularValues(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_eigen));
__pyx_r = ((PyObject *)__pyx_v_eigen);
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":505
* return r
*
* def computeEigenvalues(self): # <<<<<<<<<<<<<<
* cdef PetscInt its = 0
* cdef PetscInt neig = 0
*/
/* 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":519
* return eigen
*
* def computeExtremeSingularValues(self): # <<<<<<<<<<<<<<
* cdef PetscReal smax = 0
* cdef PetscReal smin = 0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_137computeExtremeSingularValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_136computeExtremeSingularValues[] = "KSP.computeExtremeSingularValues(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_137computeExtremeSingularValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("computeExtremeSingularValues (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("computeExtremeSingularValues", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "computeExtremeSingularValues", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_136computeExtremeSingularValues(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_136computeExtremeSingularValues(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":520
*
* def computeExtremeSingularValues(self):
* cdef PetscReal smax = 0 # <<<<<<<<<<<<<<
* cdef PetscReal smin = 0
* CHKERR( KSPComputeExtremeSingularValues(self.ksp, &smax, &smin) )
*/
__pyx_v_smax = 0.0;
/* "petsc4py/PETSc/KSP.pyx":521
* def computeExtremeSingularValues(self):
* cdef PetscReal smax = 0
* cdef PetscReal smin = 0 # <<<<<<<<<<<<<<
* CHKERR( KSPComputeExtremeSingularValues(self.ksp, &smax, &smin) )
* return smax, smin
*/
__pyx_v_smin = 0.0;
/* "petsc4py/PETSc/KSP.pyx":522
* cdef PetscReal smax = 0
* cdef PetscReal smin = 0
* CHKERR( KSPComputeExtremeSingularValues(self.ksp, &smax, &smin) ) # <<<<<<<<<<<<<<
* return smax, 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(48, 522, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":523
* cdef PetscReal smin = 0
* CHKERR( KSPComputeExtremeSingularValues(self.ksp, &smax, &smin) )
* return smax, smin # <<<<<<<<<<<<<<
*
* # --- GMRES ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = PyFloat_FromDouble(__pyx_v_smax); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 523, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = PyFloat_FromDouble(__pyx_v_smin); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 523, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 523, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":519
* return eigen
*
* def computeExtremeSingularValues(self): # <<<<<<<<<<<<<<
* cdef PetscReal smax = 0
* cdef PetscReal smin = 0
*/
/* 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":527
* # --- GMRES ---
*
* def setGMRESRestart(self, restart): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(restart)
* CHKERR( KSPGMRESSetRestart(self.ksp, ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_139setGMRESRestart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_138setGMRESRestart[] = "KSP.setGMRESRestart(self, restart)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_139setGMRESRestart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_restart = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_restart,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_restart)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGMRESRestart") < 0)) __PYX_ERR(48, 527, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_restart = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setGMRESRestart", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 527, __pyx_L3_error)
__pyx_L3_error:;
__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_138setGMRESRestart(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_restart);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_138setGMRESRestart(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":528
*
* def setGMRESRestart(self, restart):
* 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(48, 528, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/KSP.pyx":529
* def setGMRESRestart(self, restart):
* 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(48, 529, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":527
* # --- GMRES ---
*
* def setGMRESRestart(self, restart): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(restart)
* CHKERR( KSPGMRESSetRestart(self.ksp, ival) )
*/
/* 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":533
* # --- Python ---
*
* def createPython(self, context=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscKSP newksp = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_141createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_140createPython[] = "KSP.createPython(self, context=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_141createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_context = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_comm,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createPython") < 0)) __PYX_ERR(48, 533, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_context = values[0];
__pyx_v_comm = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createPython", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 533, __pyx_L3_error)
__pyx_L3_error:;
__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_140createPython(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_140createPython(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":534
*
* def createPython(self, context=None, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(48, 534, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/KSP.pyx":535
* def createPython(self, context=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscKSP newksp = NULL # <<<<<<<<<<<<<<
* CHKERR( KSPCreate(ccomm, &newksp) )
* PetscCLEAR(self.obj); self.ksp = newksp
*/
__pyx_v_newksp = NULL;
/* "petsc4py/PETSc/KSP.pyx":536
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscKSP newksp = NULL
* CHKERR( KSPCreate(ccomm, &newksp) ) # <<<<<<<<<<<<<<
* 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(48, 536, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":537
* cdef PetscKSP newksp = NULL
* CHKERR( KSPCreate(ccomm, &newksp) )
* PetscCLEAR(self.obj); self.ksp = newksp # <<<<<<<<<<<<<<
* CHKERR( KSPSetType(self.ksp, KSPPYTHON) )
* CHKERR( KSPPythonSetContext(self.ksp, <void*>context) )
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->ksp = __pyx_v_newksp;
/* "petsc4py/PETSc/KSP.pyx":538
* CHKERR( KSPCreate(ccomm, &newksp) )
* 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(48, 538, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":539
* 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(48, 539, __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, 539, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":540
* CHKERR( KSPSetType(self.ksp, KSPPYTHON) )
* CHKERR( KSPPythonSetContext(self.ksp, <void*>context) )
* return self # <<<<<<<<<<<<<<
*
* def setPythonContext(self, context):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":533
* # --- Python ---
*
* def createPython(self, context=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscKSP newksp = NULL
*/
/* 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":542
* return self
*
* def setPythonContext(self, context): # <<<<<<<<<<<<<<
* CHKERR( KSPPythonSetContext(self.ksp, <void*>context) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_143setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_142setPythonContext[] = "KSP.setPythonContext(self, context)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_143setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_context = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonContext") < 0)) __PYX_ERR(48, 542, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_context = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 542, __pyx_L3_error)
__pyx_L3_error:;
__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_142setPythonContext(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_context);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_142setPythonContext(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":543
*
* def setPythonContext(self, context):
* CHKERR( KSPPythonSetContext(self.ksp, <void*>context) ) # <<<<<<<<<<<<<<
*
* def getPythonContext(self):
*/
__pyx_t_1 = KSPPythonSetContext(__pyx_v_self->ksp, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 543, __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, 543, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":542
* return self
*
* def setPythonContext(self, context): # <<<<<<<<<<<<<<
* CHKERR( KSPPythonSetContext(self.ksp, <void*>context) )
*
*/
/* 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":545
* CHKERR( KSPPythonSetContext(self.ksp, <void*>context) )
*
* def getPythonContext(self): # <<<<<<<<<<<<<<
* cdef void *context = NULL
* CHKERR( KSPPythonGetContext(self.ksp, &context) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_145getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_144getPythonContext[] = "KSP.getPythonContext(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_145getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getPythonContext (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getPythonContext", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonContext", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_144getPythonContext(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_144getPythonContext(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":546
*
* def getPythonContext(self):
* cdef void *context = NULL # <<<<<<<<<<<<<<
* CHKERR( KSPPythonGetContext(self.ksp, &context) )
* if context == NULL: return None
*/
__pyx_v_context = NULL;
/* "petsc4py/PETSc/KSP.pyx":547
* def getPythonContext(self):
* 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(48, 547, __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, 547, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":548
* 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) != 0);
if (__pyx_t_3) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/KSP.pyx":549
* CHKERR( KSPPythonGetContext(self.ksp, &context) )
* if context == NULL: return None
* else: return <object> context # <<<<<<<<<<<<<<
*
* def setPythonType(self, py_type):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_context));
__pyx_r = ((PyObject *)__pyx_v_context);
goto __pyx_L0;
}
/* "petsc4py/PETSc/KSP.pyx":545
* CHKERR( KSPPythonSetContext(self.ksp, <void*>context) )
*
* def getPythonContext(self): # <<<<<<<<<<<<<<
* cdef void *context = NULL
* CHKERR( KSPPythonGetContext(self.ksp, &context) )
*/
/* 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":551
* else: return <object> context
*
* def setPythonType(self, py_type): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* py_type = str2bytes(py_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_147setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_146setPythonType[] = "KSP.setPythonType(self, py_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_147setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_py_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_py_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonType") < 0)) __PYX_ERR(48, 551, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_py_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 551, __pyx_L3_error)
__pyx_L3_error:;
__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_146setPythonType(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_py_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_146setPythonType(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":552
*
* def setPythonType(self, py_type):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* py_type = str2bytes(py_type, &cval)
* CHKERR( KSPPythonSetType(self.ksp, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/KSP.pyx":553
* def setPythonType(self, py_type):
* 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(48, 553, __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":554
* cdef const char *cval = NULL
* py_type = str2bytes(py_type, &cval)
* CHKERR( KSPPythonSetType(self.ksp, cval) ) # <<<<<<<<<<<<<<
*
* def getPythonType(self):
*/
__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(48, 554, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":551
* else: return <object> context
*
* def setPythonType(self, py_type): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* py_type = str2bytes(py_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":556
* CHKERR( KSPPythonSetType(self.ksp, cval) )
*
* def getPythonType(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( KSPPythonGetType(self.ksp, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_149getPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_3KSP_148getPythonType[] = "KSP.getPythonType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_149getPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getPythonType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getPythonType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_148getPythonType(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_148getPythonType(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":557
*
* def getPythonType(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( KSPPythonGetType(self.ksp, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/KSP.pyx":558
* def getPythonType(self):
* 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(48, 558, __pyx_L1_error)
/* "petsc4py/PETSc/KSP.pyx":559
* 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(48, 559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":556
* CHKERR( KSPPythonSetType(self.ksp, cval) )
*
* def getPythonType(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( KSPPythonGetType(self.ksp, &cval) )
*/
/* 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":564
*
* property appctx:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getAppCtx()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6appctx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6appctx_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6appctx___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6appctx___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":565
* property appctx:
* def __get__(self):
* return self.getAppCtx() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setAppCtx(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 565, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 565, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":564
*
* property appctx:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getAppCtx()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.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":566
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6appctx_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3KSP_6appctx_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/KSP.pyx":567
* return self.getAppCtx()
* def __set__(self, value):
* self.setAppCtx(value) # <<<<<<<<<<<<<<
*
* # --- discretization space ---
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 567, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 567, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/KSP.pyx":566
* def __get__(self):
* return self.getAppCtx()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setAppCtx(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.appctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":572
*
* property dm:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getDM()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_2dm_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_2dm_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_2dm___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2dm___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":573
* property dm:
* def __get__(self):
* return self.getDM() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setDM(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 573, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":572
*
* property dm:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getDM()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.dm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":574
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_2dm_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3KSP_2dm_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/KSP.pyx":575
* return self.getDM()
* def __set__(self, value):
* self.setDM(value) # <<<<<<<<<<<<<<
*
* # --- vectors ---
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 575, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 575, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/KSP.pyx":574
* def __get__(self):
* return self.getDM()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setDM(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.dm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":580
*
* property vec_sol:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_7vec_sol___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7vec_sol___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":581
* property vec_sol:
* def __get__(self):
* return self.getSolution() # <<<<<<<<<<<<<<
*
* property vec_rhs:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolution); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 581, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 581, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":580
*
* property vec_sol:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getSolution()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.vec_sol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":584
*
* property vec_rhs:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_7vec_rhs___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7vec_rhs___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":585
* property vec_rhs:
* def __get__(self):
* return self.getRhs() # <<<<<<<<<<<<<<
*
* # --- operators ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getRhs); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 585, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 585, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":584
*
* property vec_rhs:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getRhs()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.vec_rhs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":590
*
* property mat_op:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6mat_op___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6mat_op___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":591
* property mat_op:
* def __get__(self):
* return self.getOperators()[0] # <<<<<<<<<<<<<<
*
* property mat_pc:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOperators); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 591, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 591, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 591, __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":590
*
* property mat_op:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getOperators()[0]
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.mat_op.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":594
*
* property mat_pc:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6mat_pc___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6mat_pc___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":595
* property mat_pc:
* def __get__(self):
* return self.getOperators()[1] # <<<<<<<<<<<<<<
*
* # --- initial guess ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOperators); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 595, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 595, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 595, __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":594
*
* property mat_pc:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getOperators()[1]
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.mat_pc.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":600
*
* property guess_nonzero:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getInitialGuessNonzero()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_13guess_nonzero_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_13guess_nonzero_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":601
* property guess_nonzero:
* def __get__(self):
* return self.getInitialGuessNonzero() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setInitialGuessNonzero(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getInitialGuessNonzero); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 601, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":600
*
* property guess_nonzero:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getInitialGuessNonzero()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.guess_nonzero.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":602
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/KSP.pyx":603
* return self.getInitialGuessNonzero()
* def __set__(self, value):
* self.setInitialGuessNonzero(value) # <<<<<<<<<<<<<<
*
* property guess_knoll:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setInitialGuessNonzero); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/KSP.pyx":602
* def __get__(self):
* return self.getInitialGuessNonzero()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setInitialGuessNonzero(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.guess_nonzero.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":606
*
* property guess_knoll:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getInitialGuessKnoll()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_11guess_knoll_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_11guess_knoll_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":607
* property guess_knoll:
* def __get__(self):
* return self.getInitialGuessKnoll() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setInitialGuessKnoll(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getInitialGuessKnoll); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 607, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 607, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":606
*
* property guess_knoll:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getInitialGuessKnoll()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.guess_knoll.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":608
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/KSP.pyx":609
* return self.getInitialGuessKnoll()
* def __set__(self, value):
* self.setInitialGuessKnoll(value) # <<<<<<<<<<<<<<
*
* # --- preconditioner ---
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setInitialGuessKnoll); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/KSP.pyx":608
* def __get__(self):
* return self.getInitialGuessKnoll()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setInitialGuessKnoll(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.guess_knoll.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":614
*
* property pc:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_2pc___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2pc___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":615
* property pc:
* def __get__(self):
* return self.getPC() # <<<<<<<<<<<<<<
*
* property pc_side:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getPC); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":614
*
* property pc:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getPC()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.pc.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":618
*
* property pc_side:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getPCSide()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7pc_side_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7pc_side_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":619
* property pc_side:
* def __get__(self):
* return self.getPCSide() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setPCSide(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getPCSide); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 619, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":618
*
* property pc_side:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getPCSide()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.pc_side.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":620
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/KSP.pyx":621
* return self.getPCSide()
* def __set__(self, value):
* self.setPCSide(value) # <<<<<<<<<<<<<<
*
* property norm_type:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setPCSide); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 621, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 621, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/KSP.pyx":620
* def __get__(self):
* return self.getPCSide()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setPCSide(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.pc_side.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":624
*
* property norm_type:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getNormType()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9norm_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9norm_type_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":625
* property norm_type:
* def __get__(self):
* return self.getNormType() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setNormType(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getNormType); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 625, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 625, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":624
*
* property norm_type:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getNormType()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.norm_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":626
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/KSP.pyx":627
* return self.getNormType()
* def __set__(self, value):
* self.setNormType(value) # <<<<<<<<<<<<<<
*
* # --- tolerances ---
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setNormType); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 627, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 627, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/KSP.pyx":626
* def __get__(self):
* return self.getNormType()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setNormType(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.norm_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":632
*
* property rtol:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[0]
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4rtol_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4rtol_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4rtol___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4rtol___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":633
* property rtol:
* def __get__(self):
* return self.getTolerances()[0] # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setTolerances(rtol=value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 633, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 633, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 633, __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":632
*
* property rtol:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[0]
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.rtol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":634
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4rtol_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3KSP_4rtol_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/KSP.pyx":635
* return self.getTolerances()[0]
* def __set__(self, value):
* self.setTolerances(rtol=value) # <<<<<<<<<<<<<<
*
* property atol:
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rtol, __pyx_v_value) < 0) __PYX_ERR(48, 635, __pyx_L1_error)
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/KSP.pyx":634
* def __get__(self):
* return self.getTolerances()[0]
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setTolerances(rtol=value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.rtol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":638
*
* property atol:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[1]
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4atol_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4atol_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4atol___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4atol___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":639
* property atol:
* def __get__(self):
* return self.getTolerances()[1] # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setTolerances(atol=value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 639, __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":638
*
* property atol:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[1]
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.atol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":640
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4atol_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3KSP_4atol_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/KSP.pyx":641
* return self.getTolerances()[1]
* def __set__(self, value):
* self.setTolerances(atol=value) # <<<<<<<<<<<<<<
*
* property divtol:
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_atol, __pyx_v_value) < 0) __PYX_ERR(48, 641, __pyx_L1_error)
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/KSP.pyx":640
* def __get__(self):
* return self.getTolerances()[1]
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setTolerances(atol=value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.atol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":644
*
* property divtol:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[2]
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6divtol_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6divtol_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6divtol___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6divtol___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":645
* property divtol:
* def __get__(self):
* return self.getTolerances()[2] # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setTolerances(divtol=value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 645, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 645, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 645, __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":644
*
* property divtol:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[2]
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.divtol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":646
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6divtol_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3KSP_6divtol_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/KSP.pyx":647
* return self.getTolerances()[2]
* def __set__(self, value):
* self.setTolerances(divtol=value) # <<<<<<<<<<<<<<
*
* property max_it:
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 647, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 647, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_divtol, __pyx_v_value) < 0) __PYX_ERR(48, 647, __pyx_L1_error)
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 647, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/KSP.pyx":646
* def __get__(self):
* return self.getTolerances()[2]
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setTolerances(divtol=value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.divtol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":650
*
* property max_it:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[3]
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6max_it_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6max_it_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6max_it___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6max_it___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":651
* property max_it:
* def __get__(self):
* return self.getTolerances()[3] # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setTolerances(max_it=value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 651, __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":650
*
* property max_it:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[3]
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.max_it.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":652
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6max_it_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3KSP_6max_it_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/KSP.pyx":653
* return self.getTolerances()[3]
* def __set__(self, value):
* self.setTolerances(max_it=value) # <<<<<<<<<<<<<<
*
* # --- iteration ---
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 653, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 653, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_max_it, __pyx_v_value) < 0) __PYX_ERR(48, 653, __pyx_L1_error)
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 653, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/KSP.pyx":652
* def __get__(self):
* return self.getTolerances()[3]
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setTolerances(max_it=value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.max_it.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":658
*
* property its:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getIterationNumber()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_3its_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_3its_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_3its___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_3its___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":659
* property its:
* def __get__(self):
* return self.getIterationNumber() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setIterationNumber(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getIterationNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 659, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 659, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":658
*
* property its:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getIterationNumber()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.its.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":660
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_3its_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3KSP_3its_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/KSP.pyx":661
* return self.getIterationNumber()
* def __set__(self, value):
* self.setIterationNumber(value) # <<<<<<<<<<<<<<
*
* property norm:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setIterationNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 661, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 661, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/KSP.pyx":660
* def __get__(self):
* return self.getIterationNumber()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setIterationNumber(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.its.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":664
*
* property norm:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getResidualNorm()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4norm_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4norm_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4norm___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4norm___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":665
* property norm:
* def __get__(self):
* return self.getResidualNorm() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setResidualNorm(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getResidualNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 665, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 665, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":664
*
* property norm:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getResidualNorm()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.norm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":666
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4norm_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3KSP_4norm_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/KSP.pyx":667
* return self.getResidualNorm()
* def __set__(self, value):
* self.setResidualNorm(value) # <<<<<<<<<<<<<<
*
* property history:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setResidualNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 667, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 667, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/KSP.pyx":666
* def __get__(self):
* return self.getResidualNorm()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setResidualNorm(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.norm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":670
*
* property history:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_7history___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7history___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":671
* property history:
* def __get__(self):
* return self.getConvergenceHistory() # <<<<<<<<<<<<<<
*
* # --- convergence ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergenceHistory); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 671, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 671, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":670
*
* property history:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getConvergenceHistory()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.history.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":676
*
* property reason:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getConvergedReason()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6reason_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6reason_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6reason___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6reason___get__(struct PyPetscKSPObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/KSP.pyx":677
* property reason:
* def __get__(self):
* return self.getConvergedReason() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setConvergedReason(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 677, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 677, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/KSP.pyx":676
*
* property reason:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getConvergedReason()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.reason.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":678
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6reason_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_3KSP_6reason_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/KSP.pyx":679
* return self.getConvergedReason()
* def __set__(self, value):
* self.setConvergedReason(value) # <<<<<<<<<<<<<<
*
* property iterating:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 679, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 679, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/KSP.pyx":678
* def __get__(self):
* return self.getConvergedReason()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setConvergedReason(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.KSP.reason.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/KSP.pyx":682
*
* property iterating:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.reason == 0
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9iterating_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9iterating_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_9iterating___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_9iterating___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":683
* property iterating:
* def __get__(self):
* return self.reason == 0 # <<<<<<<<<<<<<<
*
* property converged:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 683, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 683, __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":682
*
* property iterating:
* def __get__(self): # <<<<<<<<<<<<<<
* 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.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":686
*
* property converged:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.reason > 0
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9converged_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9converged_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_9converged___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_9converged___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":687
* property converged:
* def __get__(self):
* return self.reason > 0 # <<<<<<<<<<<<<<
*
* property diverged:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 687, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 687, __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":686
*
* property converged:
* def __get__(self): # <<<<<<<<<<<<<<
* 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.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":690
*
* property diverged:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.reason < 0
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_8diverged_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_8diverged_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_8diverged___get__(((struct PyPetscKSPObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_8diverged___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":691
* property diverged:
* def __get__(self):
* return self.reason < 0 # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 691, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 691, __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":690
*
* property diverged:
* def __get__(self): # <<<<<<<<<<<<<<
* 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.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":73
* # --- 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES___cinit__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES___cinit__(struct PyPetscSNESObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/SNES.pyx":74
*
* 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":75
* def __cinit__(self):
* self.obj = <PetscObject*> &self.snes
* self.snes = NULL # <<<<<<<<<<<<<<
*
* # --- xxx ---
*/
__pyx_v_self->snes = NULL;
/* "petsc4py/PETSc/SNES.pyx":73
* # --- xxx ---
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.snes
* self.snes = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":79
* # --- xxx ---
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer cviewer = NULL
* if viewer is not None: cviewer = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_2view[] = "SNES.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(49, 79, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 79, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(49, 79, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_2view(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/SNES.pyx":80
*
* def view(self, Viewer viewer=None):
* 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":81
* def view(self, Viewer viewer=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_cviewer = __pyx_t_3;
}
/* "petsc4py/PETSc/SNES.pyx":82
* cdef PetscViewer cviewer = NULL
* if viewer is not None: cviewer = viewer.vwr
* CHKERR( SNESView(self.snes, cviewer) ) # <<<<<<<<<<<<<<
*
* def destroy(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESView(__pyx_v_self->snes, __pyx_v_cviewer)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 82, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":79
* # --- xxx ---
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer cviewer = NULL
* if viewer is not None: cviewer = viewer.vwr
*/
/* 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":84
* CHKERR( SNESView(self.snes, cviewer) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( SNESDestroy(&self.snes) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_4destroy[] = "SNES.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4destroy(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4destroy(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/SNES.pyx":85
*
* def destroy(self):
* 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(49, 85, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":86
* def destroy(self):
* CHKERR( SNESDestroy(&self.snes) )
* return self # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":84
* CHKERR( SNESView(self.snes, cviewer) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( SNESDestroy(&self.snes) )
* return self
*/
/* 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":88
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSNES newsnes = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_6create[] = "SNES.create(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(49, 88, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 88, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":89
*
* def create(self, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(49, 89, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":90
* def create(self, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSNES newsnes = NULL # <<<<<<<<<<<<<<
* CHKERR( SNESCreate(ccomm, &newsnes) )
* PetscCLEAR(self.obj); self.snes = newsnes
*/
__pyx_v_newsnes = NULL;
/* "petsc4py/PETSc/SNES.pyx":91
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSNES newsnes = NULL
* CHKERR( SNESCreate(ccomm, &newsnes) ) # <<<<<<<<<<<<<<
* 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(49, 91, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":92
* cdef PetscSNES newsnes = NULL
* CHKERR( SNESCreate(ccomm, &newsnes) )
* PetscCLEAR(self.obj); self.snes = newsnes # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->snes = __pyx_v_newsnes;
/* "petsc4py/PETSc/SNES.pyx":93
* CHKERR( SNESCreate(ccomm, &newsnes) )
* PetscCLEAR(self.obj); self.snes = newsnes
* return self # <<<<<<<<<<<<<<
*
* def setType(self, snes_type):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":88
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSNES newsnes = NULL
*/
/* 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":95
* return self
*
* def setType(self, snes_type): # <<<<<<<<<<<<<<
* cdef PetscSNESType cval = NULL
* snes_type = str2bytes(snes_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_8setType[] = "SNES.setType(self, snes_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_snes_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_snes_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_snes_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(49, 95, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_snes_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 95, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":96
*
* def setType(self, snes_type):
* cdef PetscSNESType cval = NULL # <<<<<<<<<<<<<<
* snes_type = str2bytes(snes_type, &cval)
* CHKERR( SNESSetType(self.snes, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/SNES.pyx":97
* def setType(self, snes_type):
* 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(49, 97, __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":98
* cdef PetscSNESType cval = NULL
* snes_type = str2bytes(snes_type, &cval)
* CHKERR( SNESSetType(self.snes, cval) ) # <<<<<<<<<<<<<<
*
* def getType(self):
*/
__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(49, 98, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":95
* return self
*
* def setType(self, snes_type): # <<<<<<<<<<<<<<
* cdef PetscSNESType cval = NULL
* snes_type = str2bytes(snes_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":100
* CHKERR( SNESSetType(self.snes, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscSNESType cval = NULL
* CHKERR( SNESGetType(self.snes, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_11getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_10getType[] = "SNES.getType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_11getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_10getType(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_10getType(struct PyPetscSNESObject *__pyx_v_self) {
SNESType __pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getType", 0);
/* "petsc4py/PETSc/SNES.pyx":101
*
* def getType(self):
* cdef PetscSNESType cval = NULL # <<<<<<<<<<<<<<
* CHKERR( SNESGetType(self.snes, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/SNES.pyx":102
* def getType(self):
* 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(49, 102, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":103
* cdef PetscSNESType cval = NULL
* CHKERR( SNESGetType(self.snes, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def setOptionsPrefix(self, prefix):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":100
* CHKERR( SNESSetType(self.snes, cval) )
*
* def getType(self): # <<<<<<<<<<<<<<
* cdef PetscSNESType cval = NULL
* CHKERR( SNESGetType(self.snes, &cval) )
*/
/* 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":105
* return bytes2str(cval)
*
* def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_13setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_12setOptionsPrefix[] = "SNES.setOptionsPrefix(self, prefix)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_13setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(49, 105, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_prefix = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 105, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":106
*
* def setOptionsPrefix(self, prefix):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* prefix = str2bytes(prefix, &cval)
* CHKERR( SNESSetOptionsPrefix(self.snes, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/SNES.pyx":107
* def setOptionsPrefix(self, prefix):
* 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(49, 107, __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":108
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
* CHKERR( SNESSetOptionsPrefix(self.snes, cval) ) # <<<<<<<<<<<<<<
*
* def getOptionsPrefix(self):
*/
__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(49, 108, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":105
* return bytes2str(cval)
*
* def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":110
* CHKERR( SNESSetOptionsPrefix(self.snes, cval) )
*
* def getOptionsPrefix(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( SNESGetOptionsPrefix(self.snes, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_15getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_14getOptionsPrefix[] = "SNES.getOptionsPrefix(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_15getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_14getOptionsPrefix(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_14getOptionsPrefix(struct PyPetscSNESObject *__pyx_v_self) {
char const *__pyx_v_cval;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getOptionsPrefix", 0);
/* "petsc4py/PETSc/SNES.pyx":111
*
* def getOptionsPrefix(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( SNESGetOptionsPrefix(self.snes, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/SNES.pyx":112
* def getOptionsPrefix(self):
* 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(49, 112, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":113
* cdef const char *cval = NULL
* CHKERR( SNESGetOptionsPrefix(self.snes, &cval) )
* return bytes2str(cval) # <<<<<<<<<<<<<<
*
* def appendOptionsPrefix(self, prefix):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":110
* CHKERR( SNESSetOptionsPrefix(self.snes, cval) )
*
* def getOptionsPrefix(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( SNESGetOptionsPrefix(self.snes, &cval) )
*/
/* 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":115
* return bytes2str(cval)
*
* def appendOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_17appendOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_16appendOptionsPrefix[] = "SNES.appendOptionsPrefix(self, prefix)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_17appendOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "appendOptionsPrefix") < 0)) __PYX_ERR(49, 115, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_prefix = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 115, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":116
*
* def appendOptionsPrefix(self, prefix):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* prefix = str2bytes(prefix, &cval)
* CHKERR( SNESAppendOptionsPrefix(self.snes, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/SNES.pyx":117
* def appendOptionsPrefix(self, prefix):
* 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(49, 117, __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":118
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
* CHKERR( SNESAppendOptionsPrefix(self.snes, cval) ) # <<<<<<<<<<<<<<
*
* def setFromOptions(self):
*/
__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(49, 118, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":115
* return bytes2str(cval)
*
* def appendOptionsPrefix(self, prefix): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* prefix = str2bytes(prefix, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":120
* CHKERR( SNESAppendOptionsPrefix(self.snes, cval) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( SNESSetFromOptions(self.snes) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_19setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_18setFromOptions[] = "SNES.setFromOptions(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_19setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_18setFromOptions(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_18setFromOptions(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFromOptions", 0);
/* "petsc4py/PETSc/SNES.pyx":121
*
* def setFromOptions(self):
* 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(49, 121, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":120
* CHKERR( SNESAppendOptionsPrefix(self.snes, cval) )
*
* def setFromOptions(self): # <<<<<<<<<<<<<<
* CHKERR( SNESSetFromOptions(self.snes) )
*
*/
/* 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":125
* # --- application context ---
*
* def setApplicationContext(self, appctx): # <<<<<<<<<<<<<<
* self.set_attr('__appctx__', appctx)
* if appctx is not None:
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_21setApplicationContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_20setApplicationContext[] = "SNES.setApplicationContext(self, appctx)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_21setApplicationContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_appctx = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_appctx,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_appctx)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setApplicationContext") < 0)) __PYX_ERR(49, 125, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_appctx = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setApplicationContext", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 125, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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;
int __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setApplicationContext", 0);
/* "petsc4py/PETSc/SNES.pyx":126
*
* def setApplicationContext(self, appctx):
* 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(49, 126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":127
* def setApplicationContext(self, appctx):
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/SNES.pyx":128
* 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(49, 128, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":129
* if appctx is not None:
* registerAppCtx(<void*>appctx)
* CHKERR( SNESSetApplicationContext(self.snes, <void*>appctx) ) # <<<<<<<<<<<<<<
* else:
* CHKERR( SNESSetApplicationContext(self.snes, NULL) )
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetApplicationContext(__pyx_v_self->snes, ((void *)__pyx_v_appctx))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 129, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":127
* def setApplicationContext(self, appctx):
* 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":131
* CHKERR( SNESSetApplicationContext(self.snes, <void*>appctx) )
* else:
* CHKERR( SNESSetApplicationContext(self.snes, NULL) ) # <<<<<<<<<<<<<<
*
* def getApplicationContext(self):
*/
/*else*/ {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetApplicationContext(__pyx_v_self->snes, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 131, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/SNES.pyx":125
* # --- application context ---
*
* def setApplicationContext(self, appctx): # <<<<<<<<<<<<<<
* self.set_attr('__appctx__', appctx)
* if appctx is not None:
*/
/* 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":133
* CHKERR( SNESSetApplicationContext(self.snes, NULL) )
*
* def getApplicationContext(self): # <<<<<<<<<<<<<<
* cdef void *ctx
* appctx = self.get_attr('__appctx__')
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_23getApplicationContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_22getApplicationContext[] = "SNES.getApplicationContext(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_23getApplicationContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getApplicationContext (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getApplicationContext", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getApplicationContext", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_22getApplicationContext(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_22getApplicationContext(struct PyPetscSNESObject *__pyx_v_self) {
void *__pyx_v_ctx;
PyObject *__pyx_v_appctx = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
int __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getApplicationContext", 0);
/* "petsc4py/PETSc/SNES.pyx":135
* def getApplicationContext(self):
* cdef void *ctx
* appctx = self.get_attr('__appctx__') # <<<<<<<<<<<<<<
* if appctx is None:
* CHKERR( SNESGetApplicationContext(self.snes, &ctx) )
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_appctx = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":136
* cdef void *ctx
* appctx = self.get_attr('__appctx__')
* if appctx is None: # <<<<<<<<<<<<<<
* CHKERR( SNESGetApplicationContext(self.snes, &ctx) )
* appctx = toAppCtx(ctx)
*/
__pyx_t_2 = (__pyx_v_appctx == Py_None);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/SNES.pyx":137
* appctx = self.get_attr('__appctx__')
* if appctx is None:
* CHKERR( SNESGetApplicationContext(self.snes, &ctx) ) # <<<<<<<<<<<<<<
* appctx = toAppCtx(ctx)
* return appctx
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetApplicationContext(__pyx_v_self->snes, (&__pyx_v_ctx))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 137, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":138
* 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(49, 138, __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":136
* cdef void *ctx
* appctx = self.get_attr('__appctx__')
* if appctx is None: # <<<<<<<<<<<<<<
* CHKERR( SNESGetApplicationContext(self.snes, &ctx) )
* appctx = toAppCtx(ctx)
*/
}
/* "petsc4py/PETSc/SNES.pyx":139
* 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":133
* CHKERR( SNESSetApplicationContext(self.snes, NULL) )
*
* def getApplicationContext(self): # <<<<<<<<<<<<<<
* cdef void *ctx
* appctx = self.get_attr('__appctx__')
*/
/* 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":147
* # --- discretization space ---
*
* def getDM(self): # <<<<<<<<<<<<<<
* cdef PetscDM newdm = NULL
* CHKERR( SNESGetDM(self.snes, &newdm) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_25getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_24getDM[] = "SNES.getDM(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_25getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getDM (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_24getDM(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_24getDM(struct PyPetscSNESObject *__pyx_v_self) {
DM __pyx_v_newdm;
struct PyPetscDMObject *__pyx_v_dm = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getDM", 0);
/* "petsc4py/PETSc/SNES.pyx":148
*
* def getDM(self):
* cdef PetscDM newdm = NULL # <<<<<<<<<<<<<<
* CHKERR( SNESGetDM(self.snes, &newdm) )
* cdef DM dm = subtype_DM(newdm)()
*/
__pyx_v_newdm = NULL;
/* "petsc4py/PETSc/SNES.pyx":149
* def getDM(self):
* 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(49, 149, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":150
* cdef PetscDM newdm = NULL
* CHKERR( SNESGetDM(self.snes, &newdm) )
* cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<<
* dm.dm = newdm
* PetscINCREF(dm.obj)
*/
__pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 150, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 150, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(49, 150, __pyx_L1_error)
__pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":151
* CHKERR( SNESGetDM(self.snes, &newdm) )
* cdef DM dm = subtype_DM(newdm)()
* dm.dm = newdm # <<<<<<<<<<<<<<
* PetscINCREF(dm.obj)
* return dm
*/
__pyx_v_dm->dm = __pyx_v_newdm;
/* "petsc4py/PETSc/SNES.pyx":152
* cdef DM dm = subtype_DM(newdm)()
* dm.dm = newdm
* PetscINCREF(dm.obj) # <<<<<<<<<<<<<<
* return dm
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":153
* dm.dm = newdm
* PetscINCREF(dm.obj)
* return dm # <<<<<<<<<<<<<<
*
* def setDM(self, DM dm):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_dm));
__pyx_r = ((PyObject *)__pyx_v_dm);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":147
* # --- discretization space ---
*
* def getDM(self): # <<<<<<<<<<<<<<
* cdef PetscDM newdm = NULL
* CHKERR( SNESGetDM(self.snes, &newdm) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_dm);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":155
* return dm
*
* def setDM(self, DM dm): # <<<<<<<<<<<<<<
* CHKERR( SNESSetDM(self.snes, dm.dm) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_27setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_26setDM[] = "SNES.setDM(self, DM dm)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_27setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscDMObject *__pyx_v_dm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDM") < 0)) __PYX_ERR(49, 155, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_dm = ((struct PyPetscDMObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 155, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(49, 155, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_26setDM(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_dm);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":156
*
* def setDM(self, DM dm):
* CHKERR( SNESSetDM(self.snes, dm.dm) ) # <<<<<<<<<<<<<<
*
* # --- FAS ---
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetDM(__pyx_v_self->snes, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 156, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":155
* return dm
*
* def setDM(self, DM dm): # <<<<<<<<<<<<<<
* CHKERR( SNESSetDM(self.snes, dm.dm) )
*
*/
/* 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":160
* # --- FAS ---
*
* def setFASInterpolation(self, level, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_29setFASInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_28setFASInterpolation[] = "SNES.setFASInterpolation(self, level, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_29setFASInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 0;
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_mat,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setFASInterpolation", 1, 2, 2, 1); __PYX_ERR(49, 160, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFASInterpolation") < 0)) __PYX_ERR(49, 160, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_level = values[0];
__pyx_v_mat = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFASInterpolation", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 160, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(49, 160, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_28setFASInterpolation(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_28setFASInterpolation(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat) {
PetscInt __pyx_v_clevel;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFASInterpolation", 0);
/* "petsc4py/PETSc/SNES.pyx":161
*
* def setFASInterpolation(self, level, Mat mat):
* 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(49, 161, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":162
* def setFASInterpolation(self, level, Mat mat):
* cdef PetscInt clevel = asInt(level)
* CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) ) # <<<<<<<<<<<<<<
*
* def getFASInterpolation(self, level):
*/
__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(49, 162, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":160
* # --- FAS ---
*
* def setFASInterpolation(self, level, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) )
*/
/* 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":164
* CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) )
*
* def getFASInterpolation(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef Mat mat = Mat()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_31getFASInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_30getFASInterpolation[] = "SNES.getFASInterpolation(self, level)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_31getFASInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFASInterpolation") < 0)) __PYX_ERR(49, 164, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_level = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getFASInterpolation", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 164, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_30getFASInterpolation(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_30getFASInterpolation(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) {
PetscInt __pyx_v_clevel;
struct PyPetscMatObject *__pyx_v_mat = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFASInterpolation", 0);
/* "petsc4py/PETSc/SNES.pyx":165
*
* def getFASInterpolation(self, level):
* 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(49, 165, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":166
* def getFASInterpolation(self, level):
* cdef PetscInt clevel = asInt(level)
* cdef Mat mat = Mat() # <<<<<<<<<<<<<<
* CHKERR( SNESFASGetInterpolation(self.snes, clevel, &mat.mat) )
* PetscINCREF(mat.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":167
* cdef PetscInt clevel = asInt(level)
* cdef Mat mat = Mat()
* CHKERR( SNESFASGetInterpolation(self.snes, clevel, &mat.mat) ) # <<<<<<<<<<<<<<
* PetscINCREF(mat.obj)
* return mat
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetInterpolation(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 167, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":168
* cdef Mat mat = Mat()
* CHKERR( SNESFASGetInterpolation(self.snes, clevel, &mat.mat) )
* PetscINCREF(mat.obj) # <<<<<<<<<<<<<<
* return mat
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":169
* CHKERR( SNESFASGetInterpolation(self.snes, clevel, &mat.mat) )
* PetscINCREF(mat.obj)
* return mat # <<<<<<<<<<<<<<
*
* def setFASRestriction(self, level, Mat mat):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_mat));
__pyx_r = ((PyObject *)__pyx_v_mat);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":164
* CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) )
*
* def getFASInterpolation(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef Mat mat = Mat()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_mat);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":171
* return mat
*
* def setFASRestriction(self, level, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_33setFASRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_32setFASRestriction[] = "SNES.setFASRestriction(self, level, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_33setFASRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 0;
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_mat,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setFASRestriction", 1, 2, 2, 1); __PYX_ERR(49, 171, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFASRestriction") < 0)) __PYX_ERR(49, 171, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_level = values[0];
__pyx_v_mat = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFASRestriction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 171, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(49, 171, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_32setFASRestriction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_32setFASRestriction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat) {
PetscInt __pyx_v_clevel;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFASRestriction", 0);
/* "petsc4py/PETSc/SNES.pyx":172
*
* def setFASRestriction(self, level, Mat mat):
* 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(49, 172, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":173
* def setFASRestriction(self, level, Mat mat):
* cdef PetscInt clevel = asInt(level)
* CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) ) # <<<<<<<<<<<<<<
*
* def getFASRestriction(self, level):
*/
__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(49, 173, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":171
* return mat
*
* def setFASRestriction(self, level, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) )
*/
/* 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":175
* CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) )
*
* def getFASRestriction(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef Mat mat = Mat()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_35getFASRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_34getFASRestriction[] = "SNES.getFASRestriction(self, level)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_35getFASRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFASRestriction") < 0)) __PYX_ERR(49, 175, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_level = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getFASRestriction", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 175, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_34getFASRestriction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_34getFASRestriction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) {
PetscInt __pyx_v_clevel;
struct PyPetscMatObject *__pyx_v_mat = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFASRestriction", 0);
/* "petsc4py/PETSc/SNES.pyx":176
*
* def getFASRestriction(self, level):
* 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(49, 176, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":177
* def getFASRestriction(self, level):
* cdef PetscInt clevel = asInt(level)
* cdef Mat mat = Mat() # <<<<<<<<<<<<<<
* CHKERR( SNESFASGetRestriction(self.snes, clevel, &mat.mat) )
* PetscINCREF(mat.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 177, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":178
* cdef PetscInt clevel = asInt(level)
* cdef Mat mat = Mat()
* CHKERR( SNESFASGetRestriction(self.snes, clevel, &mat.mat) ) # <<<<<<<<<<<<<<
* PetscINCREF(mat.obj)
* return mat
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetRestriction(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 178, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":179
* cdef Mat mat = Mat()
* CHKERR( SNESFASGetRestriction(self.snes, clevel, &mat.mat) )
* PetscINCREF(mat.obj) # <<<<<<<<<<<<<<
* return mat
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":180
* CHKERR( SNESFASGetRestriction(self.snes, clevel, &mat.mat) )
* PetscINCREF(mat.obj)
* return mat # <<<<<<<<<<<<<<
*
* def setFASInjection(self, level, Mat mat):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_mat));
__pyx_r = ((PyObject *)__pyx_v_mat);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":175
* CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) )
*
* def getFASRestriction(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef Mat mat = Mat()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_mat);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":182
* return mat
*
* def setFASInjection(self, level, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_37setFASInjection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_36setFASInjection[] = "SNES.setFASInjection(self, level, Mat mat)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_37setFASInjection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 0;
struct PyPetscMatObject *__pyx_v_mat = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_mat,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setFASInjection", 1, 2, 2, 1); __PYX_ERR(49, 182, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFASInjection") < 0)) __PYX_ERR(49, 182, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_level = values[0];
__pyx_v_mat = ((struct PyPetscMatObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFASInjection", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 182, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASInjection", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(49, 182, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_36setFASInjection(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_36setFASInjection(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat) {
PetscInt __pyx_v_clevel;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFASInjection", 0);
/* "petsc4py/PETSc/SNES.pyx":183
*
* def setFASInjection(self, level, Mat mat):
* 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(49, 183, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":184
* def setFASInjection(self, level, Mat mat):
* cdef PetscInt clevel = asInt(level)
* CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) ) # <<<<<<<<<<<<<<
*
* def getFASInjection(self, level):
*/
__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(49, 184, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":182
* return mat
*
* def setFASInjection(self, level, Mat mat): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) )
*/
/* 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":186
* CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) )
*
* def getFASInjection(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef Mat mat = Mat()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_39getFASInjection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_38getFASInjection[] = "SNES.getFASInjection(self, level)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_39getFASInjection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFASInjection") < 0)) __PYX_ERR(49, 186, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_level = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getFASInjection", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 186, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASInjection", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_38getFASInjection(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_38getFASInjection(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) {
PetscInt __pyx_v_clevel;
struct PyPetscMatObject *__pyx_v_mat = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFASInjection", 0);
/* "petsc4py/PETSc/SNES.pyx":187
*
* def getFASInjection(self, level):
* 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(49, 187, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":188
* def getFASInjection(self, level):
* cdef PetscInt clevel = asInt(level)
* cdef Mat mat = Mat() # <<<<<<<<<<<<<<
* CHKERR( SNESFASGetInjection(self.snes, clevel, &mat.mat) )
* PetscINCREF(mat.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":189
* cdef PetscInt clevel = asInt(level)
* cdef Mat mat = Mat()
* CHKERR( SNESFASGetInjection(self.snes, clevel, &mat.mat) ) # <<<<<<<<<<<<<<
* PetscINCREF(mat.obj)
* return mat
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetInjection(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 189, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":190
* cdef Mat mat = Mat()
* CHKERR( SNESFASGetInjection(self.snes, clevel, &mat.mat) )
* PetscINCREF(mat.obj) # <<<<<<<<<<<<<<
* return mat
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":191
* CHKERR( SNESFASGetInjection(self.snes, clevel, &mat.mat) )
* PetscINCREF(mat.obj)
* return mat # <<<<<<<<<<<<<<
*
* def setFASRScale(self, level, Vec vec):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_mat));
__pyx_r = ((PyObject *)__pyx_v_mat);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":186
* CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) )
*
* def getFASInjection(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef Mat mat = Mat()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASInjection", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_mat);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":193
* return mat
*
* def setFASRScale(self, level, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_41setFASRScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_40setFASRScale[] = "SNES.setFASRScale(self, level, Vec vec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_41setFASRScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 0;
struct PyPetscVecObject *__pyx_v_vec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_vec,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setFASRScale", 1, 2, 2, 1); __PYX_ERR(49, 193, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFASRScale") < 0)) __PYX_ERR(49, 193, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_level = values[0];
__pyx_v_vec = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFASRScale", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 193, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASRScale", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(49, 193, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_40setFASRScale(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_vec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_40setFASRScale(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_vec) {
PetscInt __pyx_v_clevel;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setFASRScale", 0);
/* "petsc4py/PETSc/SNES.pyx":194
*
* def setFASRScale(self, level, Vec vec):
* 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(49, 194, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":195
* def setFASRScale(self, level, Vec vec):
* cdef PetscInt clevel = asInt(level)
* CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) ) # <<<<<<<<<<<<<<
*
* def setFASLevels(self, levels, comms=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(49, 195, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":193
* return mat
*
* def setFASRScale(self, level, Vec vec): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) )
*/
/* 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":197
* CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) )
*
* def setFASLevels(self, levels, comms=None): # <<<<<<<<<<<<<<
* cdef PetscInt clevels = asInt(levels)
* cdef MPI_Comm *ccomms = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_43setFASLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_42setFASLevels[] = "SNES.setFASLevels(self, levels, comms=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_43setFASLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_levels = 0;
PyObject *__pyx_v_comms = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,&__pyx_n_s_comms,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comms);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFASLevels") < 0)) __PYX_ERR(49, 197, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_levels = values[0];
__pyx_v_comms = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFASLevels", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 197, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASLevels", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_42setFASLevels(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_levels, __pyx_v_comms);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_42setFASLevels(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_levels, PyObject *__pyx_v_comms) {
PetscInt __pyx_v_clevels;
MPI_Comm *__pyx_v_ccomms;
Py_ssize_t __pyx_v_i;
PyObject *__pyx_v_comm = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
Py_ssize_t __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
PetscErrorCode __pyx_t_6;
Py_ssize_t __pyx_t_7;
PyObject *(*__pyx_t_8)(PyObject *);
PyObject *__pyx_t_9 = NULL;
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":198
*
* def setFASLevels(self, levels, comms=None):
* 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(49, 198, __pyx_L1_error)
__pyx_v_clevels = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":199
* def setFASLevels(self, levels, comms=None):
* 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":200
* 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":201
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/SNES.pyx":202
* 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_4 = PyObject_Length(__pyx_v_comms); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(49, 202, __pyx_L1_error)
__pyx_t_3 = ((__pyx_v_clevels != ((PetscInt)__pyx_t_4)) != 0);
if (unlikely(__pyx_t_3)) {
/* "petsc4py/PETSc/SNES.pyx":203
* 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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 203, __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(49, 203, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":202
* 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":204
* 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_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc(((sizeof(MPI_Comm)) * ((size_t)__pyx_v_clevels)), (&__pyx_v_ccomms))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 204, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":205
* 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":206
* 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_4 = 0;
if (likely(PyList_CheckExact(__pyx_v_comms)) || PyTuple_CheckExact(__pyx_v_comms)) {
__pyx_t_5 = __pyx_v_comms; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
__pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_comms); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 206, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(49, 206, __pyx_L6_error)
}
for (;;) {
if (likely(!__pyx_t_8)) {
if (likely(PyList_CheckExact(__pyx_t_5))) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_9 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(49, 206, __pyx_L6_error)
#else
__pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(49, 206, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_9);
#endif
} else {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(49, 206, __pyx_L6_error)
#else
__pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(49, 206, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_9);
#endif
}
} else {
__pyx_t_9 = __pyx_t_8(__pyx_t_5);
if (unlikely(!__pyx_t_9)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
else __PYX_ERR(49, 206, __pyx_L6_error)
}
break;
}
__Pyx_GOTREF(__pyx_t_9);
}
__Pyx_XDECREF_SET(__pyx_v_comm, __pyx_t_9);
__pyx_t_9 = 0;
__pyx_v_i = __pyx_t_4;
__pyx_t_4 = (__pyx_t_4 + 1);
/* "petsc4py/PETSc/SNES.pyx":207
* 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(PyErr_Occurred())) __PYX_ERR(49, 207, __pyx_L6_error)
(__pyx_v_ccomms[__pyx_v_i]) = __pyx_t_10;
/* "petsc4py/PETSc/SNES.pyx":206
* 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_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/SNES.pyx":208
* 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_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetLevels(__pyx_v_self->snes, __pyx_v_clevels, __pyx_v_ccomms)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 208, __pyx_L6_error)
}
/* "petsc4py/PETSc/SNES.pyx":210
* CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) )
* finally:
* CHKERR( PetscFree(ccomms) ) # <<<<<<<<<<<<<<
* else:
* CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) )
*/
/*finally:*/ {
/*normal exit:*/{
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ccomms)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 210, __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_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
if ((PY_MAJOR_VERSION < 3) || 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_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ccomms)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 210, __pyx_L11_error)
}
if (PY_MAJOR_VERSION >= 3) {
__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_L11_error:;
if (PY_MAJOR_VERSION >= 3) {
__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":201
* 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":212
* CHKERR( PetscFree(ccomms) )
* else:
* CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) # <<<<<<<<<<<<<<
*
* def getFASLevels(self):
*/
/*else*/ {
__pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetLevels(__pyx_v_self->snes, __pyx_v_clevels, __pyx_v_ccomms)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 212, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/SNES.pyx":197
* CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) )
*
* def setFASLevels(self, levels, comms=None): # <<<<<<<<<<<<<<
* cdef PetscInt clevels = asInt(levels)
* cdef MPI_Comm *ccomms = NULL
*/
/* 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_9);
__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":214
* CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) )
*
* def getFASLevels(self): # <<<<<<<<<<<<<<
* cdef PetscInt levels = 0
* CHKERR( SNESFASGetLevels(self.snes, &levels) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_45getFASLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_44getFASLevels[] = "SNES.getFASLevels(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_45getFASLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFASLevels (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFASLevels", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFASLevels", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_44getFASLevels(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_44getFASLevels(struct PyPetscSNESObject *__pyx_v_self) {
PetscInt __pyx_v_levels;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFASLevels", 0);
/* "petsc4py/PETSc/SNES.pyx":215
*
* def getFASLevels(self):
* cdef PetscInt levels = 0 # <<<<<<<<<<<<<<
* CHKERR( SNESFASGetLevels(self.snes, &levels) )
* return toInt(levels)
*/
__pyx_v_levels = 0;
/* "petsc4py/PETSc/SNES.pyx":216
* def getFASLevels(self):
* 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(49, 216, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":217
* cdef PetscInt levels = 0
* CHKERR( SNESFASGetLevels(self.snes, &levels) )
* return toInt(levels) # <<<<<<<<<<<<<<
*
* def getFASCycleSNES(self, level):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_levels); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":214
* CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) )
*
* def getFASLevels(self): # <<<<<<<<<<<<<<
* cdef PetscInt levels = 0
* CHKERR( SNESFASGetLevels(self.snes, &levels) )
*/
/* 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":219
* return toInt(levels)
*
* def getFASCycleSNES(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef SNES lsnes = SNES()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_47getFASCycleSNES(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_46getFASCycleSNES[] = "SNES.getFASCycleSNES(self, level)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_47getFASCycleSNES(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFASCycleSNES") < 0)) __PYX_ERR(49, 219, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_level = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getFASCycleSNES", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 219, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASCycleSNES", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_46getFASCycleSNES(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_46getFASCycleSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) {
PetscInt __pyx_v_clevel;
struct PyPetscSNESObject *__pyx_v_lsnes = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFASCycleSNES", 0);
/* "petsc4py/PETSc/SNES.pyx":220
*
* def getFASCycleSNES(self, level):
* 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(49, 220, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":221
* def getFASCycleSNES(self, level):
* cdef PetscInt clevel = asInt(level)
* cdef SNES lsnes = SNES() # <<<<<<<<<<<<<<
* CHKERR( SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes) )
* PetscINCREF(lsnes.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 221, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_lsnes = ((struct PyPetscSNESObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":222
* cdef PetscInt clevel = asInt(level)
* cdef SNES lsnes = SNES()
* CHKERR( SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes) ) # <<<<<<<<<<<<<<
* PetscINCREF(lsnes.obj)
* return lsnes
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetCycleSNES(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_lsnes->snes))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 222, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":223
* cdef SNES lsnes = SNES()
* CHKERR( SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes) )
* PetscINCREF(lsnes.obj) # <<<<<<<<<<<<<<
* return lsnes
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_lsnes->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":224
* CHKERR( SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes) )
* PetscINCREF(lsnes.obj)
* return lsnes # <<<<<<<<<<<<<<
*
* def getFASCoarseSolve(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_lsnes));
__pyx_r = ((PyObject *)__pyx_v_lsnes);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":219
* return toInt(levels)
*
* def getFASCycleSNES(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef SNES lsnes = SNES()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASCycleSNES", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_lsnes);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":226
* return lsnes
*
* def getFASCoarseSolve(self): # <<<<<<<<<<<<<<
* cdef SNES smooth = SNES()
* CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_49getFASCoarseSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_48getFASCoarseSolve[] = "SNES.getFASCoarseSolve(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_49getFASCoarseSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFASCoarseSolve (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFASCoarseSolve", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFASCoarseSolve", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_48getFASCoarseSolve(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_48getFASCoarseSolve(struct PyPetscSNESObject *__pyx_v_self) {
struct PyPetscSNESObject *__pyx_v_smooth = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFASCoarseSolve", 0);
/* "petsc4py/PETSc/SNES.pyx":227
*
* def getFASCoarseSolve(self):
* cdef SNES smooth = SNES() # <<<<<<<<<<<<<<
* CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) )
* PetscINCREF(smooth.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 227, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":228
* def getFASCoarseSolve(self):
* cdef SNES smooth = SNES()
* CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) ) # <<<<<<<<<<<<<<
* PetscINCREF(smooth.obj)
* return smooth
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetCoarseSolve(__pyx_v_self->snes, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 228, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":229
* cdef SNES smooth = SNES()
* CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) )
* PetscINCREF(smooth.obj) # <<<<<<<<<<<<<<
* return smooth
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":230
* CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) )
* PetscINCREF(smooth.obj)
* return smooth # <<<<<<<<<<<<<<
*
* def getFASSmoother(self, level):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_smooth));
__pyx_r = ((PyObject *)__pyx_v_smooth);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":226
* return lsnes
*
* def getFASCoarseSolve(self): # <<<<<<<<<<<<<<
* cdef SNES smooth = SNES()
* CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASCoarseSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_smooth);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":232
* return smooth
*
* def getFASSmoother(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef SNES smooth = SNES()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_51getFASSmoother(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_50getFASSmoother[] = "SNES.getFASSmoother(self, level)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_51getFASSmoother(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFASSmoother") < 0)) __PYX_ERR(49, 232, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_level = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getFASSmoother", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 232, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmoother", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_50getFASSmoother(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_50getFASSmoother(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) {
PetscInt __pyx_v_clevel;
struct PyPetscSNESObject *__pyx_v_smooth = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFASSmoother", 0);
/* "petsc4py/PETSc/SNES.pyx":233
*
* def getFASSmoother(self, level):
* 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(49, 233, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":234
* def getFASSmoother(self, level):
* cdef PetscInt clevel = asInt(level)
* cdef SNES smooth = SNES() # <<<<<<<<<<<<<<
* CHKERR( SNESFASGetSmoother(self.snes, clevel, &smooth.snes) )
* PetscINCREF(smooth.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 234, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":235
* cdef PetscInt clevel = asInt(level)
* cdef SNES smooth = SNES()
* CHKERR( SNESFASGetSmoother(self.snes, clevel, &smooth.snes) ) # <<<<<<<<<<<<<<
* PetscINCREF(smooth.obj)
* return smooth
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetSmoother(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 235, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":236
* cdef SNES smooth = SNES()
* CHKERR( SNESFASGetSmoother(self.snes, clevel, &smooth.snes) )
* PetscINCREF(smooth.obj) # <<<<<<<<<<<<<<
* return smooth
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":237
* CHKERR( SNESFASGetSmoother(self.snes, clevel, &smooth.snes) )
* PetscINCREF(smooth.obj)
* return smooth # <<<<<<<<<<<<<<
*
* def getFASSmootherDown(self, level):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_smooth));
__pyx_r = ((PyObject *)__pyx_v_smooth);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":232
* return smooth
*
* def getFASSmoother(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef SNES smooth = SNES()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmoother", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_smooth);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":239
* return smooth
*
* def getFASSmootherDown(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef SNES smooth = SNES()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_53getFASSmootherDown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_52getFASSmootherDown[] = "SNES.getFASSmootherDown(self, level)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_53getFASSmootherDown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFASSmootherDown") < 0)) __PYX_ERR(49, 239, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_level = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getFASSmootherDown", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 239, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmootherDown", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_52getFASSmootherDown(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_52getFASSmootherDown(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) {
PetscInt __pyx_v_clevel;
struct PyPetscSNESObject *__pyx_v_smooth = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFASSmootherDown", 0);
/* "petsc4py/PETSc/SNES.pyx":240
*
* def getFASSmootherDown(self, level):
* 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(49, 240, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":241
* def getFASSmootherDown(self, level):
* cdef PetscInt clevel = asInt(level)
* cdef SNES smooth = SNES() # <<<<<<<<<<<<<<
* CHKERR( SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes) )
* PetscINCREF(smooth.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 241, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":242
* cdef PetscInt clevel = asInt(level)
* cdef SNES smooth = SNES()
* CHKERR( SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes) ) # <<<<<<<<<<<<<<
* PetscINCREF(smooth.obj)
* return smooth
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetSmootherDown(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 242, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":243
* cdef SNES smooth = SNES()
* CHKERR( SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes) )
* PetscINCREF(smooth.obj) # <<<<<<<<<<<<<<
* return smooth
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":244
* CHKERR( SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes) )
* PetscINCREF(smooth.obj)
* return smooth # <<<<<<<<<<<<<<
*
* def getFASSmootherUp(self, level):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_smooth));
__pyx_r = ((PyObject *)__pyx_v_smooth);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":239
* return smooth
*
* def getFASSmootherDown(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef SNES smooth = SNES()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmootherDown", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_smooth);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":246
* return smooth
*
* def getFASSmootherUp(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef SNES smooth = SNES()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_55getFASSmootherUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_54getFASSmootherUp[] = "SNES.getFASSmootherUp(self, level)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_55getFASSmootherUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFASSmootherUp") < 0)) __PYX_ERR(49, 246, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_level = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getFASSmootherUp", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 246, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmootherUp", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_54getFASSmootherUp(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_54getFASSmootherUp(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) {
PetscInt __pyx_v_clevel;
struct PyPetscSNESObject *__pyx_v_smooth = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFASSmootherUp", 0);
/* "petsc4py/PETSc/SNES.pyx":247
*
* def getFASSmootherUp(self, level):
* 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(49, 247, __pyx_L1_error)
__pyx_v_clevel = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":248
* def getFASSmootherUp(self, level):
* cdef PetscInt clevel = asInt(level)
* cdef SNES smooth = SNES() # <<<<<<<<<<<<<<
* CHKERR( SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes) )
* PetscINCREF(smooth.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":249
* cdef PetscInt clevel = asInt(level)
* cdef SNES smooth = SNES()
* CHKERR( SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes) ) # <<<<<<<<<<<<<<
* PetscINCREF(smooth.obj)
* return smooth
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetSmootherUp(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 249, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":250
* cdef SNES smooth = SNES()
* CHKERR( SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes) )
* PetscINCREF(smooth.obj) # <<<<<<<<<<<<<<
* return smooth
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":251
* CHKERR( SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes) )
* 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":246
* return smooth
*
* def getFASSmootherUp(self, level): # <<<<<<<<<<<<<<
* cdef PetscInt clevel = asInt(level)
* cdef SNES smooth = SNES()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmootherUp", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_smooth);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":255
* # --- nonlinear preconditioner ---
*
* def getNPC(self): # <<<<<<<<<<<<<<
* cdef SNES snes = SNES()
* CHKERR( SNESGetNPC(self.snes, &snes.snes) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_57getNPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_56getNPC[] = "SNES.getNPC(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_57getNPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNPC (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNPC", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNPC", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_56getNPC(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_56getNPC(struct PyPetscSNESObject *__pyx_v_self) {
struct PyPetscSNESObject *__pyx_v_snes = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNPC", 0);
/* "petsc4py/PETSc/SNES.pyx":256
*
* def getNPC(self):
* cdef SNES snes = SNES() # <<<<<<<<<<<<<<
* CHKERR( SNESGetNPC(self.snes, &snes.snes) )
* PetscINCREF(snes.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_snes = ((struct PyPetscSNESObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":257
* def getNPC(self):
* cdef SNES snes = SNES()
* CHKERR( SNESGetNPC(self.snes, &snes.snes) ) # <<<<<<<<<<<<<<
* PetscINCREF(snes.obj)
* return snes
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetNPC(__pyx_v_self->snes, (&__pyx_v_snes->snes))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 257, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":258
* cdef SNES snes = SNES()
* CHKERR( SNESGetNPC(self.snes, &snes.snes) )
* PetscINCREF(snes.obj) # <<<<<<<<<<<<<<
* return snes
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_snes->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":259
* CHKERR( SNESGetNPC(self.snes, &snes.snes) )
* PetscINCREF(snes.obj)
* return snes # <<<<<<<<<<<<<<
*
* def hasNPC(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_snes));
__pyx_r = ((PyObject *)__pyx_v_snes);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":255
* # --- nonlinear preconditioner ---
*
* def getNPC(self): # <<<<<<<<<<<<<<
* cdef SNES snes = SNES()
* CHKERR( SNESGetNPC(self.snes, &snes.snes) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getNPC", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_snes);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":261
* return snes
*
* def hasNPC(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( SNESHasNPC(self.snes, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_59hasNPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_58hasNPC[] = "SNES.hasNPC(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_59hasNPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("hasNPC (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("hasNPC", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "hasNPC", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_58hasNPC(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_58hasNPC(struct PyPetscSNESObject *__pyx_v_self) {
PetscBool __pyx_v_flag;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("hasNPC", 0);
/* "petsc4py/PETSc/SNES.pyx":262
*
* def hasNPC(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( SNESHasNPC(self.snes, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/SNES.pyx":263
* def hasNPC(self):
* 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(49, 263, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":264
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( SNESHasNPC(self.snes, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def setNPC(self, SNES snes):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":261
* return snes
*
* def hasNPC(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( SNESHasNPC(self.snes, &flag) )
*/
/* 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":266
* return toBool(flag)
*
* def setNPC(self, SNES snes): # <<<<<<<<<<<<<<
* CHKERR( SNESSetNPC(self.snes, snes.snes) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_61setNPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_60setNPC[] = "SNES.setNPC(self, SNES snes)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_61setNPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscSNESObject *__pyx_v_snes = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_snes,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_snes)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNPC") < 0)) __PYX_ERR(49, 266, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_snes = ((struct PyPetscSNESObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setNPC", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 266, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setNPC", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_snes), __pyx_ptype_8petsc4py_5PETSc_SNES, 0, "snes", 0))) __PYX_ERR(49, 266, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_60setNPC(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_snes);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_60setNPC(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscSNESObject *__pyx_v_snes) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setNPC", 0);
/* "petsc4py/PETSc/SNES.pyx":267
*
* def setNPC(self, SNES snes):
* CHKERR( SNESSetNPC(self.snes, snes.snes) ) # <<<<<<<<<<<<<<
*
* def setNPCSide(self, side):
*/
__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(49, 267, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":266
* return toBool(flag)
*
* def setNPC(self, SNES snes): # <<<<<<<<<<<<<<
* CHKERR( SNESSetNPC(self.snes, snes.snes) )
*
*/
/* 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":269
* CHKERR( SNESSetNPC(self.snes, snes.snes) )
*
* def setNPCSide(self, side): # <<<<<<<<<<<<<<
* CHKERR( SNESSetNPCSide(self.snes, side) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_63setNPCSide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_62setNPCSide[] = "SNES.setNPCSide(self, side)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_63setNPCSide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_side = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_side,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_side)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNPCSide") < 0)) __PYX_ERR(49, 269, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_side = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setNPCSide", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 269, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setNPCSide", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_62setNPCSide(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_side);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_62setNPCSide(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_side) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PCSide __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setNPCSide", 0);
/* "petsc4py/PETSc/SNES.pyx":270
*
* def setNPCSide(self, side):
* CHKERR( SNESSetNPCSide(self.snes, side) ) # <<<<<<<<<<<<<<
*
* def getNPCSide(self):
*/
__pyx_t_1 = ((PCSide)__Pyx_PyInt_As_PCSide(__pyx_v_side)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 270, __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(49, 270, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":269
* CHKERR( SNESSetNPC(self.snes, snes.snes) )
*
* def setNPCSide(self, side): # <<<<<<<<<<<<<<
* CHKERR( SNESSetNPCSide(self.snes, 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":272
* CHKERR( SNESSetNPCSide(self.snes, side) )
*
* def getNPCSide(self): # <<<<<<<<<<<<<<
* cdef PetscPCSide side = PC_RIGHT
* CHKERR( SNESGetNPCSide(self.snes, &side) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_65getNPCSide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_64getNPCSide[] = "SNES.getNPCSide(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_65getNPCSide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNPCSide (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNPCSide", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNPCSide", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_64getNPCSide(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_64getNPCSide(struct PyPetscSNESObject *__pyx_v_self) {
PCSide __pyx_v_side;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNPCSide", 0);
/* "petsc4py/PETSc/SNES.pyx":273
*
* def getNPCSide(self):
* cdef PetscPCSide side = PC_RIGHT # <<<<<<<<<<<<<<
* CHKERR( SNESGetNPCSide(self.snes, &side) )
* return side
*/
__pyx_v_side = PC_RIGHT;
/* "petsc4py/PETSc/SNES.pyx":274
* def getNPCSide(self):
* 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(49, 274, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":275
* cdef PetscPCSide side = PC_RIGHT
* CHKERR( SNESGetNPCSide(self.snes, &side) )
* return side # <<<<<<<<<<<<<<
*
* # --- user Function/Jacobian routines ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_PCSide(__pyx_v_side); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 275, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":272
* CHKERR( SNESSetNPCSide(self.snes, side) )
*
* def getNPCSide(self): # <<<<<<<<<<<<<<
* cdef PetscPCSide side = PC_RIGHT
* CHKERR( SNESGetNPCSide(self.snes, &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":279
* # --- user Function/Jacobian routines ---
*
* def setLineSearchPreCheck(self, precheck, args=None, kargs=None): # <<<<<<<<<<<<<<
* cdef PetscSNESLineSearch snesls = NULL
* CHKERR( SNESGetLineSearch(self.snes, &snesls) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_67setLineSearchPreCheck(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_66setLineSearchPreCheck[] = "SNES.setLineSearchPreCheck(self, precheck, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_67setLineSearchPreCheck(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_precheck = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precheck,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_precheck)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLineSearchPreCheck") < 0)) __PYX_ERR(49, 279, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_precheck = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setLineSearchPreCheck", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 279, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setLineSearchPreCheck", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_66setLineSearchPreCheck(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_precheck, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_66setLineSearchPreCheck(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_precheck, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
SNESLineSearch __pyx_v_snesls;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = 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":280
*
* def setLineSearchPreCheck(self, precheck, args=None, kargs=None):
* cdef PetscSNESLineSearch snesls = NULL # <<<<<<<<<<<<<<
* CHKERR( SNESGetLineSearch(self.snes, &snesls) )
* if precheck is not None:
*/
__pyx_v_snesls = NULL;
/* "petsc4py/PETSc/SNES.pyx":281
* def setLineSearchPreCheck(self, precheck, args=None, kargs=None):
* 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(49, 281, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":282
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/SNES.pyx":283
* 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_3 = (__pyx_v_args == Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/SNES.pyx":284
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4);
__pyx_t_4 = 0;
}
/* "petsc4py/PETSc/SNES.pyx":285
* if args is None: args = ()
* if kargs is None: kargs = {}
* context = (precheck, args, kargs) # <<<<<<<<<<<<<<
* self.set_attr('__precheck__', context)
* CHKERR( SNESLineSearchSetPreCheck(snesls, SNES_PreCheck, <void*> context) )
*/
__pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_precheck);
__Pyx_GIVEREF(__pyx_v_precheck);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_precheck);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/SNES.pyx":286
* if kargs is None: kargs = {}
* context = (precheck, args, kargs)
* self.set_attr('__precheck__', context) # <<<<<<<<<<<<<<
* CHKERR( SNESLineSearchSetPreCheck(snesls, SNES_PreCheck, <void*> context) )
* else:
*/
__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 *)"__precheck__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 286, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/SNES.pyx":287
* context = (precheck, args, kargs)
* self.set_attr('__precheck__', context)
* 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(49, 287, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":282
* 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":289
* CHKERR( SNESLineSearchSetPreCheck(snesls, SNES_PreCheck, <void*> context) )
* else:
* self.set_attr('__precheck__', None) # <<<<<<<<<<<<<<
* CHKERR( SNESLineSearchSetPreCheck(snesls, NULL, NULL) )
*
*/
/*else*/ {
__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 *)"__precheck__"), Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/SNES.pyx":290
* else:
* self.set_attr('__precheck__', None)
* CHKERR( SNESLineSearchSetPreCheck(snesls, NULL, NULL) ) # <<<<<<<<<<<<<<
*
* def setInitialGuess(self, initialguess, args=None, kargs=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(49, 290, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/SNES.pyx":279
* # --- user Function/Jacobian routines ---
*
* def setLineSearchPreCheck(self, precheck, args=None, kargs=None): # <<<<<<<<<<<<<<
* cdef PetscSNESLineSearch snesls = NULL
* CHKERR( SNESGetLineSearch(self.snes, &snesls) )
*/
/* 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.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":292
* CHKERR( SNESLineSearchSetPreCheck(snesls, NULL, NULL) )
*
* def setInitialGuess(self, initialguess, args=None, kargs=None): # <<<<<<<<<<<<<<
* if initialguess is not None:
* if args is None: args = ()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_69setInitialGuess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_68setInitialGuess[] = "SNES.setInitialGuess(self, initialguess, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_69setInitialGuess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_initialguess = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_initialguess,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_initialguess)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setInitialGuess") < 0)) __PYX_ERR(49, 292, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_initialguess = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setInitialGuess", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 292, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setInitialGuess", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_68setInitialGuess(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_initialguess, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_68setInitialGuess(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_initialguess, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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("setInitialGuess", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/SNES.pyx":293
*
* def setInitialGuess(self, initialguess, args=None, kargs=None):
* if initialguess is not None: # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
__pyx_t_1 = (__pyx_v_initialguess != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/SNES.pyx":294
* def setInitialGuess(self, initialguess, args=None, kargs=None):
* if initialguess is not None:
* if args is None: args = () # <<<<<<<<<<<<<<
* if kargs is None: kargs = {}
* context = (initialguess, args, kargs)
*/
__pyx_t_2 = (__pyx_v_args == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/SNES.pyx":295
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 295, __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":296
* if args is None: args = ()
* if kargs is None: kargs = {}
* context = (initialguess, args, kargs) # <<<<<<<<<<<<<<
* self.set_attr('__initialguess__', context)
* CHKERR( SNESSetInitialGuess(self.snes, SNES_InitialGuess, <void*>context) )
*/
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 296, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_initialguess);
__Pyx_GIVEREF(__pyx_v_initialguess);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_initialguess);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":297
* if kargs is None: kargs = {}
* context = (initialguess, args, kargs)
* self.set_attr('__initialguess__', context) # <<<<<<<<<<<<<<
* CHKERR( SNESSetInitialGuess(self.snes, SNES_InitialGuess, <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 *)"__initialguess__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":298
* context = (initialguess, args, kargs)
* self.set_attr('__initialguess__', context)
* CHKERR( SNESSetInitialGuess(self.snes, SNES_InitialGuess, <void*>context) ) # <<<<<<<<<<<<<<
* else:
* self.set_attr('__initialguess__', None)
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetComputeInitialGuess(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_InitialGuess, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 298, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":293
*
* def setInitialGuess(self, initialguess, args=None, kargs=None):
* if initialguess is not None: # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/SNES.pyx":300
* CHKERR( SNESSetInitialGuess(self.snes, SNES_InitialGuess, <void*>context) )
* else:
* self.set_attr('__initialguess__', None) # <<<<<<<<<<<<<<
* CHKERR( SNESSetInitialGuess(self.snes, 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 *)"__initialguess__"), Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 300, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":301
* else:
* self.set_attr('__initialguess__', None)
* CHKERR( SNESSetInitialGuess(self.snes, NULL, NULL) ) # <<<<<<<<<<<<<<
*
* def getInitialGuess(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetComputeInitialGuess(__pyx_v_self->snes, NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 301, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/SNES.pyx":292
* CHKERR( SNESLineSearchSetPreCheck(snesls, NULL, NULL) )
*
* def setInitialGuess(self, initialguess, args=None, kargs=None): # <<<<<<<<<<<<<<
* if initialguess is not None:
* 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_3);
__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":303
* CHKERR( SNESSetInitialGuess(self.snes, NULL, NULL) )
*
* def getInitialGuess(self): # <<<<<<<<<<<<<<
* return self.get_attr('__initialguess__')
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_71getInitialGuess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_70getInitialGuess[] = "SNES.getInitialGuess(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_71getInitialGuess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getInitialGuess (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getInitialGuess", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInitialGuess", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_70getInitialGuess(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_70getInitialGuess(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getInitialGuess", 0);
/* "petsc4py/PETSc/SNES.pyx":304
*
* def getInitialGuess(self):
* return self.get_attr('__initialguess__') # <<<<<<<<<<<<<<
*
* def setFunction(self, function, Vec f or None, args=None, kargs=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(49, 304, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":303
* CHKERR( SNESSetInitialGuess(self.snes, NULL, NULL) )
*
* def getInitialGuess(self): # <<<<<<<<<<<<<<
* return self.get_attr('__initialguess__')
*
*/
/* 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":306
* return self.get_attr('__initialguess__')
*
* def setFunction(self, function, Vec f or None, args=None, kargs=None): # <<<<<<<<<<<<<<
* cdef PetscVec fvec=NULL
* if f is not None: fvec = f.vec
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_73setFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_72setFunction[] = "SNES.setFunction(self, function, Vec f, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_73setFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_function = 0;
struct PyPetscVecObject *__pyx_v_f = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_f,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[4] = {0,0,0,0};
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setFunction", 0, 2, 4, 1); __PYX_ERR(49, 306, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFunction") < 0)) __PYX_ERR(49, 306, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_function = values[0];
__pyx_v_f = ((struct PyPetscVecObject *)values[1]);
__pyx_v_args = values[2];
__pyx_v_kargs = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFunction", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 306, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setFunction", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "f", 0))) __PYX_ERR(49, 306, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_72setFunction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_function, __pyx_v_f, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_72setFunction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
Vec __pyx_v_fvec;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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("setFunction", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/SNES.pyx":307
*
* def setFunction(self, function, Vec f or None, args=None, kargs=None):
* 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":308
* def setFunction(self, function, Vec f or None, args=None, kargs=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_f->vec;
__pyx_v_fvec = __pyx_t_3;
}
/* "petsc4py/PETSc/SNES.pyx":309
* 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_2 = (__pyx_v_function != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/SNES.pyx":310
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/SNES.pyx":311
* 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_2 = (__pyx_v_kargs == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4);
__pyx_t_4 = 0;
}
/* "petsc4py/PETSc/SNES.pyx":312
* 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_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_function);
__Pyx_GIVEREF(__pyx_v_function);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_function);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/SNES.pyx":313
* 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_4 = ((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_4)) __PYX_ERR(49, 313, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/SNES.pyx":314
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 314, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":309
* 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":316
* CHKERR( SNESSetFunction(self.snes, fvec, SNES_Function, <void*>context) )
* else:
* CHKERR( SNESSetFunction(self.snes, fvec, NULL, NULL) ) # <<<<<<<<<<<<<<
*
* def getFunction(self):
*/
/*else*/ {
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetFunction(__pyx_v_self->snes, __pyx_v_fvec, NULL, NULL)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 316, __pyx_L1_error)
}
__pyx_L4:;
/* "petsc4py/PETSc/SNES.pyx":306
* return self.get_attr('__initialguess__')
*
* def setFunction(self, function, Vec f or None, args=None, kargs=None): # <<<<<<<<<<<<<<
* cdef PetscVec fvec=NULL
* if f is not None: fvec = f.vec
*/
/* 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.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":318
* CHKERR( SNESSetFunction(self.snes, fvec, NULL, NULL) )
*
* def getFunction(self): # <<<<<<<<<<<<<<
* cdef Vec f = Vec()
* cdef void* ctx
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_75getFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_74getFunction[] = "SNES.getFunction(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_75getFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFunction (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFunction", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFunction", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_74getFunction(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_74getFunction(struct PyPetscSNESObject *__pyx_v_self) {
struct PyPetscVecObject *__pyx_v_f = 0;
void *__pyx_v_ctx;
PetscErrorCode (*__pyx_v_fun)(SNES, Vec, Vec, void *);
PyObject *__pyx_v_function = 0;
PyObject *__pyx_v_context = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getFunction", 0);
/* "petsc4py/PETSc/SNES.pyx":319
*
* def getFunction(self):
* cdef Vec f = Vec() # <<<<<<<<<<<<<<
* cdef void* ctx
* cdef PetscErrorCode (*fun)(PetscSNES,PetscVec,PetscVec,void*)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 319, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_f = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":322
* cdef void* ctx
* cdef PetscErrorCode (*fun)(PetscSNES,PetscVec,PetscVec,void*)
* CHKERR( SNESGetFunction(self.snes, &f.vec, &fun, &ctx) ) # <<<<<<<<<<<<<<
* PetscINCREF(f.obj)
* cdef object function = self.get_attr('__function__')
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetFunction(__pyx_v_self->snes, (&__pyx_v_f->vec), (&__pyx_v_fun), (&__pyx_v_ctx))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 322, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":323
* cdef PetscErrorCode (*fun)(PetscSNES,PetscVec,PetscVec,void*)
* CHKERR( SNESGetFunction(self.snes, &f.vec, &fun, &ctx) )
* PetscINCREF(f.obj) # <<<<<<<<<<<<<<
* cdef object function = self.get_attr('__function__')
* cdef object context
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_f->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":324
* CHKERR( SNESGetFunction(self.snes, &f.vec, &fun, &ctx) )
* 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(49, 324, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_function = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":327
* cdef object context
*
* if function is not None: # <<<<<<<<<<<<<<
* return (f, function)
*
*/
__pyx_t_3 = (__pyx_v_function != Py_None);
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
/* "petsc4py/PETSc/SNES.pyx":328
*
* 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(49, 328, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_f));
__Pyx_GIVEREF(((PyObject *)__pyx_v_f));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f));
__Pyx_INCREF(__pyx_v_function);
__Pyx_GIVEREF(__pyx_v_function);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_function);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":327
* cdef object context
*
* if function is not None: # <<<<<<<<<<<<<<
* return (f, function)
*
*/
}
/* "petsc4py/PETSc/SNES.pyx":330
* return (f, function)
*
* if ctx != NULL and <void*>SNES_Function == <void*>fun: # <<<<<<<<<<<<<<
* context = <object>ctx
* if context is not None:
*/
__pyx_t_3 = ((__pyx_v_ctx != NULL) != 0);
if (__pyx_t_3) {
} else {
__pyx_t_4 = __pyx_t_3;
goto __pyx_L5_bool_binop_done;
}
__pyx_t_3 = ((((void *)__pyx_f_8petsc4py_5PETSc_SNES_Function) == ((void *)__pyx_v_fun)) != 0);
__pyx_t_4 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
if (__pyx_t_4) {
/* "petsc4py/PETSc/SNES.pyx":331
*
* 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":332
* 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_4 = (__pyx_v_context != Py_None);
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
/* "petsc4py/PETSc/SNES.pyx":333
* 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_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
if (unlikely(!(__pyx_t_3 != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(49, 333, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/SNES.pyx":334
* 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(49, 334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_f));
__Pyx_GIVEREF(((PyObject *)__pyx_v_f));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f));
__Pyx_INCREF(__pyx_v_context);
__Pyx_GIVEREF(__pyx_v_context);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_context);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":332
* 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":330
* return (f, function)
*
* if ctx != NULL and <void*>SNES_Function == <void*>fun: # <<<<<<<<<<<<<<
* context = <object>ctx
* if context is not None:
*/
}
/* "petsc4py/PETSc/SNES.pyx":336
* return (f, context)
*
* return (f, None) # <<<<<<<<<<<<<<
*
* def setUpdate(self, update, args=None, kargs=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 336, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_f));
__Pyx_GIVEREF(((PyObject *)__pyx_v_f));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f));
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":318
* CHKERR( SNESSetFunction(self.snes, fvec, NULL, NULL) )
*
* def getFunction(self): # <<<<<<<<<<<<<<
* cdef Vec f = Vec()
* cdef void* ctx
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getFunction", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_f);
__Pyx_XDECREF(__pyx_v_function);
__Pyx_XDECREF(__pyx_v_context);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":338
* return (f, None)
*
* def setUpdate(self, update, args=None, kargs=None): # <<<<<<<<<<<<<<
* if update is not None:
* if args is None: args = ()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_77setUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_76setUpdate[] = "SNES.setUpdate(self, update, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_77setUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_update = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_update,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_update)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setUpdate") < 0)) __PYX_ERR(49, 338, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_update = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setUpdate", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 338, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_76setUpdate(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_update, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_76setUpdate(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_update, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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("setUpdate", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/SNES.pyx":339
*
* def setUpdate(self, update, args=None, kargs=None):
* if update is not None: # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
__pyx_t_1 = (__pyx_v_update != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/SNES.pyx":340
* def setUpdate(self, update, args=None, kargs=None):
* if update is not None:
* if args is None: args = () # <<<<<<<<<<<<<<
* if kargs is None: kargs = {}
* context = (update, args, kargs)
*/
__pyx_t_2 = (__pyx_v_args == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/SNES.pyx":341
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 341, __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":342
* 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_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 342, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_update);
__Pyx_GIVEREF(__pyx_v_update);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_update);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":343
* if kargs is None: kargs = {}
* context = (update, args, kargs)
* self.set_attr('__update__', context) # <<<<<<<<<<<<<<
* CHKERR( SNESSetUpdate(self.snes, SNES_Update) )
* 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 *)"__update__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 343, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":344
* context = (update, args, kargs)
* self.set_attr('__update__', context)
* CHKERR( SNESSetUpdate(self.snes, SNES_Update) ) # <<<<<<<<<<<<<<
* else:
* self.set_attr('__update__', None)
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetUpdate(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_Update)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 344, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":339
*
* def setUpdate(self, update, args=None, kargs=None):
* if update is not None: # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/SNES.pyx":346
* CHKERR( SNESSetUpdate(self.snes, SNES_Update) )
* else:
* self.set_attr('__update__', None) # <<<<<<<<<<<<<<
* CHKERR( SNESSetUpdate(self.snes, 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 *)"__update__"), Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":347
* else:
* self.set_attr('__update__', None)
* CHKERR( SNESSetUpdate(self.snes, NULL) ) # <<<<<<<<<<<<<<
*
* def getUpdate(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetUpdate(__pyx_v_self->snes, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 347, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/SNES.pyx":338
* return (f, None)
*
* def setUpdate(self, update, args=None, kargs=None): # <<<<<<<<<<<<<<
* if update is not None:
* 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_3);
__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":349
* CHKERR( SNESSetUpdate(self.snes, NULL) )
*
* def getUpdate(self): # <<<<<<<<<<<<<<
* return self.get_attr('__update__')
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_79getUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_78getUpdate[] = "SNES.getUpdate(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_79getUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getUpdate (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getUpdate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getUpdate", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_78getUpdate(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_78getUpdate(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getUpdate", 0);
/* "petsc4py/PETSc/SNES.pyx":350
*
* def getUpdate(self):
* return self.get_attr('__update__') # <<<<<<<<<<<<<<
*
* def setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__update__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 350, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":349
* CHKERR( SNESSetUpdate(self.snes, NULL) )
*
* def getUpdate(self): # <<<<<<<<<<<<<<
* return self.get_attr('__update__')
*
*/
/* 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":352
* return self.get_attr('__update__')
*
* def setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): # <<<<<<<<<<<<<<
* cdef PetscMat Jmat=NULL
* if J is not None: Jmat = J.mat
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_81setJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_80setJacobian[] = "SNES.setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_81setJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setJacobian (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[5] = {0,0,0,0,0};
values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None);
values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None);
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[4] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setJacobian") < 0)) __PYX_ERR(49, 352, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_jacobian = values[0];
__pyx_v_J = ((struct PyPetscMatObject *)values[1]);
__pyx_v_P = ((struct PyPetscMatObject *)values[2]);
__pyx_v_args = values[3];
__pyx_v_kargs = values[4];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setJacobian", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 352, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(49, 352, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(49, 352, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_80setJacobian(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_80setJacobian(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
Mat __pyx_v_Jmat;
Mat __pyx_v_Pmat;
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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("setJacobian", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/SNES.pyx":353
*
* def setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None):
* cdef PetscMat Jmat=NULL # <<<<<<<<<<<<<<
* if J is not None: Jmat = J.mat
* cdef PetscMat Pmat=Jmat
*/
__pyx_v_Jmat = NULL;
/* "petsc4py/PETSc/SNES.pyx":354
* def setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_J->mat;
__pyx_v_Jmat = __pyx_t_3;
}
/* "petsc4py/PETSc/SNES.pyx":355
* 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":356
* 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);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __pyx_v_P->mat;
__pyx_v_Pmat = __pyx_t_3;
}
/* "petsc4py/PETSc/SNES.pyx":357
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/SNES.pyx":358
* 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);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/SNES.pyx":359
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 359, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4);
__pyx_t_4 = 0;
}
/* "petsc4py/PETSc/SNES.pyx":360
* 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_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 360, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_jacobian);
__Pyx_GIVEREF(__pyx_v_jacobian);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_jacobian);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
/* "petsc4py/PETSc/SNES.pyx":361
* 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_4 = ((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_4)) __PYX_ERR(49, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
/* "petsc4py/PETSc/SNES.pyx":362
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 362, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":357
* 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":364
* CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, SNES_Jacobian, <void*>context) )
* else:
* CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, NULL, NULL) ) # <<<<<<<<<<<<<<
*
* def getJacobian(self):
*/
/*else*/ {
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetJacobian(__pyx_v_self->snes, __pyx_v_Jmat, __pyx_v_Pmat, NULL, NULL)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 364, __pyx_L1_error)
}
__pyx_L5:;
/* "petsc4py/PETSc/SNES.pyx":352
* return self.get_attr('__update__')
*
* def setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): # <<<<<<<<<<<<<<
* cdef PetscMat Jmat=NULL
* if J is not None: Jmat = J.mat
*/
/* 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.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":366
* CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, NULL, NULL) )
*
* def getJacobian(self): # <<<<<<<<<<<<<<
* cdef Mat J = Mat()
* cdef Mat P = Mat()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_83getJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_82getJacobian[] = "SNES.getJacobian(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_83getJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getJacobian (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getJacobian", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getJacobian", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_82getJacobian(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_82getJacobian(struct PyPetscSNESObject *__pyx_v_self) {
struct PyPetscMatObject *__pyx_v_J = 0;
struct PyPetscMatObject *__pyx_v_P = 0;
PyObject *__pyx_v_jacobian = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getJacobian", 0);
/* "petsc4py/PETSc/SNES.pyx":367
*
* def getJacobian(self):
* cdef Mat J = Mat() # <<<<<<<<<<<<<<
* cdef Mat P = Mat()
* CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) )
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":368
* def getJacobian(self):
* cdef Mat J = Mat()
* cdef Mat P = Mat() # <<<<<<<<<<<<<<
* CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) )
* PetscINCREF(J.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 368, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":369
* cdef Mat J = Mat()
* cdef Mat P = Mat()
* CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) ) # <<<<<<<<<<<<<<
* PetscINCREF(J.obj)
* PetscINCREF(P.obj)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetJacobian(__pyx_v_self->snes, (&__pyx_v_J->mat), (&__pyx_v_P->mat), NULL, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 369, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":370
* cdef Mat P = Mat()
* CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) )
* PetscINCREF(J.obj) # <<<<<<<<<<<<<<
* PetscINCREF(P.obj)
* cdef object jacobian = self.get_attr('__jacobian__')
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":371
* CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) )
* PetscINCREF(J.obj)
* PetscINCREF(P.obj) # <<<<<<<<<<<<<<
* cdef object jacobian = self.get_attr('__jacobian__')
* return (J, P, jacobian)
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":372
* PetscINCREF(J.obj)
* 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(49, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_jacobian = __pyx_t_1;
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":373
* PetscINCREF(P.obj)
* cdef object jacobian = self.get_attr('__jacobian__')
* return (J, P, jacobian) # <<<<<<<<<<<<<<
*
* def setObjective(self, objective, args=None, kargs=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_J));
__Pyx_GIVEREF(((PyObject *)__pyx_v_J));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_J));
__Pyx_INCREF(((PyObject *)__pyx_v_P));
__Pyx_GIVEREF(((PyObject *)__pyx_v_P));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P));
__Pyx_INCREF(__pyx_v_jacobian);
__Pyx_GIVEREF(__pyx_v_jacobian);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_jacobian);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":366
* CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, NULL, NULL) )
*
* def getJacobian(self): # <<<<<<<<<<<<<<
* cdef Mat J = Mat()
* cdef Mat P = Mat()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_J);
__Pyx_XDECREF((PyObject *)__pyx_v_P);
__Pyx_XDECREF(__pyx_v_jacobian);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":375
* return (J, P, jacobian)
*
* def setObjective(self, objective, args=None, kargs=None): # <<<<<<<<<<<<<<
* if objective is not None:
* if args is None: args = ()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_85setObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_84setObjective[] = "SNES.setObjective(self, objective, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_85setObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_objective = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objective,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objective)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setObjective") < 0)) __PYX_ERR(49, 375, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_objective = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setObjective", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 375, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setObjective", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_84setObjective(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_objective, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_84setObjective(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_objective, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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("setObjective", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/SNES.pyx":376
*
* def setObjective(self, objective, args=None, kargs=None):
* if objective is not None: # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
__pyx_t_1 = (__pyx_v_objective != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/SNES.pyx":377
* def setObjective(self, objective, args=None, kargs=None):
* if objective is not None:
* if args is None: args = () # <<<<<<<<<<<<<<
* if kargs is None: kargs = {}
* context = (objective, args, kargs)
*/
__pyx_t_2 = (__pyx_v_args == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/SNES.pyx":378
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 378, __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":379
* 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_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 379, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_objective);
__Pyx_GIVEREF(__pyx_v_objective);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_objective);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":380
* 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_3 = ((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_3)) __PYX_ERR(49, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":381
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetObjective(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_Objective, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 381, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":376
*
* def setObjective(self, objective, args=None, kargs=None):
* if objective is not None: # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/SNES.pyx":383
* CHKERR( SNESSetObjective(self.snes, SNES_Objective, <void*>context) )
* else:
* CHKERR( SNESSetObjective(self.snes, NULL, NULL) ) # <<<<<<<<<<<<<<
*
* def getObjective(self):
*/
/*else*/ {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetObjective(__pyx_v_self->snes, NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 383, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/SNES.pyx":375
* return (J, P, jacobian)
*
* def setObjective(self, objective, args=None, kargs=None): # <<<<<<<<<<<<<<
* if objective is not None:
* 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_3);
__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":385
* CHKERR( SNESSetObjective(self.snes, NULL, NULL) )
*
* def getObjective(self): # <<<<<<<<<<<<<<
* CHKERR( SNESGetObjective(self.snes, NULL, NULL) )
* cdef object objective = self.get_attr('__objective__')
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_87getObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_86getObjective[] = "SNES.getObjective(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_87getObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getObjective (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getObjective", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getObjective", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_86getObjective(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_86getObjective(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_v_objective = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getObjective", 0);
/* "petsc4py/PETSc/SNES.pyx":386
*
* def getObjective(self):
* 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(49, 386, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":387
* def getObjective(self):
* 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(49, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_objective = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":388
* CHKERR( SNESGetObjective(self.snes, NULL, NULL) )
* cdef object objective = self.get_attr('__objective__')
* return objective # <<<<<<<<<<<<<<
*
* def computeFunction(self, Vec x, Vec f):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_objective);
__pyx_r = __pyx_v_objective;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":385
* CHKERR( SNESSetObjective(self.snes, NULL, NULL) )
*
* def getObjective(self): # <<<<<<<<<<<<<<
* CHKERR( SNESGetObjective(self.snes, NULL, NULL) )
* cdef object objective = self.get_attr('__objective__')
*/
/* 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":390
* return objective
*
* def computeFunction(self, Vec x, Vec f): # <<<<<<<<<<<<<<
* CHKERR( SNESComputeFunction(self.snes, x.vec, f.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_89computeFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_88computeFunction[] = "SNES.computeFunction(self, Vec x, Vec f)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_89computeFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_f = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_f,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("computeFunction", 1, 2, 2, 1); __PYX_ERR(49, 390, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeFunction") < 0)) __PYX_ERR(49, 390, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_f = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("computeFunction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 390, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.computeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(49, 390, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(49, 390, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_88computeFunction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_x, __pyx_v_f);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_88computeFunction(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("computeFunction", 0);
/* "petsc4py/PETSc/SNES.pyx":391
*
* def computeFunction(self, Vec x, Vec f):
* CHKERR( SNESComputeFunction(self.snes, x.vec, f.vec) ) # <<<<<<<<<<<<<<
*
* def computeJacobian(self, Vec x, Mat J, Mat P=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(49, 391, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":390
* return objective
*
* def computeFunction(self, Vec x, Vec f): # <<<<<<<<<<<<<<
* CHKERR( SNESComputeFunction(self.snes, x.vec, f.vec) )
*
*/
/* 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":393
* CHKERR( SNESComputeFunction(self.snes, x.vec, f.vec) )
*
* def computeJacobian(self, Vec x, Mat J, Mat P=None): # <<<<<<<<<<<<<<
* cdef PetscMat jmat = J.mat, pmat = J.mat
* if P is not None: pmat = P.mat
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_91computeJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_90computeJacobian[] = "SNES.computeJacobian(self, Vec x, Mat J, Mat P=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_91computeJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscMatObject *__pyx_v_J = 0;
struct PyPetscMatObject *__pyx_v_P = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_J,&__pyx_n_s_P,0};
PyObject* values[3] = {0,0,0};
values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("computeJacobian", 0, 2, 3, 1); __PYX_ERR(49, 393, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeJacobian") < 0)) __PYX_ERR(49, 393, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_J = ((struct PyPetscMatObject *)values[1]);
__pyx_v_P = ((struct PyPetscMatObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("computeJacobian", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 393, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.computeJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(49, 393, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(49, 393, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(49, 393, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_90computeJacobian(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_x, __pyx_v_J, __pyx_v_P);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_90computeJacobian(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P) {
Mat __pyx_v_jmat;
Mat __pyx_v_pmat;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
Mat __pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("computeJacobian", 0);
/* "petsc4py/PETSc/SNES.pyx":394
*
* def computeJacobian(self, Vec x, Mat J, Mat P=None):
* 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":395
* def computeJacobian(self, Vec x, Mat J, Mat P=None):
* 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);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
__pyx_t_1 = __pyx_v_P->mat;
__pyx_v_pmat = __pyx_t_1;
}
/* "petsc4py/PETSc/SNES.pyx":396
* 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):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESComputeJacobian(__pyx_v_self->snes, __pyx_v_x->vec, __pyx_v_jmat, __pyx_v_pmat)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 396, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":393
* CHKERR( SNESComputeFunction(self.snes, x.vec, f.vec) )
*
* def computeJacobian(self, Vec x, Mat J, Mat P=None): # <<<<<<<<<<<<<<
* cdef PetscMat jmat = J.mat, pmat = J.mat
* if P is not None: pmat = P.mat
*/
/* 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":398
* CHKERR( SNESComputeJacobian(self.snes, x.vec, jmat, pmat) )
*
* def computeObjective(self, Vec x): # <<<<<<<<<<<<<<
* cdef PetscReal o = 0
* CHKERR( SNESComputeObjective(self.snes, x.vec, &o) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_93computeObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_92computeObjective[] = "SNES.computeObjective(self, Vec x)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_93computeObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeObjective") < 0)) __PYX_ERR(49, 398, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("computeObjective", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 398, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.computeObjective", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(49, 398, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_92computeObjective(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_x);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_92computeObjective(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x) {
PetscReal __pyx_v_o;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("computeObjective", 0);
/* "petsc4py/PETSc/SNES.pyx":399
*
* def computeObjective(self, Vec x):
* cdef PetscReal o = 0 # <<<<<<<<<<<<<<
* CHKERR( SNESComputeObjective(self.snes, x.vec, &o) )
* return toReal(o)
*/
__pyx_v_o = 0.0;
/* "petsc4py/PETSc/SNES.pyx":400
* def computeObjective(self, Vec x):
* 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(49, 400, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":401
* cdef PetscReal o = 0
* CHKERR( SNESComputeObjective(self.snes, x.vec, &o) )
* return toReal(o) # <<<<<<<<<<<<<<
*
* def setNGS(self, ngs, args=None, kargs=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_o); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 401, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":398
* CHKERR( SNESComputeJacobian(self.snes, x.vec, jmat, pmat) )
*
* def computeObjective(self, Vec x): # <<<<<<<<<<<<<<
* cdef PetscReal o = 0
* CHKERR( SNESComputeObjective(self.snes, x.vec, &o) )
*/
/* 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":403
* return toReal(o)
*
* def setNGS(self, ngs, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_95setNGS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_94setNGS[] = "SNES.setNGS(self, ngs, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_95setNGS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ngs = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ngs,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ngs)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNGS") < 0)) __PYX_ERR(49, 403, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_ngs = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setNGS", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 403, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setNGS", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_94setNGS(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_ngs, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_94setNGS(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_ngs, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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("setNGS", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/SNES.pyx":404
*
* def setNGS(self, ngs, args=None, kargs=None):
* if args is None: args = () # <<<<<<<<<<<<<<
* if kargs is None: kargs = {}
* context = (ngs, args, kargs)
*/
__pyx_t_1 = (__pyx_v_args == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/SNES.pyx":405
* def setNGS(self, ngs, args=None, kargs=None):
* if args is None: args = ()
* if kargs is None: kargs = {} # <<<<<<<<<<<<<<
* context = (ngs, args, kargs)
* self.set_attr('__ngs__', context)
*/
__pyx_t_2 = (__pyx_v_kargs == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 405, __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":406
* 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_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_ngs);
__Pyx_GIVEREF(__pyx_v_ngs);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ngs);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":407
* if kargs is None: kargs = {}
* context = (ngs, args, kargs)
* self.set_attr('__ngs__', context) # <<<<<<<<<<<<<<
* CHKERR( SNESSetNGS(self.snes, SNES_NGS, <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 *)"__ngs__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":408
* context = (ngs, args, kargs)
* self.set_attr('__ngs__', context)
* CHKERR( SNESSetNGS(self.snes, SNES_NGS, <void*>context) ) # <<<<<<<<<<<<<<
*
* def getNGS(self):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetNGS(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_NGS, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 408, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":403
* return toReal(o)
*
* def setNGS(self, ngs, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":410
* CHKERR( SNESSetNGS(self.snes, SNES_NGS, <void*>context) )
*
* def getNGS(self): # <<<<<<<<<<<<<<
* CHKERR( SNESGetNGS(self.snes, NULL, NULL) )
* cdef object ngs = self.get_attr('__ngs__')
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_97getNGS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_96getNGS[] = "SNES.getNGS(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_97getNGS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNGS (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNGS", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNGS", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_96getNGS(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_96getNGS(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_v_ngs = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNGS", 0);
/* "petsc4py/PETSc/SNES.pyx":411
*
* def getNGS(self):
* 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(49, 411, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":412
* def getNGS(self):
* 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(49, 412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_ngs = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":413
* CHKERR( SNESGetNGS(self.snes, NULL, NULL) )
* cdef object ngs = self.get_attr('__ngs__')
* return ngs # <<<<<<<<<<<<<<
*
* def computeNGS(self, Vec x, Vec b=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_ngs);
__pyx_r = __pyx_v_ngs;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":410
* CHKERR( SNESSetNGS(self.snes, SNES_NGS, <void*>context) )
*
* def getNGS(self): # <<<<<<<<<<<<<<
* CHKERR( SNESGetNGS(self.snes, NULL, NULL) )
* cdef object ngs = self.get_attr('__ngs__')
*/
/* 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":415
* return ngs
*
* def computeNGS(self, Vec x, Vec b=None): # <<<<<<<<<<<<<<
* cdef PetscVec bvec = NULL
* if b is not None: bvec = b.vec
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_99computeNGS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_98computeNGS[] = "SNES.computeNGS(self, Vec x, Vec b=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_99computeNGS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_x = 0;
struct PyPetscVecObject *__pyx_v_b = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_b,0};
PyObject* values[2] = {0,0};
values[1] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeNGS") < 0)) __PYX_ERR(49, 415, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_x = ((struct PyPetscVecObject *)values[0]);
__pyx_v_b = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("computeNGS", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 415, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.computeNGS", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(49, 415, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(49, 415, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_98computeNGS(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_x, __pyx_v_b);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_98computeNGS(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b) {
Vec __pyx_v_bvec;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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("computeNGS", 0);
/* "petsc4py/PETSc/SNES.pyx":416
*
* def computeNGS(self, Vec x, Vec b=None):
* 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":417
* def computeNGS(self, Vec x, Vec b=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_b->vec;
__pyx_v_bvec = __pyx_t_3;
}
/* "petsc4py/PETSc/SNES.pyx":418
* cdef PetscVec bvec = NULL
* if b is not None: bvec = b.vec
* CHKERR( SNESComputeNGS(self.snes, bvec, x.vec) ) # <<<<<<<<<<<<<<
*
* # --- tolerances and convergence ---
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESComputeNGS(__pyx_v_self->snes, __pyx_v_bvec, __pyx_v_x->vec)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 418, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":415
* return ngs
*
* def computeNGS(self, Vec x, Vec b=None): # <<<<<<<<<<<<<<
* cdef PetscVec bvec = NULL
* if b is not None: bvec = b.vec
*/
/* 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":422
* # --- tolerances and convergence ---
*
* def setTolerances(self, rtol=None, atol=None, stol=None, max_it=None): # <<<<<<<<<<<<<<
* cdef PetscReal crtol, catol, cstol
* crtol = catol = cstol = PETSC_DEFAULT
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_101setTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_100setTolerances[] = "SNES.setTolerances(self, rtol=None, atol=None, stol=None, max_it=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_101setTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_rtol = 0;
PyObject *__pyx_v_atol = 0;
PyObject *__pyx_v_stol = 0;
PyObject *__pyx_v_max_it = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rtol,&__pyx_n_s_atol,&__pyx_n_s_stol,&__pyx_n_s_max_it,0};
PyObject* values[4] = {0,0,0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rtol);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_atol);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stol);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_it);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTolerances") < 0)) __PYX_ERR(49, 422, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_rtol = values[0];
__pyx_v_atol = values[1];
__pyx_v_stol = values[2];
__pyx_v_max_it = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setTolerances", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 422, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_100setTolerances(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_rtol, __pyx_v_atol, __pyx_v_stol, __pyx_v_max_it);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_100setTolerances(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol, PyObject *__pyx_v_stol, PyObject *__pyx_v_max_it) {
PetscReal __pyx_v_crtol;
PetscReal __pyx_v_catol;
PetscReal __pyx_v_cstol;
PetscInt __pyx_v_cmaxit;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PetscReal __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("setTolerances", 0);
/* "petsc4py/PETSc/SNES.pyx":424
* def setTolerances(self, rtol=None, atol=None, stol=None, max_it=None):
* cdef PetscReal crtol, catol, cstol
* crtol = catol = cstol = PETSC_DEFAULT # <<<<<<<<<<<<<<
* cdef PetscInt cmaxit = PETSC_DEFAULT
* if rtol is not None: crtol = asReal(rtol)
*/
__pyx_v_crtol = PETSC_DEFAULT;
__pyx_v_catol = PETSC_DEFAULT;
__pyx_v_cstol = PETSC_DEFAULT;
/* "petsc4py/PETSc/SNES.pyx":425
* cdef PetscReal crtol, catol, cstol
* crtol = catol = cstol = PETSC_DEFAULT
* cdef PetscInt cmaxit = PETSC_DEFAULT # <<<<<<<<<<<<<<
* if rtol is not None: crtol = asReal(rtol)
* if atol is not None: catol = asReal(atol)
*/
__pyx_v_cmaxit = PETSC_DEFAULT;
/* "petsc4py/PETSc/SNES.pyx":426
* crtol = catol = cstol = PETSC_DEFAULT
* cdef PetscInt cmaxit = PETSC_DEFAULT
* if rtol is not None: crtol = asReal(rtol) # <<<<<<<<<<<<<<
* if atol is not None: catol = asReal(atol)
* if stol is not None: cstol = asReal(stol)
*/
__pyx_t_1 = (__pyx_v_rtol != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 426, __pyx_L1_error)
__pyx_v_crtol = __pyx_t_3;
}
/* "petsc4py/PETSc/SNES.pyx":427
* cdef PetscInt cmaxit = PETSC_DEFAULT
* if rtol is not None: crtol = asReal(rtol)
* if atol is not None: catol = asReal(atol) # <<<<<<<<<<<<<<
* if stol is not None: cstol = asReal(stol)
* if max_it is not None: cmaxit = asInt(max_it)
*/
__pyx_t_2 = (__pyx_v_atol != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_atol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 427, __pyx_L1_error)
__pyx_v_catol = __pyx_t_3;
}
/* "petsc4py/PETSc/SNES.pyx":428
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_stol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 428, __pyx_L1_error)
__pyx_v_cstol = __pyx_t_3;
}
/* "petsc4py/PETSc/SNES.pyx":429
* if atol is not None: catol = asReal(atol)
* if stol is not None: cstol = asReal(stol)
* if max_it is not None: cmaxit = asInt(max_it) # <<<<<<<<<<<<<<
* CHKERR( SNESSetTolerances(self.snes, catol, crtol, cstol,
* cmaxit, PETSC_DEFAULT) )
*/
__pyx_t_2 = (__pyx_v_max_it != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_it); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 429, __pyx_L1_error)
__pyx_v_cmaxit = __pyx_t_4;
}
/* "petsc4py/PETSc/SNES.pyx":430
* if stol is not None: cstol = asReal(stol)
* if max_it is not None: cmaxit = asInt(max_it)
* CHKERR( SNESSetTolerances(self.snes, catol, crtol, cstol, # <<<<<<<<<<<<<<
* cmaxit, PETSC_DEFAULT) )
*
*/
__pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetTolerances(__pyx_v_self->snes, __pyx_v_catol, __pyx_v_crtol, __pyx_v_cstol, __pyx_v_cmaxit, PETSC_DEFAULT)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 430, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":422
* # --- tolerances and convergence ---
*
* def setTolerances(self, rtol=None, atol=None, stol=None, max_it=None): # <<<<<<<<<<<<<<
* cdef PetscReal crtol, catol, cstol
* crtol = catol = cstol = PETSC_DEFAULT
*/
/* 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":433
* cmaxit, PETSC_DEFAULT) )
*
* def getTolerances(self): # <<<<<<<<<<<<<<
* cdef PetscReal crtol=0, catol=0, cstol=0
* cdef PetscInt cmaxit=0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_103getTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_102getTolerances[] = "SNES.getTolerances(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_103getTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getTolerances (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getTolerances", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTolerances", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_102getTolerances(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_102getTolerances(struct PyPetscSNESObject *__pyx_v_self) {
PetscReal __pyx_v_crtol;
PetscReal __pyx_v_catol;
PetscReal __pyx_v_cstol;
PetscInt __pyx_v_cmaxit;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getTolerances", 0);
/* "petsc4py/PETSc/SNES.pyx":434
*
* def getTolerances(self):
* 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":435
* def getTolerances(self):
* 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":436
* 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(49, 436, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":438
* CHKERR( SNESGetTolerances(self.snes, &catol, &crtol, &cstol,
* &cmaxit, NULL) )
* return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit)) # <<<<<<<<<<<<<<
*
* def setNormSchedule(self, normsched):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_crtol); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 438, __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, 438, __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(49, 438, __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(49, 438, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(49, 438, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5);
__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":433
* cmaxit, PETSC_DEFAULT) )
*
* def getTolerances(self): # <<<<<<<<<<<<<<
* cdef PetscReal crtol=0, catol=0, cstol=0
* cdef PetscInt cmaxit=0
*/
/* 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":440
* return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit))
*
* def setNormSchedule(self, normsched): # <<<<<<<<<<<<<<
* CHKERR( SNESSetNormSchedule(self.snes, normsched) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_105setNormSchedule(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_104setNormSchedule[] = "SNES.setNormSchedule(self, normsched)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_105setNormSchedule(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_normsched = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_normsched,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_normsched)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNormSchedule") < 0)) __PYX_ERR(49, 440, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_normsched = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setNormSchedule", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 440, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setNormSchedule", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_104setNormSchedule(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_normsched);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_104setNormSchedule(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_normsched) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
SNESNormSchedule __pyx_t_1;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setNormSchedule", 0);
/* "petsc4py/PETSc/SNES.pyx":441
*
* def setNormSchedule(self, normsched):
* CHKERR( SNESSetNormSchedule(self.snes, normsched) ) # <<<<<<<<<<<<<<
*
* def getNormSchedule(self):
*/
__pyx_t_1 = ((SNESNormSchedule)__Pyx_PyInt_As_SNESNormSchedule(__pyx_v_normsched)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 441, __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(49, 441, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":440
* return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit))
*
* def setNormSchedule(self, normsched): # <<<<<<<<<<<<<<
* CHKERR( SNESSetNormSchedule(self.snes, normsched) )
*
*/
/* 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":443
* CHKERR( SNESSetNormSchedule(self.snes, normsched) )
*
* def getNormSchedule(self): # <<<<<<<<<<<<<<
* cdef PetscSNESNormSchedule normsched = SNES_NORM_NONE
* CHKERR( SNESGetNormSchedule(self.snes, &normsched) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_107getNormSchedule(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_106getNormSchedule[] = "SNES.getNormSchedule(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_107getNormSchedule(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNormSchedule (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNormSchedule", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNormSchedule", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_106getNormSchedule(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_106getNormSchedule(struct PyPetscSNESObject *__pyx_v_self) {
SNESNormSchedule __pyx_v_normsched;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNormSchedule", 0);
/* "petsc4py/PETSc/SNES.pyx":444
*
* def getNormSchedule(self):
* cdef PetscSNESNormSchedule normsched = SNES_NORM_NONE # <<<<<<<<<<<<<<
* CHKERR( SNESGetNormSchedule(self.snes, &normsched) )
* return normsched
*/
__pyx_v_normsched = SNES_NORM_NONE;
/* "petsc4py/PETSc/SNES.pyx":445
* def getNormSchedule(self):
* 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(49, 445, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":446
* cdef PetscSNESNormSchedule normsched = SNES_NORM_NONE
* CHKERR( SNESGetNormSchedule(self.snes, &normsched) )
* return normsched # <<<<<<<<<<<<<<
*
* def setConvergenceTest(self, converged, args=None, kargs=None):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_SNESNormSchedule(__pyx_v_normsched); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 446, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":443
* CHKERR( SNESSetNormSchedule(self.snes, normsched) )
*
* def getNormSchedule(self): # <<<<<<<<<<<<<<
* cdef PetscSNESNormSchedule normsched = SNES_NORM_NONE
* CHKERR( SNESGetNormSchedule(self.snes, &normsched) )
*/
/* 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":448
* return normsched
*
* def setConvergenceTest(self, converged, args=None, kargs=None): # <<<<<<<<<<<<<<
* if converged == "skip":
* self.set_attr('__converged__', None)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_109setConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_108setConvergenceTest[] = "SNES.setConvergenceTest(self, converged, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_109setConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_converged = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_converged,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_converged)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConvergenceTest") < 0)) __PYX_ERR(49, 448, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_converged = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setConvergenceTest", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 448, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_108setConvergenceTest(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_converged, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_108setConvergenceTest(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
PyObject *__pyx_v_context = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
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":449
*
* def setConvergenceTest(self, converged, args=None, kargs=None):
* if converged == "skip": # <<<<<<<<<<<<<<
* self.set_attr('__converged__', None)
* CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) )
*/
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_converged, __pyx_n_s_skip, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(49, 449, __pyx_L1_error)
if (__pyx_t_1) {
/* "petsc4py/PETSc/SNES.pyx":450
* def setConvergenceTest(self, converged, args=None, kargs=None):
* 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(49, 450, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":451
* 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(49, 451, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":449
*
* def setConvergenceTest(self, converged, args=None, kargs=None):
* if converged == "skip": # <<<<<<<<<<<<<<
* self.set_attr('__converged__', None)
* CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) )
*/
goto __pyx_L3;
}
/* "petsc4py/PETSc/SNES.pyx":452
* 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);
__pyx_t_5 = (__pyx_t_4 != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_1 = __pyx_t_5;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_converged, __pyx_n_s_default, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(49, 452, __pyx_L1_error)
__pyx_t_1 = __pyx_t_5;
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
/* "petsc4py/PETSc/SNES.pyx":453
* 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(49, 453, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":454
* 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(49, 454, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":452
* 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":456
* 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(49, 456, __pyx_L1_error)
if (unlikely(!(__pyx_t_1 != 0))) {
PyErr_SetNone(PyExc_AssertionError);
__PYX_ERR(49, 456, __pyx_L1_error)
}
}
#endif
/* "petsc4py/PETSc/SNES.pyx":457
* 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);
__pyx_t_5 = (__pyx_t_1 != 0);
if (__pyx_t_5) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/SNES.pyx":458
* assert callable(converged)
* if args is None: args = ()
* if kargs is None: kargs = {} # <<<<<<<<<<<<<<
* context = (converged, args, kargs)
* self.set_attr('__converged__', context)
*/
__pyx_t_5 = (__pyx_v_kargs == Py_None);
__pyx_t_1 = (__pyx_t_5 != 0);
if (__pyx_t_1) {
__pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 458, __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":459
* 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(49, 459, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_converged);
__Pyx_GIVEREF(__pyx_v_converged);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_converged);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":460
* 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(49, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":461
* context = (converged, args, kargs)
* self.set_attr('__converged__', context)
* CHKERR( SNESSetConvergenceTest(self.snes, SNES_Converged, <void*>context, NULL) ) # <<<<<<<<<<<<<<
*
* def getConvergenceTest(self):
*/
__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(49, 461, __pyx_L1_error)
}
__pyx_L3:;
/* "petsc4py/PETSc/SNES.pyx":448
* return normsched
*
* def setConvergenceTest(self, converged, args=None, kargs=None): # <<<<<<<<<<<<<<
* if converged == "skip":
* self.set_attr('__converged__', 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":463
* CHKERR( SNESSetConvergenceTest(self.snes, SNES_Converged, <void*>context, NULL) )
*
* def getConvergenceTest(self): # <<<<<<<<<<<<<<
* return self.get_attr('__converged__')
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_111getConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_110getConvergenceTest[] = "SNES.getConvergenceTest(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_111getConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getConvergenceTest (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getConvergenceTest", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergenceTest", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_110getConvergenceTest(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_110getConvergenceTest(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getConvergenceTest", 0);
/* "petsc4py/PETSc/SNES.pyx":464
*
* def getConvergenceTest(self):
* return self.get_attr('__converged__') # <<<<<<<<<<<<<<
*
* def callConvergenceTest(self, its, xnorm, ynorm, fnorm):
*/
__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(49, 464, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":463
* CHKERR( SNESSetConvergenceTest(self.snes, SNES_Converged, <void*>context, NULL) )
*
* def getConvergenceTest(self): # <<<<<<<<<<<<<<
* return self.get_attr('__converged__')
*
*/
/* 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":466
* return self.get_attr('__converged__')
*
* def callConvergenceTest(self, its, xnorm, ynorm, fnorm): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(its)
* cdef PetscReal rval1 = asReal(xnorm)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_113callConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_112callConvergenceTest[] = "SNES.callConvergenceTest(self, its, xnorm, ynorm, fnorm)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_113callConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_its = 0;
PyObject *__pyx_v_xnorm = 0;
PyObject *__pyx_v_ynorm = 0;
PyObject *__pyx_v_fnorm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,&__pyx_n_s_xnorm,&__pyx_n_s_ynorm,&__pyx_n_s_fnorm,0};
PyObject* values[4] = {0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_its)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xnorm)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 4, 4, 1); __PYX_ERR(49, 466, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ynorm)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 4, 4, 2); __PYX_ERR(49, 466, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fnorm)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 4, 4, 3); __PYX_ERR(49, 466, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "callConvergenceTest") < 0)) __PYX_ERR(49, 466, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
}
__pyx_v_its = values[0];
__pyx_v_xnorm = values[1];
__pyx_v_ynorm = values[2];
__pyx_v_fnorm = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 466, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.callConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_112callConvergenceTest(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_its, __pyx_v_xnorm, __pyx_v_ynorm, __pyx_v_fnorm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_112callConvergenceTest(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_xnorm, PyObject *__pyx_v_ynorm, PyObject *__pyx_v_fnorm) {
PetscInt __pyx_v_ival;
PetscReal __pyx_v_rval1;
PetscReal __pyx_v_rval2;
PetscReal __pyx_v_rval3;
SNESConvergedReason __pyx_v_reason;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PetscReal __pyx_t_2;
PetscErrorCode __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("callConvergenceTest", 0);
/* "petsc4py/PETSc/SNES.pyx":467
*
* def callConvergenceTest(self, its, xnorm, ynorm, fnorm):
* 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(49, 467, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":468
* def callConvergenceTest(self, its, xnorm, ynorm, fnorm):
* 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(49, 468, __pyx_L1_error)
__pyx_v_rval1 = __pyx_t_2;
/* "petsc4py/PETSc/SNES.pyx":469
* 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(49, 469, __pyx_L1_error)
__pyx_v_rval2 = __pyx_t_2;
/* "petsc4py/PETSc/SNES.pyx":470
* 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(49, 470, __pyx_L1_error)
__pyx_v_rval3 = __pyx_t_2;
/* "petsc4py/PETSc/SNES.pyx":471
* 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":472
* 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(49, 472, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":474
* CHKERR( SNESConvergenceTestCall(self.snes, ival,
* rval1, rval2, rval3, &reason) )
* return reason # <<<<<<<<<<<<<<
*
* def setConvergenceHistory(self, length=None, reset=False):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_4 = __Pyx_PyInt_From_SNESConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 474, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":466
* return self.get_attr('__converged__')
*
* def callConvergenceTest(self, its, xnorm, ynorm, fnorm): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(its)
* cdef PetscReal rval1 = asReal(xnorm)
*/
/* 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":476
* return reason
*
* def setConvergenceHistory(self, length=None, reset=False): # <<<<<<<<<<<<<<
* cdef PetscReal *rdata = NULL
* cdef PetscInt *idata = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_115setConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_114setConvergenceHistory[] = "SNES.setConvergenceHistory(self, length=None, reset=False)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_115setConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_length = 0;
PyObject *__pyx_v_reset = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_reset,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_False);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reset);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConvergenceHistory") < 0)) __PYX_ERR(49, 476, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_length = values[0];
__pyx_v_reset = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setConvergenceHistory", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 476, __pyx_L3_error)
__pyx_L3_error:;
__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_114setConvergenceHistory(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_length, __pyx_v_reset);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_114setConvergenceHistory(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;
int __pyx_t_2;
PetscInt __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PetscErrorCode __pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setConvergenceHistory", 0);
/* "petsc4py/PETSc/SNES.pyx":477
*
* def setConvergenceHistory(self, length=None, reset=False):
* cdef PetscReal *rdata = NULL # <<<<<<<<<<<<<<
* cdef PetscInt *idata = NULL
* cdef PetscInt size = 1000
*/
__pyx_v_rdata = NULL;
/* "petsc4py/PETSc/SNES.pyx":478
* def setConvergenceHistory(self, length=None, reset=False):
* 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":479
* cdef PetscReal *rdata = NULL
* cdef PetscInt *idata = NULL
* cdef PetscInt size = 1000 # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* if length is True: pass
*/
__pyx_v_size = 0x3E8;
/* "petsc4py/PETSc/SNES.pyx":480
* cdef PetscInt *idata = NULL
* cdef PetscInt size = 1000
* 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/SNES.pyx":481
* cdef PetscInt size = 1000
* cdef PetscBool flag = PETSC_FALSE
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
goto __pyx_L3;
}
/* "petsc4py/PETSc/SNES.pyx":482
* cdef PetscBool flag = PETSC_FALSE
* 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_2 = (__pyx_v_length != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_length); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 482, __pyx_L1_error)
__pyx_v_size = __pyx_t_3;
}
__pyx_L3:;
/* "petsc4py/PETSc/SNES.pyx":483
* 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) != 0);
if (__pyx_t_1) {
__pyx_v_size = 0x3E8;
}
/* "petsc4py/PETSc/SNES.pyx":484
* 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(49, 484, __pyx_L1_error)
if (__pyx_t_1) {
__pyx_v_flag = PETSC_TRUE;
}
/* "petsc4py/PETSc/SNES.pyx":485
* 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_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_r(__pyx_v_size)); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 485, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_t_4, NULL, (&__pyx_v_rdata))); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 485, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_rhist = __pyx_t_5;
__pyx_t_5 = 0;
/* "petsc4py/PETSc/SNES.pyx":486
* 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_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_size)); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 486, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_t_5, NULL, (&__pyx_v_idata))); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 486, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_ihist = __pyx_t_4;
__pyx_t_4 = 0;
/* "petsc4py/PETSc/SNES.pyx":487
* 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 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 487, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_rhist);
__Pyx_GIVEREF(__pyx_v_rhist);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_rhist);
__Pyx_INCREF(__pyx_v_ihist);
__Pyx_GIVEREF(__pyx_v_ihist);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_ihist);
__pyx_t_5 = ((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_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 487, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "petsc4py/PETSc/SNES.pyx":488
* 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):
*/
__pyx_t_6 = __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_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 488, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":476
* return reason
*
* def setConvergenceHistory(self, length=None, reset=False): # <<<<<<<<<<<<<<
* cdef PetscReal *rdata = NULL
* cdef PetscInt *idata = NULL
*/
/* 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.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":490
* CHKERR( SNESSetConvergenceHistory(self.snes, rdata, idata, size, flag) )
*
* def getConvergenceHistory(self): # <<<<<<<<<<<<<<
* cdef PetscReal *rdata = NULL
* cdef PetscInt *idata = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_117getConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_116getConvergenceHistory[] = "SNES.getConvergenceHistory(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_117getConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getConvergenceHistory (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getConvergenceHistory", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergenceHistory", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_116getConvergenceHistory(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_116getConvergenceHistory(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":491
*
* def getConvergenceHistory(self):
* cdef PetscReal *rdata = NULL # <<<<<<<<<<<<<<
* cdef PetscInt *idata = NULL
* cdef PetscInt size = 0
*/
__pyx_v_rdata = NULL;
/* "petsc4py/PETSc/SNES.pyx":492
* def getConvergenceHistory(self):
* 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":493
* 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":494
* 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(49, 494, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":495
* 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(49, 495, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_rhist = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":496
* 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(49, 496, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_ihist = __pyx_t_2;
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":497
* cdef object rhist = array_r(size, rdata)
* cdef object ihist = array_i(size, idata)
* return (rhist, ihist) # <<<<<<<<<<<<<<
*
* def logConvergenceHistory(self, norm, linear_its=0):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 497, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_rhist);
__Pyx_GIVEREF(__pyx_v_rhist);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_rhist);
__Pyx_INCREF(__pyx_v_ihist);
__Pyx_GIVEREF(__pyx_v_ihist);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ihist);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":490
* CHKERR( SNESSetConvergenceHistory(self.snes, rdata, idata, size, flag) )
*
* def getConvergenceHistory(self): # <<<<<<<<<<<<<<
* cdef PetscReal *rdata = NULL
* cdef PetscInt *idata = NULL
*/
/* 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":499
* return (rhist, ihist)
*
* def logConvergenceHistory(self, norm, linear_its=0): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(norm)
* cdef PetscInt ival = asInt(linear_its)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_119logConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_118logConvergenceHistory[] = "SNES.logConvergenceHistory(self, norm, linear_its=0)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_119logConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_norm = 0;
PyObject *__pyx_v_linear_its = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm,&__pyx_n_s_linear_its,0};
PyObject* values[2] = {0,0};
values[1] = ((PyObject *)__pyx_int_0);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_linear_its);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "logConvergenceHistory") < 0)) __PYX_ERR(49, 499, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_norm = values[0];
__pyx_v_linear_its = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("logConvergenceHistory", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 499, __pyx_L3_error)
__pyx_L3_error:;
__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_118logConvergenceHistory(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_norm, __pyx_v_linear_its);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_118logConvergenceHistory(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":500
*
* def logConvergenceHistory(self, norm, linear_its=0):
* 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(49, 500, __pyx_L1_error)
__pyx_v_rval = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":501
* def logConvergenceHistory(self, norm, linear_its=0):
* 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(49, 501, __pyx_L1_error)
__pyx_v_ival = __pyx_t_2;
/* "petsc4py/PETSc/SNES.pyx":502
* cdef PetscReal rval = asReal(norm)
* cdef PetscInt ival = asInt(linear_its)
* CHKERR( SNESLogConvergenceHistory(self.snes, rval, ival) ) # <<<<<<<<<<<<<<
*
* def setResetCounters(self, reset=True):
*/
__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(49, 502, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":499
* return (rhist, ihist)
*
* def logConvergenceHistory(self, norm, linear_its=0): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(norm)
* cdef PetscInt ival = asInt(linear_its)
*/
/* 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":504
* CHKERR( SNESLogConvergenceHistory(self.snes, rval, ival) )
*
* def setResetCounters(self, reset=True): # <<<<<<<<<<<<<<
* cdef PetscBool flag = reset
* CHKERR( SNESSetCountersReset(self.snes, flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_121setResetCounters(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_120setResetCounters[] = "SNES.setResetCounters(self, reset=True)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_121setResetCounters(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_reset = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reset,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_True);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reset);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setResetCounters") < 0)) __PYX_ERR(49, 504, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_reset = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setResetCounters", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 504, __pyx_L3_error)
__pyx_L3_error:;
__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_120setResetCounters(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_reset);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_120setResetCounters(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":505
*
* def setResetCounters(self, reset=True):
* cdef PetscBool flag = reset # <<<<<<<<<<<<<<
* CHKERR( SNESSetCountersReset(self.snes, flag) )
*
*/
__pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_reset)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 505, __pyx_L1_error)
__pyx_v_flag = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":506
* def setResetCounters(self, reset=True):
* 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(49, 506, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":504
* CHKERR( SNESLogConvergenceHistory(self.snes, rval, ival) )
*
* def setResetCounters(self, reset=True): # <<<<<<<<<<<<<<
* cdef PetscBool flag = reset
* CHKERR( SNESSetCountersReset(self.snes, flag) )
*/
/* 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":510
* # --- monitoring ---
*
* def setMonitor(self, monitor, args=None, kargs=None): # <<<<<<<<<<<<<<
* if monitor is None: return
* cdef object monitorlist = self.get_attr('__monitor__')
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_123setMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_122setMonitor[] = "SNES.setMonitor(self, monitor, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_123setMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_monitor = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_monitor,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_monitor)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMonitor") < 0)) __PYX_ERR(49, 510, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_monitor = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMonitor", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 510, __pyx_L3_error)
__pyx_L3_error:;
__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_122setMonitor(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_monitor, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_122setMonitor(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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PetscErrorCode __pyx_t_4;
int __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setMonitor", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/SNES.pyx":511
*
* def setMonitor(self, monitor, args=None, kargs=None):
* if monitor is None: return # <<<<<<<<<<<<<<
* cdef object monitorlist = self.get_attr('__monitor__')
* if monitorlist is None:
*/
__pyx_t_1 = (__pyx_v_monitor == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/SNES.pyx":512
* def setMonitor(self, monitor, args=None, kargs=None):
* if monitor is None: return
* cdef object monitorlist = self.get_attr('__monitor__') # <<<<<<<<<<<<<<
* if monitorlist is None:
* monitorlist = []
*/
__pyx_t_3 = ((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_3)) __PYX_ERR(49, 512, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_monitorlist = __pyx_t_3;
__pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":513
* if monitor is None: return
* cdef object monitorlist = self.get_attr('__monitor__')
* if monitorlist is None: # <<<<<<<<<<<<<<
* monitorlist = []
* self.set_attr('__monitor__', monitorlist)
*/
__pyx_t_2 = (__pyx_v_monitorlist == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
/* "petsc4py/PETSc/SNES.pyx":514
* 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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_monitorlist, __pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":515
* 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_3 = ((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_3)) __PYX_ERR(49, 515, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":516
* 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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESMonitorSet(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_Monitor, NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 516, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":513
* 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":517
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/SNES.pyx":518
* 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_2 = (__pyx_v_kargs == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 518, __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":519
* if args is None: args = ()
* if kargs is None: kargs = {}
* context = (monitor, args, kargs) # <<<<<<<<<<<<<<
* monitorlist.append(context)
*
*/
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 519, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_monitor);
__Pyx_GIVEREF(__pyx_v_monitor);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_monitor);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":520
* if kargs is None: kargs = {}
* context = (monitor, args, kargs)
* monitorlist.append(context) # <<<<<<<<<<<<<<
*
* def getMonitor(self):
*/
__pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_monitorlist, __pyx_v_context); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(49, 520, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":510
* # --- monitoring ---
*
* def setMonitor(self, monitor, args=None, kargs=None): # <<<<<<<<<<<<<<
* if monitor is None: return
* cdef object monitorlist = self.get_attr('__monitor__')
*/
/* 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.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":522
* monitorlist.append(context)
*
* def getMonitor(self): # <<<<<<<<<<<<<<
* return self.get_attr('__monitor__')
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_125getMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_124getMonitor[] = "SNES.getMonitor(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_125getMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getMonitor (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getMonitor", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMonitor", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_124getMonitor(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_124getMonitor(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":523
*
* def getMonitor(self):
* return self.get_attr('__monitor__') # <<<<<<<<<<<<<<
*
* def monitorCancel(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 *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 523, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":522
* monitorlist.append(context)
*
* def getMonitor(self): # <<<<<<<<<<<<<<
* return self.get_attr('__monitor__')
*
*/
/* 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":525
* return self.get_attr('__monitor__')
*
* def monitorCancel(self): # <<<<<<<<<<<<<<
* CHKERR( SNESMonitorCancel(self.snes) )
* self.set_attr('__monitor__', None)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_127monitorCancel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_126monitorCancel[] = "SNES.monitorCancel(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_127monitorCancel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("monitorCancel (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("monitorCancel", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "monitorCancel", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_126monitorCancel(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_126monitorCancel(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":526
*
* def monitorCancel(self):
* 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(49, 526, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":527
* def monitorCancel(self):
* 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(49, 527, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":525
* return self.get_attr('__monitor__')
*
* def monitorCancel(self): # <<<<<<<<<<<<<<
* CHKERR( SNESMonitorCancel(self.snes) )
* self.set_attr('__monitor__', 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.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":531
* cancelMonitor = monitorCancel
*
* def monitor(self, its, rnorm): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(its)
* cdef PetscReal rval = asReal(rnorm)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_129monitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_128monitor[] = "SNES.monitor(self, its, rnorm)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_129monitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_its = 0;
PyObject *__pyx_v_rnorm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,&__pyx_n_s_rnorm,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_its)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rnorm)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("monitor", 1, 2, 2, 1); __PYX_ERR(49, 531, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "monitor") < 0)) __PYX_ERR(49, 531, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_its = values[0];
__pyx_v_rnorm = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("monitor", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 531, __pyx_L3_error)
__pyx_L3_error:;
__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_128monitor(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_its, __pyx_v_rnorm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_128monitor(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":532
*
* def monitor(self, its, rnorm):
* 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(49, 532, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":533
* def monitor(self, its, rnorm):
* 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(49, 533, __pyx_L1_error)
__pyx_v_rval = __pyx_t_2;
/* "petsc4py/PETSc/SNES.pyx":534
* 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(49, 534, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":531
* cancelMonitor = monitorCancel
*
* def monitor(self, its, rnorm): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(its)
* 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.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":538
* # --- more tolerances ---
*
* def setMaxFunctionEvaluations(self, max_funcs): # <<<<<<<<<<<<<<
* cdef PetscReal r = PETSC_DEFAULT
* cdef PetscInt i = PETSC_DEFAULT
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_131setMaxFunctionEvaluations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_130setMaxFunctionEvaluations[] = "SNES.setMaxFunctionEvaluations(self, max_funcs)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_131setMaxFunctionEvaluations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_max_funcs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_funcs,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_funcs)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMaxFunctionEvaluations") < 0)) __PYX_ERR(49, 538, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_max_funcs = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMaxFunctionEvaluations", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 538, __pyx_L3_error)
__pyx_L3_error:;
__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_130setMaxFunctionEvaluations(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_max_funcs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_130setMaxFunctionEvaluations(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":539
*
* def setMaxFunctionEvaluations(self, max_funcs):
* cdef PetscReal r = PETSC_DEFAULT # <<<<<<<<<<<<<<
* cdef PetscInt i = PETSC_DEFAULT
* cdef PetscInt ival = asInt(max_funcs)
*/
__pyx_v_r = PETSC_DEFAULT;
/* "petsc4py/PETSc/SNES.pyx":540
* def setMaxFunctionEvaluations(self, max_funcs):
* cdef PetscReal r = PETSC_DEFAULT
* cdef PetscInt i = PETSC_DEFAULT # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(max_funcs)
* CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) )
*/
__pyx_v_i = PETSC_DEFAULT;
/* "petsc4py/PETSc/SNES.pyx":541
* cdef PetscReal r = PETSC_DEFAULT
* cdef PetscInt i = PETSC_DEFAULT
* cdef PetscInt ival = asInt(max_funcs) # <<<<<<<<<<<<<<
* CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) )
*
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_funcs); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 541, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":542
* cdef PetscInt i = PETSC_DEFAULT
* cdef PetscInt ival = asInt(max_funcs)
* CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) ) # <<<<<<<<<<<<<<
*
* def getMaxFunctionEvaluations(self):
*/
__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(49, 542, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":538
* # --- more tolerances ---
*
* def setMaxFunctionEvaluations(self, max_funcs): # <<<<<<<<<<<<<<
* cdef PetscReal r = PETSC_DEFAULT
* cdef PetscInt i = PETSC_DEFAULT
*/
/* 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":544
* CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) )
*
* def getMaxFunctionEvaluations(self): # <<<<<<<<<<<<<<
* cdef PetscReal *r = NULL
* cdef PetscInt *i = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_133getMaxFunctionEvaluations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_132getMaxFunctionEvaluations[] = "SNES.getMaxFunctionEvaluations(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_133getMaxFunctionEvaluations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getMaxFunctionEvaluations (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getMaxFunctionEvaluations", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxFunctionEvaluations", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_132getMaxFunctionEvaluations(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_132getMaxFunctionEvaluations(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":545
*
* def getMaxFunctionEvaluations(self):
* cdef PetscReal *r = NULL # <<<<<<<<<<<<<<
* cdef PetscInt *i = NULL
* cdef PetscInt ival = 0
*/
__pyx_v_r = NULL;
/* "petsc4py/PETSc/SNES.pyx":546
* def getMaxFunctionEvaluations(self):
* 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":547
* 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":548
* 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(49, 548, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":549
* cdef PetscInt ival = 0
* CHKERR( SNESGetTolerances(self.snes, r, r, r, i, &ival) )
* return toInt(ival) # <<<<<<<<<<<<<<
*
* def getFunctionEvaluations(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 549, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":544
* CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) )
*
* def getMaxFunctionEvaluations(self): # <<<<<<<<<<<<<<
* cdef PetscReal *r = NULL
* cdef PetscInt *i = NULL
*/
/* 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":551
* return toInt(ival)
*
* def getFunctionEvaluations(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( SNESGetNumberFunctionEvals(self.snes, &ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_135getFunctionEvaluations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_134getFunctionEvaluations[] = "SNES.getFunctionEvaluations(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_135getFunctionEvaluations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFunctionEvaluations (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFunctionEvaluations", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFunctionEvaluations", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_134getFunctionEvaluations(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_134getFunctionEvaluations(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":552
*
* def getFunctionEvaluations(self):
* cdef PetscInt ival = 0 # <<<<<<<<<<<<<<
* CHKERR( SNESGetNumberFunctionEvals(self.snes, &ival) )
* return toInt(ival)
*/
__pyx_v_ival = 0;
/* "petsc4py/PETSc/SNES.pyx":553
* def getFunctionEvaluations(self):
* 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(49, 553, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":554
* cdef PetscInt ival = 0
* CHKERR( SNESGetNumberFunctionEvals(self.snes, &ival) )
* return toInt(ival) # <<<<<<<<<<<<<<
*
* def setMaxStepFailures(self, max_fails):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 554, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":551
* return toInt(ival)
*
* def getFunctionEvaluations(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( SNESGetNumberFunctionEvals(self.snes, &ival) )
*/
/* 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":556
* return toInt(ival)
*
* def setMaxStepFailures(self, max_fails): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(max_fails)
* CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_137setMaxStepFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_136setMaxStepFailures[] = "SNES.setMaxStepFailures(self, max_fails)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_137setMaxStepFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_max_fails = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_fails,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_fails)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMaxStepFailures") < 0)) __PYX_ERR(49, 556, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_max_fails = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMaxStepFailures", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 556, __pyx_L3_error)
__pyx_L3_error:;
__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_136setMaxStepFailures(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_max_fails);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_136setMaxStepFailures(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":557
*
* def setMaxStepFailures(self, max_fails):
* 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(49, 557, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":558
* def setMaxStepFailures(self, max_fails):
* cdef PetscInt ival = asInt(max_fails)
* CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) ) # <<<<<<<<<<<<<<
*
* def getMaxStepFailures(self):
*/
__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(49, 558, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":556
* return toInt(ival)
*
* def setMaxStepFailures(self, max_fails): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(max_fails)
* CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) )
*/
/* 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":560
* CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) )
*
* def getMaxStepFailures(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( SNESGetMaxNonlinearStepFailures(self.snes, &ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_139getMaxStepFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_138getMaxStepFailures[] = "SNES.getMaxStepFailures(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_139getMaxStepFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getMaxStepFailures (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getMaxStepFailures", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxStepFailures", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_138getMaxStepFailures(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_138getMaxStepFailures(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":561
*
* def getMaxStepFailures(self):
* cdef PetscInt ival = 0 # <<<<<<<<<<<<<<
* CHKERR( SNESGetMaxNonlinearStepFailures(self.snes, &ival) )
* return toInt(ival)
*/
__pyx_v_ival = 0;
/* "petsc4py/PETSc/SNES.pyx":562
* def getMaxStepFailures(self):
* 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(49, 562, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":563
* cdef PetscInt ival = 0
* CHKERR( SNESGetMaxNonlinearStepFailures(self.snes, &ival) )
* return toInt(ival) # <<<<<<<<<<<<<<
*
* def getStepFailures(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 563, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":560
* CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) )
*
* def getMaxStepFailures(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( SNESGetMaxNonlinearStepFailures(self.snes, &ival) )
*/
/* 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":565
* return toInt(ival)
*
* def getStepFailures(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( SNESGetNonlinearStepFailures(self.snes, &ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_141getStepFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_140getStepFailures[] = "SNES.getStepFailures(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_141getStepFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getStepFailures (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getStepFailures", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStepFailures", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_140getStepFailures(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_140getStepFailures(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":566
*
* def getStepFailures(self):
* cdef PetscInt ival = 0 # <<<<<<<<<<<<<<
* CHKERR( SNESGetNonlinearStepFailures(self.snes, &ival) )
* return toInt(ival)
*/
__pyx_v_ival = 0;
/* "petsc4py/PETSc/SNES.pyx":567
* def getStepFailures(self):
* 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(49, 567, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":568
* cdef PetscInt ival = 0
* CHKERR( SNESGetNonlinearStepFailures(self.snes, &ival) )
* return toInt(ival) # <<<<<<<<<<<<<<
*
* def setMaxKSPFailures(self, max_fails):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 568, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":565
* return toInt(ival)
*
* def getStepFailures(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( SNESGetNonlinearStepFailures(self.snes, &ival) )
*/
/* 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":570
* return toInt(ival)
*
* def setMaxKSPFailures(self, max_fails): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(max_fails)
* CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_143setMaxKSPFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_142setMaxKSPFailures[] = "SNES.setMaxKSPFailures(self, max_fails)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_143setMaxKSPFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_max_fails = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_fails,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_fails)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMaxKSPFailures") < 0)) __PYX_ERR(49, 570, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_max_fails = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setMaxKSPFailures", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 570, __pyx_L3_error)
__pyx_L3_error:;
__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_142setMaxKSPFailures(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_max_fails);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_142setMaxKSPFailures(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":571
*
* def setMaxKSPFailures(self, max_fails):
* 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(49, 571, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":572
* def setMaxKSPFailures(self, max_fails):
* cdef PetscInt ival = asInt(max_fails)
* CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) ) # <<<<<<<<<<<<<<
*
* def getMaxKSPFailures(self):
*/
__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(49, 572, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":570
* return toInt(ival)
*
* def setMaxKSPFailures(self, max_fails): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(max_fails)
* CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) )
*/
/* 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":574
* CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) )
*
* def getMaxKSPFailures(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( SNESGetMaxLinearSolveFailures(self.snes, &ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_145getMaxKSPFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_144getMaxKSPFailures[] = "SNES.getMaxKSPFailures(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_145getMaxKSPFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getMaxKSPFailures (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getMaxKSPFailures", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxKSPFailures", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_144getMaxKSPFailures(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_144getMaxKSPFailures(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":575
*
* def getMaxKSPFailures(self):
* cdef PetscInt ival = 0 # <<<<<<<<<<<<<<
* CHKERR( SNESGetMaxLinearSolveFailures(self.snes, &ival) )
* return toInt(ival)
*/
__pyx_v_ival = 0;
/* "petsc4py/PETSc/SNES.pyx":576
* def getMaxKSPFailures(self):
* 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(49, 576, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":577
* cdef PetscInt ival = 0
* CHKERR( SNESGetMaxLinearSolveFailures(self.snes, &ival) )
* return toInt(ival) # <<<<<<<<<<<<<<
*
* def getKSPFailures(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 577, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":574
* CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) )
*
* def getMaxKSPFailures(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( SNESGetMaxLinearSolveFailures(self.snes, &ival) )
*/
/* 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":579
* return toInt(ival)
*
* def getKSPFailures(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( SNESGetLinearSolveFailures(self.snes, &ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_147getKSPFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_146getKSPFailures[] = "SNES.getKSPFailures(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_147getKSPFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getKSPFailures (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getKSPFailures", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getKSPFailures", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_146getKSPFailures(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_146getKSPFailures(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":580
*
* def getKSPFailures(self):
* cdef PetscInt ival = 0 # <<<<<<<<<<<<<<
* CHKERR( SNESGetLinearSolveFailures(self.snes, &ival) )
* return toInt(ival)
*/
__pyx_v_ival = 0;
/* "petsc4py/PETSc/SNES.pyx":581
* def getKSPFailures(self):
* 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(49, 581, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":582
* 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(49, 582, __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
* return toInt(ival)
*
* def getKSPFailures(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( SNESGetLinearSolveFailures(self.snes, &ival) )
*/
/* 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":593
* # --- solving ---
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( SNESSetUp(self.snes) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_149setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_148setUp[] = "SNES.setUp(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_149setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setUp (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_148setUp(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_148setUp(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":594
*
* def setUp(self):
* CHKERR( SNESSetUp(self.snes) ) # <<<<<<<<<<<<<<
*
* def reset(self):
*/
__pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetUp(__pyx_v_self->snes)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 594, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":593
* # --- solving ---
*
* def setUp(self): # <<<<<<<<<<<<<<
* CHKERR( SNESSetUp(self.snes) )
*
*/
/* 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":596
* CHKERR( SNESSetUp(self.snes) )
*
* def reset(self): # <<<<<<<<<<<<<<
* CHKERR( SNESReset(self.snes) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_151reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_150reset[] = "SNES.reset(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_151reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_150reset(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_150reset(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":597
*
* def reset(self):
* CHKERR( SNESReset(self.snes) ) # <<<<<<<<<<<<<<
*
* def solve(self, Vec b = None, Vec x = 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(49, 597, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":596
* CHKERR( SNESSetUp(self.snes) )
*
* def reset(self): # <<<<<<<<<<<<<<
* CHKERR( SNESReset(self.snes) )
*
*/
/* 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":599
* CHKERR( SNESReset(self.snes) )
*
* def solve(self, Vec b = None, Vec x = None): # <<<<<<<<<<<<<<
* cdef PetscVec rhs = NULL
* cdef PetscVec sol = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_153solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_152solve[] = "SNES.solve(self, Vec b=None, Vec x=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_153solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_b = 0;
struct PyPetscVecObject *__pyx_v_x = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0};
PyObject* values[2] = {0,0};
values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None);
values[1] = (PyObject *)((struct PyPetscVecObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solve") < 0)) __PYX_ERR(49, 599, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_b = ((struct PyPetscVecObject *)values[0]);
__pyx_v_x = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("solve", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 599, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(49, 599, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(49, 599, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_152solve(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_152solve(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;
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("solve", 0);
/* "petsc4py/PETSc/SNES.pyx":600
*
* def solve(self, Vec b = None, Vec x = None):
* cdef PetscVec rhs = NULL # <<<<<<<<<<<<<<
* cdef PetscVec sol = NULL
* if b is not None: rhs = b.vec
*/
__pyx_v_rhs = NULL;
/* "petsc4py/PETSc/SNES.pyx":601
* def solve(self, Vec b = None, Vec x = None):
* 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":602
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_b->vec;
__pyx_v_rhs = __pyx_t_3;
}
/* "petsc4py/PETSc/SNES.pyx":603
* 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_2 = (((PyObject *)__pyx_v_x) != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __pyx_v_x->vec;
__pyx_v_sol = __pyx_t_3;
}
/* "petsc4py/PETSc/SNES.pyx":604
* 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):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSolve(__pyx_v_self->snes, __pyx_v_rhs, __pyx_v_sol)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 604, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":599
* CHKERR( SNESReset(self.snes) )
*
* def solve(self, Vec b = None, Vec x = None): # <<<<<<<<<<<<<<
* cdef PetscVec rhs = NULL
* cdef PetscVec sol = NULL
*/
/* 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":606
* CHKERR( SNESSolve(self.snes, rhs, sol) )
*
* def setConvergedReason(self, reason): # <<<<<<<<<<<<<<
* cdef PetscSNESConvergedReason eval = reason
* CHKERR( SNESSetConvergedReason(self.snes, eval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_155setConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_154setConvergedReason[] = "SNES.setConvergedReason(self, reason)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_155setConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_reason = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reason,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reason)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConvergedReason") < 0)) __PYX_ERR(49, 606, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_reason = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 606, __pyx_L3_error)
__pyx_L3_error:;
__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_154setConvergedReason(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_reason);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_154setConvergedReason(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":607
*
* def setConvergedReason(self, reason):
* cdef PetscSNESConvergedReason eval = reason # <<<<<<<<<<<<<<
* CHKERR( SNESSetConvergedReason(self.snes, eval) )
*
*/
__pyx_t_1 = ((SNESConvergedReason)__Pyx_PyInt_As_SNESConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 607, __pyx_L1_error)
__pyx_v_eval = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":608
* def setConvergedReason(self, reason):
* cdef PetscSNESConvergedReason eval = reason
* CHKERR( SNESSetConvergedReason(self.snes, eval) ) # <<<<<<<<<<<<<<
*
* def getConvergedReason(self):
*/
__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(49, 608, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":606
* CHKERR( SNESSolve(self.snes, rhs, sol) )
*
* def setConvergedReason(self, reason): # <<<<<<<<<<<<<<
* cdef PetscSNESConvergedReason eval = reason
* CHKERR( SNESSetConvergedReason(self.snes, eval) )
*/
/* 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":610
* CHKERR( SNESSetConvergedReason(self.snes, eval) )
*
* def getConvergedReason(self): # <<<<<<<<<<<<<<
* cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING
* CHKERR( SNESGetConvergedReason(self.snes, &reason) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_157getConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_156getConvergedReason[] = "SNES.getConvergedReason(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_157getConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getConvergedReason (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getConvergedReason", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergedReason", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_156getConvergedReason(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_156getConvergedReason(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":611
*
* def getConvergedReason(self):
* cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING # <<<<<<<<<<<<<<
* CHKERR( SNESGetConvergedReason(self.snes, &reason) )
* return reason
*/
__pyx_v_reason = SNES_CONVERGED_ITERATING;
/* "petsc4py/PETSc/SNES.pyx":612
* def getConvergedReason(self):
* 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(49, 612, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":613
* cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING
* CHKERR( SNESGetConvergedReason(self.snes, &reason) )
* return reason # <<<<<<<<<<<<<<
*
* def setErrorIfNotConverged(self, bint flag):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyInt_From_SNESConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 613, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":610
* CHKERR( SNESSetConvergedReason(self.snes, eval) )
*
* def getConvergedReason(self): # <<<<<<<<<<<<<<
* cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING
* CHKERR( SNESGetConvergedReason(self.snes, &reason) )
*/
/* 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":615
* return reason
*
* def setErrorIfNotConverged(self, bint flag): # <<<<<<<<<<<<<<
* cdef PetscBool ernc = PETSC_FALSE
* if flag: ernc = PETSC_TRUE
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_159setErrorIfNotConverged(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_158setErrorIfNotConverged[] = "SNES.setErrorIfNotConverged(self, bool flag)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_159setErrorIfNotConverged(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_flag;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setErrorIfNotConverged (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setErrorIfNotConverged") < 0)) __PYX_ERR(49, 615, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_flag = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(49, 615, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setErrorIfNotConverged", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 615, __pyx_L3_error)
__pyx_L3_error:;
__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_158setErrorIfNotConverged(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_158setErrorIfNotConverged(struct PyPetscSNESObject *__pyx_v_self, int __pyx_v_flag) {
PetscBool __pyx_v_ernc;
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("setErrorIfNotConverged", 0);
/* "petsc4py/PETSc/SNES.pyx":616
*
* def setErrorIfNotConverged(self, bint flag):
* cdef PetscBool ernc = PETSC_FALSE # <<<<<<<<<<<<<<
* if flag: ernc = PETSC_TRUE
* CHKERR( SNESSetErrorIfNotConverged(self.snes, ernc) )
*/
__pyx_v_ernc = PETSC_FALSE;
/* "petsc4py/PETSc/SNES.pyx":617
* def setErrorIfNotConverged(self, bint flag):
* cdef PetscBool ernc = PETSC_FALSE
* if flag: ernc = PETSC_TRUE # <<<<<<<<<<<<<<
* CHKERR( SNESSetErrorIfNotConverged(self.snes, ernc) )
*
*/
__pyx_t_1 = (__pyx_v_flag != 0);
if (__pyx_t_1) {
__pyx_v_ernc = PETSC_TRUE;
}
/* "petsc4py/PETSc/SNES.pyx":618
* cdef PetscBool ernc = PETSC_FALSE
* if flag: ernc = PETSC_TRUE
* CHKERR( SNESSetErrorIfNotConverged(self.snes, ernc) ) # <<<<<<<<<<<<<<
*
* def getErrorIfNotConverged(self):
*/
__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(49, 618, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":615
* return reason
*
* def setErrorIfNotConverged(self, bint flag): # <<<<<<<<<<<<<<
* cdef PetscBool ernc = PETSC_FALSE
* if flag: ernc = PETSC_TRUE
*/
/* 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":620
* CHKERR( SNESSetErrorIfNotConverged(self.snes, ernc) )
*
* def getErrorIfNotConverged(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( SNESGetErrorIfNotConverged(self.snes, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_161getErrorIfNotConverged(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_160getErrorIfNotConverged[] = "SNES.getErrorIfNotConverged(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_161getErrorIfNotConverged(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getErrorIfNotConverged (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getErrorIfNotConverged", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getErrorIfNotConverged", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_160getErrorIfNotConverged(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_160getErrorIfNotConverged(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":621
*
* def getErrorIfNotConverged(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( SNESGetErrorIfNotConverged(self.snes, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/SNES.pyx":622
* def getErrorIfNotConverged(self):
* 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(49, 622, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":623
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( SNESGetErrorIfNotConverged(self.snes, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def setIterationNumber(self, its):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 623, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":620
* CHKERR( SNESSetErrorIfNotConverged(self.snes, ernc) )
*
* def getErrorIfNotConverged(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( SNESGetErrorIfNotConverged(self.snes, &flag) )
*/
/* 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":625
* return toBool(flag)
*
* def setIterationNumber(self, its): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(its)
* CHKERR( SNESSetIterationNumber(self.snes, ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_163setIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_162setIterationNumber[] = "SNES.setIterationNumber(self, its)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_163setIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_its = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_its)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setIterationNumber") < 0)) __PYX_ERR(49, 625, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_its = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setIterationNumber", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 625, __pyx_L3_error)
__pyx_L3_error:;
__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_162setIterationNumber(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_its);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_162setIterationNumber(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":626
*
* def setIterationNumber(self, its):
* 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(49, 626, __pyx_L1_error)
__pyx_v_ival = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":627
* def setIterationNumber(self, its):
* cdef PetscInt ival = asInt(its)
* CHKERR( SNESSetIterationNumber(self.snes, ival) ) # <<<<<<<<<<<<<<
*
* def getIterationNumber(self):
*/
__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(49, 627, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":625
* return toBool(flag)
*
* def setIterationNumber(self, its): # <<<<<<<<<<<<<<
* cdef PetscInt ival = asInt(its)
* CHKERR( SNESSetIterationNumber(self.snes, ival) )
*/
/* 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":629
* CHKERR( SNESSetIterationNumber(self.snes, ival) )
*
* def getIterationNumber(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( SNESGetIterationNumber(self.snes, &ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_165getIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_164getIterationNumber[] = "SNES.getIterationNumber(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_165getIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getIterationNumber (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getIterationNumber", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIterationNumber", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_164getIterationNumber(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_164getIterationNumber(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":630
*
* def getIterationNumber(self):
* cdef PetscInt ival = 0 # <<<<<<<<<<<<<<
* CHKERR( SNESGetIterationNumber(self.snes, &ival) )
* return toInt(ival)
*/
__pyx_v_ival = 0;
/* "petsc4py/PETSc/SNES.pyx":631
* def getIterationNumber(self):
* 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(49, 631, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":632
* cdef PetscInt ival = 0
* CHKERR( SNESGetIterationNumber(self.snes, &ival) )
* return toInt(ival) # <<<<<<<<<<<<<<
*
* def setForceIteration(self, force):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 632, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":629
* CHKERR( SNESSetIterationNumber(self.snes, ival) )
*
* def getIterationNumber(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( SNESGetIterationNumber(self.snes, &ival) )
*/
/* 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":634
* return toInt(ival)
*
* def setForceIteration(self, force): # <<<<<<<<<<<<<<
* cdef PetscBool bval = asBool(force)
* CHKERR( SNESSetForceIteration(self.snes, bval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_167setForceIteration(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_166setForceIteration[] = "SNES.setForceIteration(self, force)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_167setForceIteration(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_force = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_force,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_force)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setForceIteration") < 0)) __PYX_ERR(49, 634, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_force = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setForceIteration", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 634, __pyx_L3_error)
__pyx_L3_error:;
__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_166setForceIteration(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_force);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_166setForceIteration(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":635
*
* def setForceIteration(self, force):
* 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(49, 635, __pyx_L1_error)
__pyx_v_bval = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":636
* def setForceIteration(self, force):
* cdef PetscBool bval = asBool(force)
* CHKERR( SNESSetForceIteration(self.snes, bval) ) # <<<<<<<<<<<<<<
*
* def setFunctionNorm(self, norm):
*/
__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(49, 636, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":634
* return toInt(ival)
*
* def setForceIteration(self, force): # <<<<<<<<<<<<<<
* cdef PetscBool bval = asBool(force)
* CHKERR( SNESSetForceIteration(self.snes, bval) )
*/
/* 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":638
* CHKERR( SNESSetForceIteration(self.snes, bval) )
*
* def setFunctionNorm(self, norm): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(norm)
* CHKERR( SNESSetFunctionNorm(self.snes, rval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_169setFunctionNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_168setFunctionNorm[] = "SNES.setFunctionNorm(self, norm)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_169setFunctionNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_norm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norm)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFunctionNorm") < 0)) __PYX_ERR(49, 638, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_norm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setFunctionNorm", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 638, __pyx_L3_error)
__pyx_L3_error:;
__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_168setFunctionNorm(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_norm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_168setFunctionNorm(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":639
*
* def setFunctionNorm(self, norm):
* 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(49, 639, __pyx_L1_error)
__pyx_v_rval = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":640
* def setFunctionNorm(self, norm):
* cdef PetscReal rval = asReal(norm)
* CHKERR( SNESSetFunctionNorm(self.snes, rval) ) # <<<<<<<<<<<<<<
*
* def getFunctionNorm(self):
*/
__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(49, 640, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":638
* CHKERR( SNESSetForceIteration(self.snes, bval) )
*
* def setFunctionNorm(self, norm): # <<<<<<<<<<<<<<
* cdef PetscReal rval = asReal(norm)
* CHKERR( SNESSetFunctionNorm(self.snes, rval) )
*/
/* 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":642
* CHKERR( SNESSetFunctionNorm(self.snes, rval) )
*
* def getFunctionNorm(self): # <<<<<<<<<<<<<<
* cdef PetscReal rval = 0
* CHKERR( SNESGetFunctionNorm(self.snes, &rval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_171getFunctionNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_170getFunctionNorm[] = "SNES.getFunctionNorm(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_171getFunctionNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getFunctionNorm (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getFunctionNorm", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFunctionNorm", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_170getFunctionNorm(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_170getFunctionNorm(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":643
*
* def getFunctionNorm(self):
* cdef PetscReal rval = 0 # <<<<<<<<<<<<<<
* CHKERR( SNESGetFunctionNorm(self.snes, &rval) )
* return toReal(rval)
*/
__pyx_v_rval = 0.0;
/* "petsc4py/PETSc/SNES.pyx":644
* def getFunctionNorm(self):
* 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(49, 644, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":645
* cdef PetscReal rval = 0
* CHKERR( SNESGetFunctionNorm(self.snes, &rval) )
* return toReal(rval) # <<<<<<<<<<<<<<
*
* def getLinearSolveIterations(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 645, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":642
* CHKERR( SNESSetFunctionNorm(self.snes, rval) )
*
* def getFunctionNorm(self): # <<<<<<<<<<<<<<
* cdef PetscReal rval = 0
* CHKERR( SNESGetFunctionNorm(self.snes, &rval) )
*/
/* 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":647
* return toReal(rval)
*
* def getLinearSolveIterations(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( SNESGetLinearSolveIterations(self.snes, &ival) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_173getLinearSolveIterations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_172getLinearSolveIterations[] = "SNES.getLinearSolveIterations(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_173getLinearSolveIterations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getLinearSolveIterations (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getLinearSolveIterations", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLinearSolveIterations", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_172getLinearSolveIterations(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_172getLinearSolveIterations(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":648
*
* def getLinearSolveIterations(self):
* cdef PetscInt ival = 0 # <<<<<<<<<<<<<<
* CHKERR( SNESGetLinearSolveIterations(self.snes, &ival) )
* return toInt(ival)
*/
__pyx_v_ival = 0;
/* "petsc4py/PETSc/SNES.pyx":649
* def getLinearSolveIterations(self):
* 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(49, 649, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":650
* cdef PetscInt ival = 0
* CHKERR( SNESGetLinearSolveIterations(self.snes, &ival) )
* return toInt(ival) # <<<<<<<<<<<<<<
*
* def getRhs(self):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":647
* return toReal(rval)
*
* def getLinearSolveIterations(self): # <<<<<<<<<<<<<<
* cdef PetscInt ival = 0
* CHKERR( SNESGetLinearSolveIterations(self.snes, &ival) )
*/
/* 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":652
* return toInt(ival)
*
* def getRhs(self): # <<<<<<<<<<<<<<
* cdef Vec vec = Vec()
* CHKERR( SNESGetRhs(self.snes, &vec.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_175getRhs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_174getRhs[] = "SNES.getRhs(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_175getRhs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getRhs (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getRhs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRhs", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_174getRhs(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_174getRhs(struct PyPetscSNESObject *__pyx_v_self) {
struct PyPetscVecObject *__pyx_v_vec = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getRhs", 0);
/* "petsc4py/PETSc/SNES.pyx":653
*
* def getRhs(self):
* cdef Vec vec = Vec() # <<<<<<<<<<<<<<
* CHKERR( SNESGetRhs(self.snes, &vec.vec) )
* PetscINCREF(vec.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 653, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":654
* def getRhs(self):
* cdef Vec vec = Vec()
* CHKERR( SNESGetRhs(self.snes, &vec.vec) ) # <<<<<<<<<<<<<<
* PetscINCREF(vec.obj)
* return vec
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetRhs(__pyx_v_self->snes, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 654, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":655
* cdef Vec vec = Vec()
* CHKERR( SNESGetRhs(self.snes, &vec.vec) )
* PetscINCREF(vec.obj) # <<<<<<<<<<<<<<
* return vec
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":656
* CHKERR( SNESGetRhs(self.snes, &vec.vec) )
* PetscINCREF(vec.obj)
* return vec # <<<<<<<<<<<<<<
*
* def getSolution(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_vec));
__pyx_r = ((PyObject *)__pyx_v_vec);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":652
* return toInt(ival)
*
* def getRhs(self): # <<<<<<<<<<<<<<
* cdef Vec vec = Vec()
* CHKERR( SNESGetRhs(self.snes, &vec.vec) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getRhs", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_vec);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":658
* return vec
*
* def getSolution(self): # <<<<<<<<<<<<<<
* cdef Vec vec = Vec()
* CHKERR( SNESGetSolution(self.snes, &vec.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_177getSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_176getSolution[] = "SNES.getSolution(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_177getSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getSolution (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getSolution", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolution", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_176getSolution(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_176getSolution(struct PyPetscSNESObject *__pyx_v_self) {
struct PyPetscVecObject *__pyx_v_vec = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getSolution", 0);
/* "petsc4py/PETSc/SNES.pyx":659
*
* def getSolution(self):
* cdef Vec vec = Vec() # <<<<<<<<<<<<<<
* CHKERR( SNESGetSolution(self.snes, &vec.vec) )
* PetscINCREF(vec.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 659, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":660
* def getSolution(self):
* cdef Vec vec = Vec()
* CHKERR( SNESGetSolution(self.snes, &vec.vec) ) # <<<<<<<<<<<<<<
* PetscINCREF(vec.obj)
* return vec
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetSolution(__pyx_v_self->snes, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 660, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":661
* cdef Vec vec = Vec()
* CHKERR( SNESGetSolution(self.snes, &vec.vec) )
* PetscINCREF(vec.obj) # <<<<<<<<<<<<<<
* return vec
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":662
* CHKERR( SNESGetSolution(self.snes, &vec.vec) )
* PetscINCREF(vec.obj)
* return vec # <<<<<<<<<<<<<<
*
* def setSolution(self, Vec vec):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_vec));
__pyx_r = ((PyObject *)__pyx_v_vec);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":658
* return vec
*
* def getSolution(self): # <<<<<<<<<<<<<<
* cdef Vec vec = Vec()
* CHKERR( SNESGetSolution(self.snes, &vec.vec) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_vec);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":664
* return vec
*
* def setSolution(self, Vec vec): # <<<<<<<<<<<<<<
* CHKERR( SNESSetSolution(self.snes, vec.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_179setSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_178setSolution[] = "SNES.setSolution(self, Vec vec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_179setSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_vec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSolution") < 0)) __PYX_ERR(49, 664, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setSolution", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 664, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setSolution", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(49, 664, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_178setSolution(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_vec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_178setSolution(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":665
*
* def setSolution(self, Vec vec):
* CHKERR( SNESSetSolution(self.snes, vec.vec) ) # <<<<<<<<<<<<<<
*
* def getSolutionUpdate(self):
*/
__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(49, 665, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":664
* return vec
*
* def setSolution(self, Vec vec): # <<<<<<<<<<<<<<
* CHKERR( SNESSetSolution(self.snes, vec.vec) )
*
*/
/* 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":667
* CHKERR( SNESSetSolution(self.snes, vec.vec) )
*
* def getSolutionUpdate(self): # <<<<<<<<<<<<<<
* cdef Vec vec = Vec()
* CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_181getSolutionUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_180getSolutionUpdate[] = "SNES.getSolutionUpdate(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_181getSolutionUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getSolutionUpdate (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getSolutionUpdate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolutionUpdate", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_180getSolutionUpdate(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_180getSolutionUpdate(struct PyPetscSNESObject *__pyx_v_self) {
struct PyPetscVecObject *__pyx_v_vec = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getSolutionUpdate", 0);
/* "petsc4py/PETSc/SNES.pyx":668
*
* def getSolutionUpdate(self):
* cdef Vec vec = Vec() # <<<<<<<<<<<<<<
* CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) )
* PetscINCREF(vec.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 668, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":669
* def getSolutionUpdate(self):
* cdef Vec vec = Vec()
* CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) ) # <<<<<<<<<<<<<<
* PetscINCREF(vec.obj)
* return vec
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetSolutionUpdate(__pyx_v_self->snes, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 669, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":670
* cdef Vec vec = Vec()
* CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) )
* PetscINCREF(vec.obj) # <<<<<<<<<<<<<<
* return vec
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":671
* CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) )
* 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":667
* CHKERR( SNESSetSolution(self.snes, vec.vec) )
*
* def getSolutionUpdate(self): # <<<<<<<<<<<<<<
* cdef Vec vec = Vec()
* CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getSolutionUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_vec);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":675
* # --- linear solver ---
*
* def setKSP(self, KSP ksp): # <<<<<<<<<<<<<<
* CHKERR( SNESSetKSP(self.snes, ksp.ksp) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_183setKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_182setKSP[] = "SNES.setKSP(self, KSP ksp)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_183setKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscKSPObject *__pyx_v_ksp = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ksp,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ksp)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setKSP") < 0)) __PYX_ERR(49, 675, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_ksp = ((struct PyPetscKSPObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setKSP", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 675, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setKSP", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ksp), __pyx_ptype_8petsc4py_5PETSc_KSP, 0, "ksp", 0))) __PYX_ERR(49, 675, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_182setKSP(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_ksp);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_182setKSP(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":676
*
* def setKSP(self, KSP ksp):
* CHKERR( SNESSetKSP(self.snes, ksp.ksp) ) # <<<<<<<<<<<<<<
*
* def getKSP(self):
*/
__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(49, 676, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":675
* # --- linear solver ---
*
* def setKSP(self, KSP ksp): # <<<<<<<<<<<<<<
* CHKERR( SNESSetKSP(self.snes, ksp.ksp) )
*
*/
/* 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":678
* CHKERR( SNESSetKSP(self.snes, ksp.ksp) )
*
* def getKSP(self): # <<<<<<<<<<<<<<
* cdef KSP ksp = KSP()
* CHKERR( SNESGetKSP(self.snes, &ksp.ksp) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_185getKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_184getKSP[] = "SNES.getKSP(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_185getKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getKSP (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getKSP", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getKSP", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_184getKSP(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_184getKSP(struct PyPetscSNESObject *__pyx_v_self) {
struct PyPetscKSPObject *__pyx_v_ksp = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getKSP", 0);
/* "petsc4py/PETSc/SNES.pyx":679
*
* def getKSP(self):
* cdef KSP ksp = KSP() # <<<<<<<<<<<<<<
* CHKERR( SNESGetKSP(self.snes, &ksp.ksp) )
* PetscINCREF(ksp.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 679, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":680
* def getKSP(self):
* cdef KSP ksp = KSP()
* CHKERR( SNESGetKSP(self.snes, &ksp.ksp) ) # <<<<<<<<<<<<<<
* PetscINCREF(ksp.obj)
* return ksp
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetKSP(__pyx_v_self->snes, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 680, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":681
* cdef KSP ksp = KSP()
* CHKERR( SNESGetKSP(self.snes, &ksp.ksp) )
* PetscINCREF(ksp.obj) # <<<<<<<<<<<<<<
* return ksp
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":682
* CHKERR( SNESGetKSP(self.snes, &ksp.ksp) )
* PetscINCREF(ksp.obj)
* return ksp # <<<<<<<<<<<<<<
*
* def setUseEW(self, flag=True, *targs, **kargs):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_ksp));
__pyx_r = ((PyObject *)__pyx_v_ksp);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":678
* CHKERR( SNESSetKSP(self.snes, ksp.ksp) )
*
* def getKSP(self): # <<<<<<<<<<<<<<
* cdef KSP ksp = KSP()
* CHKERR( SNESGetKSP(self.snes, &ksp.ksp) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getKSP", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ksp);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":684
* return ksp
*
* def setUseEW(self, flag=True, *targs, **kargs): # <<<<<<<<<<<<<<
* cdef PetscBool bval = flag
* CHKERR( SNESKSPSetUseEW(self.snes, bval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_187setUseEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_186setUseEW[] = "SNES.setUseEW(self, flag=True, *targs, **kargs)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_187setUseEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flag = 0;
PyObject *__pyx_v_targs = 0;
PyObject *__pyx_v_kargs = 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);
__pyx_v_kargs = PyDict_New(); if (unlikely(!__pyx_v_kargs)) return NULL;
__Pyx_GOTREF(__pyx_v_kargs);
if (PyTuple_GET_SIZE(__pyx_args) > 1) {
__pyx_v_targs = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
if (unlikely(!__pyx_v_targs)) {
__Pyx_DECREF(__pyx_v_kargs); __pyx_v_kargs = 0;
__Pyx_RefNannyFinishContext();
return NULL;
}
__Pyx_GOTREF(__pyx_v_targs);
} else {
__pyx_v_targs = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
}
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_True);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
default:
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kargs, values, used_pos_args, "setUseEW") < 0)) __PYX_ERR(49, 684, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
default:
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
}
}
__pyx_v_flag = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__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_186setUseEW(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag, __pyx_v_targs, __pyx_v_kargs);
/* function exit code */
__Pyx_XDECREF(__pyx_v_targs);
__Pyx_XDECREF(__pyx_v_kargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_186setUseEW(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":685
*
* def setUseEW(self, flag=True, *targs, **kargs):
* cdef PetscBool bval = flag # <<<<<<<<<<<<<<
* CHKERR( SNESKSPSetUseEW(self.snes, bval) )
* if targs or kargs: self.setParamsEW(*targs, **kargs)
*/
__pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 685, __pyx_L1_error)
__pyx_v_bval = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":686
* def setUseEW(self, flag=True, *targs, **kargs):
* 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(49, 686, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":687
* cdef PetscBool bval = flag
* CHKERR( SNESKSPSetUseEW(self.snes, bval) )
* if targs or kargs: self.setParamsEW(*targs, **kargs) # <<<<<<<<<<<<<<
*
* def getUseEW(self):
*/
__pyx_t_4 = (PyTuple_GET_SIZE(__pyx_v_targs) != 0);
if (!__pyx_t_4) {
} else {
__pyx_t_3 = __pyx_t_4;
goto __pyx_L4_bool_binop_done;
}
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(49, 687, __pyx_L1_error)
__pyx_t_3 = __pyx_t_4;
__pyx_L4_bool_binop_done:;
if (__pyx_t_3) {
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setParamsEW); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 687, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(49, 687, __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(49, 687, __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":684
* return ksp
*
* def setUseEW(self, flag=True, *targs, **kargs): # <<<<<<<<<<<<<<
* cdef PetscBool bval = flag
* CHKERR( SNESKSPSetUseEW(self.snes, bval) )
*/
/* 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":689
* if targs or kargs: self.setParamsEW(*targs, **kargs)
*
* def getUseEW(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( SNESKSPGetUseEW(self.snes, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_189getUseEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_188getUseEW[] = "SNES.getUseEW(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_189getUseEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getUseEW (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getUseEW", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getUseEW", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_188getUseEW(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_188getUseEW(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":690
*
* def getUseEW(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( SNESKSPGetUseEW(self.snes, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/SNES.pyx":691
* def getUseEW(self):
* 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(49, 691, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":692
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( SNESKSPGetUseEW(self.snes, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def setParamsEW(self, version=None,
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 692, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":689
* if targs or kargs: self.setParamsEW(*targs, **kargs)
*
* def getUseEW(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( SNESKSPGetUseEW(self.snes, &flag) )
*/
/* 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":694
* return toBool(flag)
*
* def setParamsEW(self, version=None, # <<<<<<<<<<<<<<
* rtol_0=None, rtol_max=None,
* gamma=None, alpha=None, alpha2=None,
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_191setParamsEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_190setParamsEW[] = "SNES.setParamsEW(self, version=None, rtol_0=None, rtol_max=None, gamma=None, alpha=None, alpha2=None, threshold=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_191setParamsEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setParamsEW (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_version,&__pyx_n_s_rtol_0,&__pyx_n_s_rtol_max,&__pyx_n_s_gamma,&__pyx_n_s_alpha,&__pyx_n_s_alpha2,&__pyx_n_s_threshold,0};
PyObject* values[7] = {0,0,0,0,0,0,0};
values[0] = ((PyObject *)Py_None);
/* "petsc4py/PETSc/SNES.pyx":695
*
* def setParamsEW(self, version=None,
* rtol_0=None, rtol_max=None, # <<<<<<<<<<<<<<
* gamma=None, alpha=None, alpha2=None,
* threshold=None):
*/
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
/* "petsc4py/PETSc/SNES.pyx":696
* def setParamsEW(self, version=None,
* rtol_0=None, rtol_max=None,
* gamma=None, alpha=None, alpha2=None, # <<<<<<<<<<<<<<
* threshold=None):
* cdef PetscInt cversion = PETSC_DEFAULT
*/
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
values[5] = ((PyObject *)Py_None);
/* "petsc4py/PETSc/SNES.pyx":697
* rtol_0=None, rtol_max=None,
* gamma=None, alpha=None, alpha2=None,
* threshold=None): # <<<<<<<<<<<<<<
* cdef PetscInt cversion = PETSC_DEFAULT
* cdef PetscReal crtol_0 = PETSC_DEFAULT
*/
values[6] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
CYTHON_FALLTHROUGH;
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
CYTHON_FALLTHROUGH;
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_version);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rtol_0);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rtol_max);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gamma);
if (value) { values[3] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 4:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha);
if (value) { values[4] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 5:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha2);
if (value) { values[5] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 6:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_threshold);
if (value) { values[6] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setParamsEW") < 0)) __PYX_ERR(49, 694, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
CYTHON_FALLTHROUGH;
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
CYTHON_FALLTHROUGH;
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_version = values[0];
__pyx_v_rtol_0 = values[1];
__pyx_v_rtol_max = values[2];
__pyx_v_gamma = values[3];
__pyx_v_alpha = values[4];
__pyx_v_alpha2 = values[5];
__pyx_v_threshold = values[6];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setParamsEW", 0, 0, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 694, __pyx_L3_error)
__pyx_L3_error:;
__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_190setParamsEW(((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":694
* return toBool(flag)
*
* def setParamsEW(self, version=None, # <<<<<<<<<<<<<<
* rtol_0=None, rtol_max=None,
* gamma=None, alpha=None, alpha2=None,
*/
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_190setParamsEW(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;
int __pyx_t_2;
PetscInt __pyx_t_3;
PetscReal __pyx_t_4;
PetscErrorCode __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setParamsEW", 0);
/* "petsc4py/PETSc/SNES.pyx":698
* gamma=None, alpha=None, alpha2=None,
* threshold=None):
* cdef PetscInt cversion = PETSC_DEFAULT # <<<<<<<<<<<<<<
* cdef PetscReal crtol_0 = PETSC_DEFAULT
* cdef PetscReal crtol_max = PETSC_DEFAULT
*/
__pyx_v_cversion = PETSC_DEFAULT;
/* "petsc4py/PETSc/SNES.pyx":699
* threshold=None):
* cdef PetscInt cversion = PETSC_DEFAULT
* cdef PetscReal crtol_0 = PETSC_DEFAULT # <<<<<<<<<<<<<<
* cdef PetscReal crtol_max = PETSC_DEFAULT
* cdef PetscReal cgamma = PETSC_DEFAULT
*/
__pyx_v_crtol_0 = PETSC_DEFAULT;
/* "petsc4py/PETSc/SNES.pyx":700
* cdef PetscInt cversion = PETSC_DEFAULT
* cdef PetscReal crtol_0 = PETSC_DEFAULT
* cdef PetscReal crtol_max = PETSC_DEFAULT # <<<<<<<<<<<<<<
* cdef PetscReal cgamma = PETSC_DEFAULT
* cdef PetscReal calpha = PETSC_DEFAULT
*/
__pyx_v_crtol_max = PETSC_DEFAULT;
/* "petsc4py/PETSc/SNES.pyx":701
* cdef PetscReal crtol_0 = PETSC_DEFAULT
* cdef PetscReal crtol_max = PETSC_DEFAULT
* cdef PetscReal cgamma = PETSC_DEFAULT # <<<<<<<<<<<<<<
* cdef PetscReal calpha = PETSC_DEFAULT
* cdef PetscReal calpha2 = PETSC_DEFAULT
*/
__pyx_v_cgamma = PETSC_DEFAULT;
/* "petsc4py/PETSc/SNES.pyx":702
* cdef PetscReal crtol_max = PETSC_DEFAULT
* cdef PetscReal cgamma = PETSC_DEFAULT
* cdef PetscReal calpha = PETSC_DEFAULT # <<<<<<<<<<<<<<
* cdef PetscReal calpha2 = PETSC_DEFAULT
* cdef PetscReal cthreshold = PETSC_DEFAULT
*/
__pyx_v_calpha = PETSC_DEFAULT;
/* "petsc4py/PETSc/SNES.pyx":703
* cdef PetscReal cgamma = PETSC_DEFAULT
* cdef PetscReal calpha = PETSC_DEFAULT
* cdef PetscReal calpha2 = PETSC_DEFAULT # <<<<<<<<<<<<<<
* cdef PetscReal cthreshold = PETSC_DEFAULT
* if version is not None: cversion = asInt(version)
*/
__pyx_v_calpha2 = PETSC_DEFAULT;
/* "petsc4py/PETSc/SNES.pyx":704
* cdef PetscReal calpha = PETSC_DEFAULT
* cdef PetscReal calpha2 = PETSC_DEFAULT
* cdef PetscReal cthreshold = PETSC_DEFAULT # <<<<<<<<<<<<<<
* if version is not None: cversion = asInt(version)
* if rtol_0 is not None: crtol_0 = asReal(rtol_0)
*/
__pyx_v_cthreshold = PETSC_DEFAULT;
/* "petsc4py/PETSc/SNES.pyx":705
* cdef PetscReal calpha2 = PETSC_DEFAULT
* cdef PetscReal cthreshold = PETSC_DEFAULT
* if version is not None: cversion = asInt(version) # <<<<<<<<<<<<<<
* if rtol_0 is not None: crtol_0 = asReal(rtol_0)
* if rtol_max is not None: crtol_max = asReal(rtol_max)
*/
__pyx_t_1 = (__pyx_v_version != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_version); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 705, __pyx_L1_error)
__pyx_v_cversion = __pyx_t_3;
}
/* "petsc4py/PETSc/SNES.pyx":706
* cdef PetscReal cthreshold = PETSC_DEFAULT
* if version is not None: cversion = asInt(version)
* if rtol_0 is not None: crtol_0 = asReal(rtol_0) # <<<<<<<<<<<<<<
* if rtol_max is not None: crtol_max = asReal(rtol_max)
* if gamma is not None: cgamma = asReal(gamma)
*/
__pyx_t_2 = (__pyx_v_rtol_0 != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol_0); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 706, __pyx_L1_error)
__pyx_v_crtol_0 = __pyx_t_4;
}
/* "petsc4py/PETSc/SNES.pyx":707
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol_max); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 707, __pyx_L1_error)
__pyx_v_crtol_max = __pyx_t_4;
}
/* "petsc4py/PETSc/SNES.pyx":708
* 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_2 = (__pyx_v_gamma != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_gamma); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 708, __pyx_L1_error)
__pyx_v_cgamma = __pyx_t_4;
}
/* "petsc4py/PETSc/SNES.pyx":709
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_alpha); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 709, __pyx_L1_error)
__pyx_v_calpha = __pyx_t_4;
}
/* "petsc4py/PETSc/SNES.pyx":710
* 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_2 = (__pyx_v_alpha2 != Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_alpha2); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 710, __pyx_L1_error)
__pyx_v_calpha2 = __pyx_t_4;
}
/* "petsc4py/PETSc/SNES.pyx":711
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_threshold); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 711, __pyx_L1_error)
__pyx_v_cthreshold = __pyx_t_4;
}
/* "petsc4py/PETSc/SNES.pyx":712
* 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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 712, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":694
* return toBool(flag)
*
* def setParamsEW(self, version=None, # <<<<<<<<<<<<<<
* rtol_0=None, rtol_max=None,
* gamma=None, alpha=None, alpha2=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":716
* cgamma, calpha, calpha2, cthreshold) )
*
* def getParamsEW(self): # <<<<<<<<<<<<<<
* cdef PetscInt version=0
* cdef PetscReal rtol_0=0, rtol_max=0
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_193getParamsEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_192getParamsEW[] = "SNES.getParamsEW(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_193getParamsEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getParamsEW (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getParamsEW", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getParamsEW", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_192getParamsEW(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_192getParamsEW(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":717
*
* def getParamsEW(self):
* 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":718
* def getParamsEW(self):
* 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":719
* 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":720
* 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":721
* 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(49, 721, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":724
* 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(49, 724, __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(49, 724, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_version, __pyx_t_3) < 0) __PYX_ERR(49, 724, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":725
* &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(49, 725, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rtol_0, __pyx_t_3) < 0) __PYX_ERR(49, 724, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":726
* 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(49, 726, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rtol_max, __pyx_t_3) < 0) __PYX_ERR(49, 724, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":727
* '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(49, 727, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gamma, __pyx_t_3) < 0) __PYX_ERR(49, 724, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":728
* '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(49, 728, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alpha, __pyx_t_3) < 0) __PYX_ERR(49, 724, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":729
* '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(49, 729, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alpha2, __pyx_t_3) < 0) __PYX_ERR(49, 724, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":730
* 'alpha' : toReal(alpha),
* 'alpha2' : toReal(alpha2),
* 'threshold' : toReal(threshold),} # <<<<<<<<<<<<<<
*
* # --- matrix free / finite differences ---
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_threshold); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 730, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_threshold, __pyx_t_3) < 0) __PYX_ERR(49, 724, __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":716
* cgamma, calpha, calpha2, cthreshold) )
*
* def getParamsEW(self): # <<<<<<<<<<<<<<
* cdef PetscInt version=0
* cdef PetscReal rtol_0=0, rtol_max=0
*/
/* 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":734
* # --- matrix free / finite differences ---
*
* def setUseMF(self, flag=True): # <<<<<<<<<<<<<<
* cdef PetscBool bval = flag
* CHKERR( SNESSetUseMFFD(self.snes, bval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_195setUseMF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_194setUseMF[] = "SNES.setUseMF(self, flag=True)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_195setUseMF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flag = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_True);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setUseMF") < 0)) __PYX_ERR(49, 734, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_flag = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setUseMF", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 734, __pyx_L3_error)
__pyx_L3_error:;
__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_194setUseMF(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_194setUseMF(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":735
*
* def setUseMF(self, flag=True):
* cdef PetscBool bval = flag # <<<<<<<<<<<<<<
* CHKERR( SNESSetUseMFFD(self.snes, bval) )
*
*/
__pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 735, __pyx_L1_error)
__pyx_v_bval = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":736
* def setUseMF(self, flag=True):
* cdef PetscBool bval = flag
* CHKERR( SNESSetUseMFFD(self.snes, bval) ) # <<<<<<<<<<<<<<
*
* def getUseMF(self):
*/
__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(49, 736, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":734
* # --- matrix free / finite differences ---
*
* def setUseMF(self, flag=True): # <<<<<<<<<<<<<<
* cdef PetscBool bval = flag
* CHKERR( SNESSetUseMFFD(self.snes, bval) )
*/
/* 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":738
* CHKERR( SNESSetUseMFFD(self.snes, bval) )
*
* def getUseMF(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( SNESGetUseMFFD(self.snes, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_197getUseMF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_196getUseMF[] = "SNES.getUseMF(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_197getUseMF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getUseMF (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getUseMF", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getUseMF", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_196getUseMF(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_196getUseMF(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":739
*
* def getUseMF(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( SNESGetUseMFFD(self.snes, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/SNES.pyx":740
* def getUseMF(self):
* 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(49, 740, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":741
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( SNESGetUseMFFD(self.snes, &flag) )
* return toBool(flag) # <<<<<<<<<<<<<<
*
* def setUseFD(self, flag=True):
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 741, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":738
* CHKERR( SNESSetUseMFFD(self.snes, bval) )
*
* def getUseMF(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( SNESGetUseMFFD(self.snes, &flag) )
*/
/* 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":743
* return toBool(flag)
*
* def setUseFD(self, flag=True): # <<<<<<<<<<<<<<
* cdef PetscBool bval = flag
* CHKERR( SNESSetUseFDColoring(self.snes, bval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_199setUseFD(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_198setUseFD[] = "SNES.setUseFD(self, flag=True)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_199setUseFD(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_flag = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_True);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setUseFD") < 0)) __PYX_ERR(49, 743, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_flag = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setUseFD", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 743, __pyx_L3_error)
__pyx_L3_error:;
__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_198setUseFD(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_198setUseFD(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":744
*
* def setUseFD(self, flag=True):
* cdef PetscBool bval = flag # <<<<<<<<<<<<<<
* CHKERR( SNESSetUseFDColoring(self.snes, bval) )
*
*/
__pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 744, __pyx_L1_error)
__pyx_v_bval = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":745
* def setUseFD(self, flag=True):
* cdef PetscBool bval = flag
* CHKERR( SNESSetUseFDColoring(self.snes, bval) ) # <<<<<<<<<<<<<<
*
* def getUseFD(self):
*/
__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(49, 745, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":743
* return toBool(flag)
*
* def setUseFD(self, flag=True): # <<<<<<<<<<<<<<
* cdef PetscBool bval = flag
* CHKERR( SNESSetUseFDColoring(self.snes, bval) )
*/
/* 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":747
* CHKERR( SNESSetUseFDColoring(self.snes, bval) )
*
* def getUseFD(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( SNESGetUseFDColoring(self.snes, &flag) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_201getUseFD(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_200getUseFD[] = "SNES.getUseFD(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_201getUseFD(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getUseFD (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getUseFD", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getUseFD", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_200getUseFD(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_200getUseFD(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":748
*
* def getUseFD(self):
* cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<<
* CHKERR( SNESGetUseFDColoring(self.snes, &flag) )
* return toBool(flag)
*/
__pyx_v_flag = PETSC_FALSE;
/* "petsc4py/PETSc/SNES.pyx":749
* def getUseFD(self):
* 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(49, 749, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":750
* 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(49, 750, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":747
* CHKERR( SNESSetUseFDColoring(self.snes, bval) )
*
* def getUseFD(self): # <<<<<<<<<<<<<<
* cdef PetscBool flag = PETSC_FALSE
* CHKERR( SNESGetUseFDColoring(self.snes, &flag) )
*/
/* 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":754
* # --- VI ---
*
* def setVariableBounds(self, Vec xl, Vec xu): # <<<<<<<<<<<<<<
* CHKERR( SNESVISetVariableBounds(self.snes, xl.vec, xu.vec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_203setVariableBounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_202setVariableBounds[] = "SNES.setVariableBounds(self, Vec xl, Vec xu)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_203setVariableBounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscVecObject *__pyx_v_xl = 0;
struct PyPetscVecObject *__pyx_v_xu = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xl,&__pyx_n_s_xu,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xl)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xu)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setVariableBounds", 1, 2, 2, 1); __PYX_ERR(49, 754, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setVariableBounds") < 0)) __PYX_ERR(49, 754, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_xl = ((struct PyPetscVecObject *)values[0]);
__pyx_v_xu = ((struct PyPetscVecObject *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setVariableBounds", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 754, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setVariableBounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xl), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xl", 0))) __PYX_ERR(49, 754, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xu), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xu", 0))) __PYX_ERR(49, 754, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_202setVariableBounds(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_xl, __pyx_v_xu);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_202setVariableBounds(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":755
*
* def setVariableBounds(self, Vec xl, Vec xu):
* CHKERR( SNESVISetVariableBounds(self.snes, xl.vec, xu.vec) ) # <<<<<<<<<<<<<<
*
* def getVIInactiveSet(self):
*/
__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(49, 755, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":754
* # --- VI ---
*
* def setVariableBounds(self, Vec xl, Vec xu): # <<<<<<<<<<<<<<
* CHKERR( SNESVISetVariableBounds(self.snes, xl.vec, xu.vec) )
*
*/
/* 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":757
* CHKERR( SNESVISetVariableBounds(self.snes, xl.vec, xu.vec) )
*
* def getVIInactiveSet(self): # <<<<<<<<<<<<<<
* cdef IS inact = IS()
* CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_205getVIInactiveSet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_204getVIInactiveSet[] = "SNES.getVIInactiveSet(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_205getVIInactiveSet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getVIInactiveSet (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getVIInactiveSet", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVIInactiveSet", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_204getVIInactiveSet(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_204getVIInactiveSet(struct PyPetscSNESObject *__pyx_v_self) {
struct PyPetscISObject *__pyx_v_inact = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getVIInactiveSet", 0);
/* "petsc4py/PETSc/SNES.pyx":758
*
* def getVIInactiveSet(self):
* cdef IS inact = IS() # <<<<<<<<<<<<<<
* CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) )
* PetscINCREF(inact.obj)
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 758, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_inact = ((struct PyPetscISObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":759
* def getVIInactiveSet(self):
* cdef IS inact = IS()
* CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) ) # <<<<<<<<<<<<<<
* PetscINCREF(inact.obj)
* return inact
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESVIGetInactiveSet(__pyx_v_self->snes, (&__pyx_v_inact->iset))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 759, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":760
* cdef IS inact = IS()
* CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) )
* PetscINCREF(inact.obj) # <<<<<<<<<<<<<<
* return inact
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_inact->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":761
* CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) )
* 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":757
* CHKERR( SNESVISetVariableBounds(self.snes, xl.vec, xu.vec) )
*
* def getVIInactiveSet(self): # <<<<<<<<<<<<<<
* cdef IS inact = IS()
* CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getVIInactiveSet", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_inact);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":765
* # --- Python ---
*
* def createPython(self, context=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSNES newsnes = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_207createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_206createPython[] = "SNES.createPython(self, context=None, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_207createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_context = 0;
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_comm,0};
PyObject* values[2] = {0,0};
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
if (value) { values[0] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[1] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createPython") < 0)) __PYX_ERR(49, 765, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_context = values[0];
__pyx_v_comm = values[1];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("createPython", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 765, __pyx_L3_error)
__pyx_L3_error:;
__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_206createPython(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_206createPython(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":766
*
* def createPython(self, context=None, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(49, 766, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":767
* def createPython(self, context=None, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSNES newsnes = NULL # <<<<<<<<<<<<<<
* CHKERR( SNESCreate(ccomm, &newsnes) )
* PetscCLEAR(self.obj); self.snes = newsnes
*/
__pyx_v_newsnes = NULL;
/* "petsc4py/PETSc/SNES.pyx":768
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSNES newsnes = NULL
* CHKERR( SNESCreate(ccomm, &newsnes) ) # <<<<<<<<<<<<<<
* 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(49, 768, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":769
* cdef PetscSNES newsnes = NULL
* CHKERR( SNESCreate(ccomm, &newsnes) )
* PetscCLEAR(self.obj); self.snes = newsnes # <<<<<<<<<<<<<<
* CHKERR( SNESSetType(self.snes, SNESPYTHON) )
* CHKERR( SNESPythonSetContext(self.snes, <void*>context) )
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->snes = __pyx_v_newsnes;
/* "petsc4py/PETSc/SNES.pyx":770
* CHKERR( SNESCreate(ccomm, &newsnes) )
* 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(49, 770, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":771
* 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(49, 771, __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, 771, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":772
* CHKERR( SNESSetType(self.snes, SNESPYTHON) )
* CHKERR( SNESPythonSetContext(self.snes, <void*>context) )
* return self # <<<<<<<<<<<<<<
*
* def setPythonContext(self, context):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":765
* # --- Python ---
*
* def createPython(self, context=None, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscSNES newsnes = NULL
*/
/* 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":774
* return self
*
* def setPythonContext(self, context): # <<<<<<<<<<<<<<
* CHKERR( SNESPythonSetContext(self.snes, <void*>context) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_209setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_208setPythonContext[] = "SNES.setPythonContext(self, context)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_209setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_context = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonContext") < 0)) __PYX_ERR(49, 774, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_context = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 774, __pyx_L3_error)
__pyx_L3_error:;
__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_208setPythonContext(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_context);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_208setPythonContext(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":775
*
* def setPythonContext(self, context):
* CHKERR( SNESPythonSetContext(self.snes, <void*>context) ) # <<<<<<<<<<<<<<
*
* def getPythonContext(self):
*/
__pyx_t_1 = SNESPythonSetContext(__pyx_v_self->snes, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 775, __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, 775, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":774
* return self
*
* def setPythonContext(self, context): # <<<<<<<<<<<<<<
* CHKERR( SNESPythonSetContext(self.snes, <void*>context) )
*
*/
/* 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":777
* CHKERR( SNESPythonSetContext(self.snes, <void*>context) )
*
* def getPythonContext(self): # <<<<<<<<<<<<<<
* cdef void *context = NULL
* CHKERR( SNESPythonGetContext(self.snes, &context) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_211getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_210getPythonContext[] = "SNES.getPythonContext(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_211getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getPythonContext (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getPythonContext", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonContext", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_210getPythonContext(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_210getPythonContext(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":778
*
* def getPythonContext(self):
* cdef void *context = NULL # <<<<<<<<<<<<<<
* CHKERR( SNESPythonGetContext(self.snes, &context) )
* if context == NULL: return None
*/
__pyx_v_context = NULL;
/* "petsc4py/PETSc/SNES.pyx":779
* def getPythonContext(self):
* 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(49, 779, __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, 779, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":780
* 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) != 0);
if (__pyx_t_3) {
__Pyx_XDECREF(__pyx_r);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
}
/* "petsc4py/PETSc/SNES.pyx":781
* CHKERR( SNESPythonGetContext(self.snes, &context) )
* if context == NULL: return None
* else: return <object> context # <<<<<<<<<<<<<<
*
* def setPythonType(self, py_type):
*/
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_context));
__pyx_r = ((PyObject *)__pyx_v_context);
goto __pyx_L0;
}
/* "petsc4py/PETSc/SNES.pyx":777
* CHKERR( SNESPythonSetContext(self.snes, <void*>context) )
*
* def getPythonContext(self): # <<<<<<<<<<<<<<
* cdef void *context = NULL
* CHKERR( SNESPythonGetContext(self.snes, &context) )
*/
/* 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":783
* else: return <object> context
*
* def setPythonType(self, py_type): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* py_type = str2bytes(py_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_213setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_212setPythonType[] = "SNES.setPythonType(self, py_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_213setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_py_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_py_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonType") < 0)) __PYX_ERR(49, 783, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_py_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 783, __pyx_L3_error)
__pyx_L3_error:;
__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_212setPythonType(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_py_type);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_212setPythonType(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":784
*
* def setPythonType(self, py_type):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* py_type = str2bytes(py_type, &cval)
* CHKERR( SNESPythonSetType(self.snes, cval) )
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/SNES.pyx":785
* def setPythonType(self, py_type):
* 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(49, 785, __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":786
* cdef const char *cval = NULL
* py_type = str2bytes(py_type, &cval)
* CHKERR( SNESPythonSetType(self.snes, cval) ) # <<<<<<<<<<<<<<
*
* def getPythonType(self):
*/
__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(49, 786, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":783
* else: return <object> context
*
* def setPythonType(self, py_type): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* py_type = str2bytes(py_type, &cval)
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.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":788
* CHKERR( SNESPythonSetType(self.snes, cval) )
*
* def getPythonType(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( SNESPythonGetType(self.snes, &cval) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_215getPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_214getPythonType[] = "SNES.getPythonType(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_215getPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getPythonType (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getPythonType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonType", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_214getPythonType(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_214getPythonType(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":789
*
* def getPythonType(self):
* cdef const char *cval = NULL # <<<<<<<<<<<<<<
* CHKERR( SNESPythonGetType(self.snes, &cval) )
* return bytes2str(cval)
*/
__pyx_v_cval = NULL;
/* "petsc4py/PETSc/SNES.pyx":790
* def getPythonType(self):
* 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(49, 790, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":791
* 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(49, 791, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":788
* CHKERR( SNESPythonSetType(self.snes, cval) )
*
* def getPythonType(self): # <<<<<<<<<<<<<<
* cdef const char *cval = NULL
* CHKERR( SNESPythonGetType(self.snes, &cval) )
*/
/* 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":795
* # --- Composite ---
*
* def getCompositeSNES(self, n): # <<<<<<<<<<<<<<
* cdef PetscInt cn
* cdef SNES snes = SNES()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_217getCompositeSNES(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_216getCompositeSNES[] = "SNES.getCompositeSNES(self, n)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_217getCompositeSNES(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_n = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getCompositeSNES") < 0)) __PYX_ERR(49, 795, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_n = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getCompositeSNES", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 795, __pyx_L3_error)
__pyx_L3_error:;
__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_216getCompositeSNES(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_n);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_216getCompositeSNES(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
PyObject *__pyx_t_1 = NULL;
PetscInt __pyx_t_2;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getCompositeSNES", 0);
/* "petsc4py/PETSc/SNES.pyx":797
* def getCompositeSNES(self, n):
* cdef PetscInt cn
* cdef SNES snes = SNES() # <<<<<<<<<<<<<<
* cn = asInt(n)
* CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) )
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 797, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_snes = ((struct PyPetscSNESObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":798
* cdef PetscInt cn
* cdef SNES snes = SNES()
* cn = asInt(n) # <<<<<<<<<<<<<<
* CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) )
* PetscINCREF(snes.obj)
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_n); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 798, __pyx_L1_error)
__pyx_v_cn = __pyx_t_2;
/* "petsc4py/PETSc/SNES.pyx":799
* cdef SNES snes = SNES()
* cn = asInt(n)
* CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) ) # <<<<<<<<<<<<<<
* PetscINCREF(snes.obj)
* return snes
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESCompositeGetSNES(__pyx_v_self->snes, __pyx_v_cn, (&__pyx_v_snes->snes))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 799, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":800
* cn = asInt(n)
* CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) )
* PetscINCREF(snes.obj) # <<<<<<<<<<<<<<
* return snes
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_snes->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":801
* CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) )
* PetscINCREF(snes.obj)
* return snes # <<<<<<<<<<<<<<
*
* def getCompositeNumber(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_snes));
__pyx_r = ((PyObject *)__pyx_v_snes);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":795
* # --- Composite ---
*
* def getCompositeSNES(self, n): # <<<<<<<<<<<<<<
* cdef PetscInt cn
* cdef SNES snes = SNES()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getCompositeSNES", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_snes);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":803
* return snes
*
* def getCompositeNumber(self): # <<<<<<<<<<<<<<
* cdef PetscInt cn = 0
* CHKERR( SNESCompositeGetNumber(self.snes, &cn) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_219getCompositeNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_218getCompositeNumber[] = "SNES.getCompositeNumber(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_219getCompositeNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getCompositeNumber (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getCompositeNumber", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCompositeNumber", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_218getCompositeNumber(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_218getCompositeNumber(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":804
*
* def getCompositeNumber(self):
* cdef PetscInt cn = 0 # <<<<<<<<<<<<<<
* CHKERR( SNESCompositeGetNumber(self.snes, &cn) )
* return toInt(cn)
*/
__pyx_v_cn = 0;
/* "petsc4py/PETSc/SNES.pyx":805
* def getCompositeNumber(self):
* 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(49, 805, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":806
* 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(49, 806, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":803
* return snes
*
* def getCompositeNumber(self): # <<<<<<<<<<<<<<
* cdef PetscInt cn = 0
* CHKERR( SNESCompositeGetNumber(self.snes, &cn) )
*/
/* 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":810
* # --- NASM ---
*
* def getNASMSNES(self, n): # <<<<<<<<<<<<<<
* cdef PetscInt cn = asInt(n)
* cdef SNES snes = SNES()
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_221getNASMSNES(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_220getNASMSNES[] = "SNES.getNASMSNES(self, n)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_221getNASMSNES(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_n = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getNASMSNES") < 0)) __PYX_ERR(49, 810, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_n = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("getNASMSNES", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 810, __pyx_L3_error)
__pyx_L3_error:;
__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_220getNASMSNES(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_n);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_220getNASMSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_n) {
PetscInt __pyx_v_cn;
struct PyPetscSNESObject *__pyx_v_snes = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscInt __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PetscErrorCode __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getNASMSNES", 0);
/* "petsc4py/PETSc/SNES.pyx":811
*
* def getNASMSNES(self, n):
* 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(49, 811, __pyx_L1_error)
__pyx_v_cn = __pyx_t_1;
/* "petsc4py/PETSc/SNES.pyx":812
* def getNASMSNES(self, n):
* cdef PetscInt cn = asInt(n)
* cdef SNES snes = SNES() # <<<<<<<<<<<<<<
* CHKERR( SNESNASMGetSNES(self.snes, cn, &snes.snes) )
* PetscINCREF(snes.obj)
*/
__pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 812, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_snes = ((struct PyPetscSNESObject *)__pyx_t_2);
__pyx_t_2 = 0;
/* "petsc4py/PETSc/SNES.pyx":813
* cdef PetscInt cn = asInt(n)
* cdef SNES snes = SNES()
* CHKERR( SNESNASMGetSNES(self.snes, cn, &snes.snes) ) # <<<<<<<<<<<<<<
* PetscINCREF(snes.obj)
* return snes
*/
__pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESNASMGetSNES(__pyx_v_self->snes, __pyx_v_cn, (&__pyx_v_snes->snes))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 813, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":814
* cdef SNES snes = SNES()
* CHKERR( SNESNASMGetSNES(self.snes, cn, &snes.snes) )
* PetscINCREF(snes.obj) # <<<<<<<<<<<<<<
* return snes
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_snes->__pyx_base.obj));
/* "petsc4py/PETSc/SNES.pyx":815
* CHKERR( SNESNASMGetSNES(self.snes, cn, &snes.snes) )
* PetscINCREF(snes.obj)
* return snes # <<<<<<<<<<<<<<
*
* def getNASMNumber(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_snes));
__pyx_r = ((PyObject *)__pyx_v_snes);
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":810
* # --- NASM ---
*
* def getNASMSNES(self, n): # <<<<<<<<<<<<<<
* cdef PetscInt cn = asInt(n)
* cdef SNES snes = SNES()
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.getNASMSNES", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_snes);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":817
* return snes
*
* def getNASMNumber(self): # <<<<<<<<<<<<<<
* cdef PetscInt cn = 0
* CHKERR( SNESNASMGetNumber(self.snes, &cn) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_223getNASMNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_222getNASMNumber[] = "SNES.getNASMNumber(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_223getNASMNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getNASMNumber (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("getNASMNumber", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNASMNumber", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_222getNASMNumber(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_222getNASMNumber(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":818
*
* def getNASMNumber(self):
* cdef PetscInt cn = 0 # <<<<<<<<<<<<<<
* CHKERR( SNESNASMGetNumber(self.snes, &cn) )
* return toInt(cn)
*/
__pyx_v_cn = 0;
/* "petsc4py/PETSc/SNES.pyx":819
* def getNASMNumber(self):
* 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(49, 819, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":820
* 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(49, 820, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":817
* return snes
*
* def getNASMNumber(self): # <<<<<<<<<<<<<<
* cdef PetscInt cn = 0
* CHKERR( SNESNASMGetNumber(self.snes, &cn) )
*/
/* 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":824
* # --- Patch ---
*
* def setPatchCellNumbering(self, Section sec not None): # <<<<<<<<<<<<<<
* CHKERR( SNESPatchSetCellNumbering(self.snes, sec.sec) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_225setPatchCellNumbering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_224setPatchCellNumbering[] = "SNES.setPatchCellNumbering(self, Section sec)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_225setPatchCellNumbering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscSectionObject *__pyx_v_sec = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sec)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchCellNumbering") < 0)) __PYX_ERR(49, 824, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_sec = ((struct PyPetscSectionObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPatchCellNumbering", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 824, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchCellNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(49, 824, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_224setPatchCellNumbering(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_sec);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_224setPatchCellNumbering(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":825
*
* def setPatchCellNumbering(self, Section sec not None):
* 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(49, 825, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":824
* # --- Patch ---
*
* def setPatchCellNumbering(self, Section sec not None): # <<<<<<<<<<<<<<
* 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":827
* CHKERR( SNESPatchSetCellNumbering(self.snes, sec.sec) )
*
* def setPatchDiscretisationInfo(self, dms, bs, # <<<<<<<<<<<<<<
* cellNodeMaps,
* subspaceOffsets,
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_227setPatchDiscretisationInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_226setPatchDiscretisationInfo[] = "SNES.setPatchDiscretisationInfo(self, dms, bs, cellNodeMaps, subspaceOffsets, ghostBcNodes, globalBcNodes)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_227setPatchDiscretisationInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setPatchDiscretisationInfo (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dms,&__pyx_n_s_bs,&__pyx_n_s_cellNodeMaps,&__pyx_n_s_subspaceOffsets,&__pyx_n_s_ghostBcNodes,&__pyx_n_s_globalBcNodes,0};
PyObject* values[6] = {0,0,0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
CYTHON_FALLTHROUGH;
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dms)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 1); __PYX_ERR(49, 827, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cellNodeMaps)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 2); __PYX_ERR(49, 827, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subspaceOffsets)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 3); __PYX_ERR(49, 827, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 4:
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ghostBcNodes)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 4); __PYX_ERR(49, 827, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 5:
if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_globalBcNodes)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 5); __PYX_ERR(49, 827, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchDiscretisationInfo") < 0)) __PYX_ERR(49, 827, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
}
__pyx_v_dms = values[0];
__pyx_v_bs = values[1];
__pyx_v_cellNodeMaps = values[2];
__pyx_v_subspaceOffsets = values[3];
__pyx_v_ghostBcNodes = values[4];
__pyx_v_globalBcNodes = values[5];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 827, __pyx_L3_error)
__pyx_L3_error:;
__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_226setPatchDiscretisationInfo(((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 */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_226setPatchDiscretisationInfo(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":832
* ghostBcNodes,
* globalBcNodes):
* cdef PetscInt numSubSpaces = 0 # <<<<<<<<<<<<<<
* cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0
* cdef PetscInt *nodesPerCell = NULL
*/
__pyx_v_numSubSpaces = 0;
/* "petsc4py/PETSc/SNES.pyx":833
* globalBcNodes):
* cdef PetscInt numSubSpaces = 0
* cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 # <<<<<<<<<<<<<<
* cdef PetscInt *nodesPerCell = NULL
* cdef const PetscInt **ccellNodeMaps = NULL
*/
__pyx_v_numGhostBcs = 0;
__pyx_v_numGlobalBcs = 0;
/* "petsc4py/PETSc/SNES.pyx":834
* 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":835
* 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":836
* 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":837
* 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":838
* 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":839
* 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":840
* cdef PetscInt *csubspaceOffsets = NULL
* cdef PetscInt *cghostBcNodes = NULL
* cdef PetscInt *cglobalBcNodes = NULL # <<<<<<<<<<<<<<
* cdef PetscInt i = 0
*
*/
__pyx_v_cglobalBcNodes = NULL;
/* "petsc4py/PETSc/SNES.pyx":841
* 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":843
* 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(49, 843, __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":844
*
* 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(49, 844, __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":845
* 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(49, 845, __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":846
* 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(49, 846, __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":848
* 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(49, 848, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":849
*
* 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(49, 849, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":850
* 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(49, 850, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":851
* 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":852
* 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_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 852, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(49, 852, __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":853
* 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_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 853, __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(49, 853, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 853, __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(49, 853, __pyx_L1_error)
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_7 = PyList_GET_ITEM(sequence, 0);
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
#else
__pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 853, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(49, 853, __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(49, 853, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
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(49, 853, __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(49, 853, __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":854
* 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_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 854, __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(49, 854, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(__Pyx_SetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, __pyx_t_8, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1) < 0)) __PYX_ERR(49, 854, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "petsc4py/PETSc/SNES.pyx":855
* _, 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(49, 855, __pyx_L1_error)
(__pyx_v_nodesPerCell[__pyx_v_i]) = __pyx_t_11;
}
/* "petsc4py/PETSc/SNES.pyx":858
*
* # 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(49, 858, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":863
* 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(49, 863, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":864
* 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(49, 864, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":865
* CHKERR( PetscFree(nodesPerCell) )
* CHKERR( PetscFree(cdms) )
* CHKERR( PetscFree(ccellNodeMaps) ) # <<<<<<<<<<<<<<
*
* def setPatchComputeOperator(self, operator, args=None, kargs=None):
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ccellNodeMaps)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 865, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":827
* 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":867
* CHKERR( PetscFree(ccellNodeMaps) )
*
* def setPatchComputeOperator(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_229setPatchComputeOperator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_228setPatchComputeOperator[] = "SNES.setPatchComputeOperator(self, operator, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_229setPatchComputeOperator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_operator = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_operator,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_operator)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchComputeOperator") < 0)) __PYX_ERR(49, 867, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_operator = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPatchComputeOperator", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 867, __pyx_L3_error)
__pyx_L3_error:;
__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_228setPatchComputeOperator(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_operator, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_228setPatchComputeOperator(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;
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("setPatchComputeOperator", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/SNES.pyx":868
*
* def setPatchComputeOperator(self, operator, args=None, kargs=None):
* if args is None: args = () # <<<<<<<<<<<<<<
* if kargs is None: kargs = {}
* context = (operator, args, kargs)
*/
__pyx_t_1 = (__pyx_v_args == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/SNES.pyx":869
* def setPatchComputeOperator(self, operator, args=None, kargs=None):
* if args is None: args = ()
* if kargs is None: kargs = {} # <<<<<<<<<<<<<<
* context = (operator, args, kargs)
* self.set_attr("__patch_compute_operator__", context)
*/
__pyx_t_2 = (__pyx_v_kargs == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 869, __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":870
* 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_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 870, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_operator);
__Pyx_GIVEREF(__pyx_v_operator);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_operator);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":871
* 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_3 = ((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_3)) __PYX_ERR(49, 871, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":872
* 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):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPatchSetComputeOperator(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperator, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 872, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":867
* CHKERR( PetscFree(ccellNodeMaps) )
*
* def setPatchComputeOperator(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":874
* CHKERR( SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, <void*>context) )
*
* def setPatchComputeFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_231setPatchComputeFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_230setPatchComputeFunction[] = "SNES.setPatchComputeFunction(self, function, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_231setPatchComputeFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_function = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[3] = {0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[2] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchComputeFunction") < 0)) __PYX_ERR(49, 874, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_function = values[0];
__pyx_v_args = values[1];
__pyx_v_kargs = values[2];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPatchComputeFunction", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 874, __pyx_L3_error)
__pyx_L3_error:;
__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_230setPatchComputeFunction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_230setPatchComputeFunction(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;
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("setPatchComputeFunction", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/SNES.pyx":875
*
* def setPatchComputeFunction(self, function, args=None, kargs=None):
* if args is None: args = () # <<<<<<<<<<<<<<
* if kargs is None: kargs = {}
* context = (function, args, kargs)
*/
__pyx_t_1 = (__pyx_v_args == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/SNES.pyx":876
* def setPatchComputeFunction(self, function, args=None, kargs=None):
* if args is None: args = ()
* if kargs is None: kargs = {} # <<<<<<<<<<<<<<
* context = (function, args, kargs)
* self.set_attr("__patch_compute_function__", context)
*/
__pyx_t_2 = (__pyx_v_kargs == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 876, __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":877
* 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_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 877, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_function);
__Pyx_GIVEREF(__pyx_v_function);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_function);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":878
* 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_3 = ((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_3)) __PYX_ERR(49, 878, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":879
* 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):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPatchSetComputeFunction(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunction, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 879, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":874
* CHKERR( SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, <void*>context) )
*
* def setPatchComputeFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":881
* CHKERR( SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, <void*>context) )
*
* def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_233setPatchConstructType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_4SNES_232setPatchConstructType[] = "SNES.setPatchConstructType(self, typ, operator=None, args=None, kargs=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_233setPatchConstructType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_typ = 0;
PyObject *__pyx_v_operator = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kargs = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typ,&__pyx_n_s_operator,&__pyx_n_s_args,&__pyx_n_s_kargs,0};
PyObject* values[4] = {0,0,0,0};
values[1] = ((PyObject *)Py_None);
values[2] = ((PyObject *)Py_None);
values[3] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typ)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_operator);
if (value) { values[1] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 2:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
if (value) { values[2] = value; kw_args--; }
}
CYTHON_FALLTHROUGH;
case 3:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs);
if (value) { values[3] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchConstructType") < 0)) __PYX_ERR(49, 881, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_typ = values[0];
__pyx_v_operator = values[1];
__pyx_v_args = values[2];
__pyx_v_kargs = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setPatchConstructType", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 881, __pyx_L3_error)
__pyx_L3_error:;
__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_232setPatchConstructType(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_typ, __pyx_v_operator, __pyx_v_args, __pyx_v_kargs);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_232setPatchConstructType(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;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
PCPatchConstructType __pyx_t_7;
PetscErrorCode __pyx_t_8;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("setPatchConstructType", 0);
__Pyx_INCREF(__pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
/* "petsc4py/PETSc/SNES.pyx":882
*
* def setPatchConstructType(self, typ, operator=None, args=None, kargs=None):
* if args is None: args = () # <<<<<<<<<<<<<<
* if kargs is None: kargs = {}
*
*/
__pyx_t_1 = (__pyx_v_args == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_empty_tuple);
__Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple);
}
/* "petsc4py/PETSc/SNES.pyx":883
* def setPatchConstructType(self, typ, operator=None, args=None, kargs=None):
* if args is None: args = ()
* if kargs is None: kargs = {} # <<<<<<<<<<<<<<
*
* if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None:
*/
__pyx_t_2 = (__pyx_v_kargs == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 883, __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":885
* 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_3 = __pyx_v_typ;
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_n_s_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 885, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PYTHON); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 885, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 885, __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(49, 885, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!__pyx_t_6) {
} else {
__pyx_t_2 = __pyx_t_6;
goto __pyx_L8_bool_binop_done;
}
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_n_s_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 885, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_USER); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 885, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 885, __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(49, 885, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_2 = __pyx_t_6;
__pyx_L8_bool_binop_done:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = (__pyx_t_2 != 0);
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_2 = (__pyx_t_6 != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L6_bool_binop_done:;
if (unlikely(__pyx_t_1)) {
/* "petsc4py/PETSc/SNES.pyx":886
*
* 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_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 886, __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(49, 886, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":885
* 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":887
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
/* "petsc4py/PETSc/SNES.pyx":888
* raise ValueError("Must provide operator for USER or PYTHON type")
* if operator is not None:
* context = (operator, args, kargs) # <<<<<<<<<<<<<<
* else:
* context = None
*/
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 888, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_operator);
__Pyx_GIVEREF(__pyx_v_operator);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_operator);
__Pyx_INCREF(__pyx_v_args);
__Pyx_GIVEREF(__pyx_v_args);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args);
__Pyx_INCREF(__pyx_v_kargs);
__Pyx_GIVEREF(__pyx_v_kargs);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs);
__pyx_v_context = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":887
* 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":890
* 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":891
* else:
* context = None
* self.set_attr("__patch_construction_operator__", context) # <<<<<<<<<<<<<<
* CHKERR( SNESPatchSetConstructType(self.snes, typ, PCPatch_UserConstructOperator, <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 *)"__patch_construction_operator__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 891, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":892
* context = None
* self.set_attr("__patch_construction_operator__", context)
* CHKERR( SNESPatchSetConstructType(self.snes, typ, PCPatch_UserConstructOperator, <void*>context) ) # <<<<<<<<<<<<<<
*
* # --- application context ---
*/
__pyx_t_7 = ((PCPatchConstructType)__Pyx_PyInt_As_PCPatchConstructType(__pyx_v_typ)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 892, __pyx_L1_error)
__pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPatchSetConstructType(__pyx_v_self->snes, __pyx_t_7, __pyx_f_8petsc4py_5PETSc_PCPatch_UserConstructOperator, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 892, __pyx_L1_error)
/* "petsc4py/PETSc/SNES.pyx":881
* CHKERR( SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, <void*>context) )
*
* def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): # <<<<<<<<<<<<<<
* if args is None: args = ()
* if kargs is None: kargs = {}
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__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":897
*
* property appctx:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getAppCtx()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6appctx_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6appctx_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6appctx___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6appctx___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":898
* property appctx:
* def __get__(self):
* return self.getAppCtx() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setAppCtx(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 898, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 898, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":897
*
* property appctx:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getAppCtx()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.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":899
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6appctx_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES_6appctx_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/SNES.pyx":900
* return self.getAppCtx()
* def __set__(self, value):
* self.setAppCtx(value) # <<<<<<<<<<<<<<
*
* # --- discretization space ---
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 900, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 900, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":899
* def __get__(self):
* return self.getAppCtx()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setAppCtx(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.appctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":905
*
* property dm:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getDM()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_2dm_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_2dm_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_2dm___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_2dm___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":906
* property dm:
* def __get__(self):
* return self.getDM() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setDM(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":905
*
* property dm:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getDM()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.dm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":907
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_2dm_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES_2dm_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/SNES.pyx":908
* return self.getDM()
* def __set__(self, value):
* self.setDM(value) # <<<<<<<<<<<<<<
*
* # --- nonlinear preconditioner ---
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 908, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 908, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":907
* def __get__(self):
* return self.getDM()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setDM(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.dm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":913
*
* property npc:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getNPC()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3npc_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3npc_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3npc___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3npc___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":914
* property npc:
* def __get__(self):
* return self.getNPC() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setNPC(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getNPC); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":913
*
* property npc:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getNPC()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.npc.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":915
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3npc_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES_3npc_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/SNES.pyx":916
* return self.getNPC()
* def __set__(self, value):
* self.setNPC(value) # <<<<<<<<<<<<<<
*
* # --- vectors ---
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setNPC); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 916, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 916, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":915
* def __get__(self):
* return self.getNPC()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setNPC(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.npc.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":921
*
* property vec_sol:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_7vec_sol___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_sol___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":922
* property vec_sol:
* def __get__(self):
* return self.getSolution() # <<<<<<<<<<<<<<
*
* property vec_upd:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolution); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 922, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 922, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":921
*
* property vec_sol:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getSolution()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.vec_sol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":925
*
* property vec_upd:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_7vec_upd___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_upd___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":926
* property vec_upd:
* def __get__(self):
* return self.getSolutionUpdate() # <<<<<<<<<<<<<<
*
* property vec_rhs:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolutionUpdate); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 926, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 926, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":925
*
* property vec_upd:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getSolutionUpdate()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.vec_upd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":929
*
* property vec_rhs:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_7vec_rhs___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_rhs___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":930
* property vec_rhs:
* def __get__(self):
* return self.getRhs() # <<<<<<<<<<<<<<
*
* # --- linear solver ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getRhs); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 930, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 930, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":929
*
* property vec_rhs:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getRhs()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.vec_rhs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":935
*
* property ksp:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getKSP()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3ksp_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3ksp_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3ksp___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3ksp___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":936
* property ksp:
* def __get__(self):
* return self.getKSP() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setKSP(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getKSP); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 936, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 936, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":935
*
* property ksp:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getKSP()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.ksp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":937
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3ksp_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES_3ksp_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/SNES.pyx":938
* return self.getKSP()
* def __set__(self, value):
* self.setKSP(value) # <<<<<<<<<<<<<<
*
* property use_ew:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setKSP); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 938, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 938, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":937
* def __get__(self):
* return self.getKSP()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setKSP(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.ksp.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":941
*
* property use_ew:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getUseEW()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":942
* property use_ew:
* def __get__(self):
* return self.getUseEW() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setUseEW(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getUseEW); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 942, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 942, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":941
*
* property use_ew:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getUseEW()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.use_ew.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":943
* def __get__(self):
* return self.getUseEW()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setUseEW(value)
*
*/
/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/SNES.pyx":944
* return self.getUseEW()
* def __set__(self, value):
* self.setUseEW(value) # <<<<<<<<<<<<<<
*
* # --- tolerances ---
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setUseEW); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 944, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 944, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":943
* def __get__(self):
* return self.getUseEW()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setUseEW(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.use_ew.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":949
*
* property rtol:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[0]
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4rtol_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4rtol_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4rtol___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4rtol___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":950
* property rtol:
* def __get__(self):
* return self.getTolerances()[0] # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setTolerances(rtol=value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 950, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 950, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 950, __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":949
*
* property rtol:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[0]
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.rtol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":951
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4rtol_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES_4rtol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/SNES.pyx":952
* return self.getTolerances()[0]
* def __set__(self, value):
* self.setTolerances(rtol=value) # <<<<<<<<<<<<<<
*
* property atol:
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 952, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 952, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rtol, __pyx_v_value) < 0) __PYX_ERR(49, 952, __pyx_L1_error)
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 952, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":951
* def __get__(self):
* return self.getTolerances()[0]
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setTolerances(rtol=value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.rtol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":955
*
* property atol:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[1]
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4atol_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4atol_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4atol___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4atol___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":956
* property atol:
* def __get__(self):
* return self.getTolerances()[1] # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setTolerances(atol=value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 956, __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":955
*
* property atol:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[1]
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.atol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":957
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4atol_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES_4atol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/SNES.pyx":958
* return self.getTolerances()[1]
* def __set__(self, value):
* self.setTolerances(atol=value) # <<<<<<<<<<<<<<
*
* property stol:
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 958, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 958, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_atol, __pyx_v_value) < 0) __PYX_ERR(49, 958, __pyx_L1_error)
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 958, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":957
* def __get__(self):
* return self.getTolerances()[1]
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setTolerances(atol=value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.atol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":961
*
* property stol:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[2]
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4stol_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4stol_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4stol___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4stol___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":962
* property stol:
* def __get__(self):
* return self.getTolerances()[2] # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setTolerances(stol=value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 962, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 962, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 962, __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":961
*
* property stol:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[2]
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.stol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":963
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4stol_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES_4stol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/SNES.pyx":964
* return self.getTolerances()[2]
* def __set__(self, value):
* self.setTolerances(stol=value) # <<<<<<<<<<<<<<
*
* property max_it:
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 964, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 964, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_stol, __pyx_v_value) < 0) __PYX_ERR(49, 964, __pyx_L1_error)
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 964, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":963
* def __get__(self):
* return self.getTolerances()[2]
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setTolerances(stol=value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.stol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":967
*
* property max_it:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[3]
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6max_it_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6max_it_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6max_it___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6max_it___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":968
* property max_it:
* def __get__(self):
* return self.getTolerances()[3] # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setTolerances(max_it=value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 968, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 968, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 968, __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":967
*
* property max_it:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getTolerances()[3]
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.max_it.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":969
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6max_it_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES_6max_it_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/SNES.pyx":970
* return self.getTolerances()[3]
* def __set__(self, value):
* self.setTolerances(max_it=value) # <<<<<<<<<<<<<<
*
* # --- more tolerances ---
*/
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 970, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 970, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_max_it, __pyx_v_value) < 0) __PYX_ERR(49, 970, __pyx_L1_error)
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 970, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "petsc4py/PETSc/SNES.pyx":969
* def __get__(self):
* return self.getTolerances()[3]
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setTolerances(max_it=value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.max_it.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":975
*
* property max_funcs:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getMaxFunctionEvaluations()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9max_funcs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9max_funcs_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":976
* property max_funcs:
* def __get__(self):
* return self.getMaxFunctionEvaluations() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setMaxFunctionEvaluations(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getMaxFunctionEvaluations); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 976, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 976, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":975
*
* property max_funcs:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getMaxFunctionEvaluations()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.max_funcs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":977
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/SNES.pyx":978
* return self.getMaxFunctionEvaluations()
* def __set__(self, value):
* self.setMaxFunctionEvaluations(value) # <<<<<<<<<<<<<<
*
* # --- iteration ---
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setMaxFunctionEvaluations); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 978, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 978, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":977
* def __get__(self):
* return self.getMaxFunctionEvaluations()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setMaxFunctionEvaluations(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.max_funcs.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":983
*
* property its:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getIterationNumber()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3its_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3its_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3its___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3its___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":984
* property its:
* def __get__(self):
* return self.getIterationNumber() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setIterationNumber(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getIterationNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 984, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 984, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":983
*
* property its:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getIterationNumber()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.its.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":985
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3its_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES_3its_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/SNES.pyx":986
* return self.getIterationNumber()
* def __set__(self, value):
* self.setIterationNumber(value) # <<<<<<<<<<<<<<
*
* property norm:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setIterationNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 986, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 986, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":985
* def __get__(self):
* return self.getIterationNumber()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setIterationNumber(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.its.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":989
*
* property norm:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getFunctionNorm()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4norm_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4norm_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4norm___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4norm___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":990
* property norm:
* def __get__(self):
* return self.getFunctionNorm() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setFunctionNorm(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getFunctionNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 990, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 990, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":989
*
* property norm:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getFunctionNorm()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.norm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":991
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4norm_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES_4norm_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/SNES.pyx":992
* return self.getFunctionNorm()
* def __set__(self, value):
* self.setFunctionNorm(value) # <<<<<<<<<<<<<<
*
* property history:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setFunctionNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 992, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 992, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":991
* def __get__(self):
* return self.getFunctionNorm()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setFunctionNorm(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.norm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":995
*
* property history:
* def __get__(self): # <<<<<<<<<<<<<<
* 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) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_7history___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7history___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":996
* property history:
* def __get__(self):
* return self.getConvergenceHistory() # <<<<<<<<<<<<<<
*
* # --- convergence ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergenceHistory); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 996, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 996, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":995
*
* property history:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getConvergenceHistory()
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.history.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":1001
*
* property reason:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getConvergedReason()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6reason_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6reason_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6reason___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6reason___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":1002
* property reason:
* def __get__(self):
* return self.getConvergedReason() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setConvergedReason(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1002, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1002, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":1001
*
* property reason:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getConvergedReason()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.reason.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":1003
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6reason_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES_6reason_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/SNES.pyx":1004
* return self.getConvergedReason()
* def __set__(self, value):
* self.setConvergedReason(value) # <<<<<<<<<<<<<<
*
* property iterating:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1004, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1004, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":1003
* def __get__(self):
* return self.getConvergedReason()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setConvergedReason(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.reason.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":1007
*
* property iterating:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.reason == 0
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9iterating_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9iterating_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_9iterating___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_9iterating___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":1008
* property iterating:
* def __get__(self):
* return self.reason == 0 # <<<<<<<<<<<<<<
*
* property converged:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1008, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1008, __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":1007
*
* property iterating:
* def __get__(self): # <<<<<<<<<<<<<<
* 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.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":1011
*
* property converged:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.reason > 0
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9converged_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9converged_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_9converged___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_9converged___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":1012
* property converged:
* def __get__(self):
* return self.reason > 0 # <<<<<<<<<<<<<<
*
* property diverged:
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1012, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1012, __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":1011
*
* property converged:
* def __get__(self): # <<<<<<<<<<<<<<
* 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.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":1015
*
* property diverged:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.reason < 0
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_8diverged_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_8diverged_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_8diverged___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_8diverged___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":1016
* property diverged:
* def __get__(self):
* return self.reason < 0 # <<<<<<<<<<<<<<
*
* # --- matrix free / finite differences ---
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1016, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1016, __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":1015
*
* property diverged:
* def __get__(self): # <<<<<<<<<<<<<<
* 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.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":1021
*
* property use_mf:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getUseMF()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_mf_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_mf_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":1022
* property use_mf:
* def __get__(self):
* return self.getUseMF() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setUseMF(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getUseMF); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1022, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1022, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":1021
*
* property use_mf:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getUseMF()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.use_mf.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":1023
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/SNES.pyx":1024
* return self.getUseMF()
* def __set__(self, value):
* self.setUseMF(value) # <<<<<<<<<<<<<<
*
* property use_fd:
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setUseMF); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1024, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1024, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":1023
* def __get__(self):
* return self.getUseMF()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setUseMF(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.use_mf.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":1027
*
* property use_fd:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getUseFD()
* def __set__(self, value):
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_fd_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_fd_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd___get__(((struct PyPetscSNESObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd___get__(struct PyPetscSNESObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
/* "petsc4py/PETSc/SNES.pyx":1028
* property use_fd:
* def __get__(self):
* return self.getUseFD() # <<<<<<<<<<<<<<
* def __set__(self, value):
* self.setUseFD(value)
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getUseFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1028, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1028, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* "petsc4py/PETSc/SNES.pyx":1027
*
* property use_fd:
* def __get__(self): # <<<<<<<<<<<<<<
* return self.getUseFD()
* def __set__(self, value):
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.use_fd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/SNES.pyx":1029
* def __get__(self):
* 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
/* "petsc4py/PETSc/SNES.pyx":1030
* return self.getUseFD()
* def __set__(self, value):
* self.setUseFD(value) # <<<<<<<<<<<<<<
*
* # --------------------------------------------------------------------
*/
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setUseFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1030, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
__pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value);
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1030, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "petsc4py/PETSc/SNES.pyx":1029
* def __get__(self):
* return self.getUseFD()
* def __set__(self, value): # <<<<<<<<<<<<<<
* self.setUseFD(value)
*
*/
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("petsc4py.PETSc.SNES.use_fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/TS.pyx":116
* # --- 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) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS___cinit__(((struct PyPetscTSObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_8petsc4py_5PETSc_2TS___cinit__(struct PyPetscTSObject *__pyx_v_self) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "petsc4py/PETSc/TS.pyx":117
*
* 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":118
* def __cinit__(self):
* self.obj = <PetscObject*> &self.ts
* self.ts = NULL # <<<<<<<<<<<<<<
*
* # --- xxx ---
*/
__pyx_v_self->ts = NULL;
/* "petsc4py/PETSc/TS.pyx":116
* # --- xxx ---
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* self.obj = <PetscObject*> &self.ts
* self.ts = NULL
*/
/* function exit code */
__pyx_r = 0;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/TS.pyx":122
* # --- xxx ---
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer cviewer = NULL
* if viewer is not None: cviewer = viewer.vwr
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2TS_2view[] = "TS.view(self, Viewer viewer=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(50, 122, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(50, 122, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.TS.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(50, 122, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_2view(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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;
int __pyx_t_2;
PetscViewer __pyx_t_3;
PetscErrorCode __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("view", 0);
/* "petsc4py/PETSc/TS.pyx":123
*
* def view(self, Viewer viewer=None):
* 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":124
* def view(self, Viewer viewer=None):
* 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);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
__pyx_t_3 = __pyx_v_viewer->vwr;
__pyx_v_cviewer = __pyx_t_3;
}
/* "petsc4py/PETSc/TS.pyx":125
* cdef PetscViewer cviewer = NULL
* if viewer is not None: cviewer = viewer.vwr
* CHKERR( TSView(self.ts, cviewer) ) # <<<<<<<<<<<<<<
*
* def load(self, Viewer viewer):
*/
__pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSView(__pyx_v_self->ts, __pyx_v_cviewer)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 125, __pyx_L1_error)
/* "petsc4py/PETSc/TS.pyx":122
* # --- xxx ---
*
* def view(self, Viewer viewer=None): # <<<<<<<<<<<<<<
* cdef PetscViewer cviewer = NULL
* if viewer is not None: cviewer = viewer.vwr
*/
/* 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":127
* CHKERR( TSView(self.ts, cviewer) )
*
* def load(self, Viewer viewer): # <<<<<<<<<<<<<<
* CHKERR( TSLoad(self.ts, viewer.vwr) )
*
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_5load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2TS_4load[] = "TS.load(self, Viewer viewer)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_5load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct PyPetscViewerObject *__pyx_v_viewer = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load") < 0)) __PYX_ERR(50, 127, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(50, 127, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("petsc4py.PETSc.TS.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(50, 127, __pyx_L1_error)
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4load(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_viewer);
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
__pyx_L0:;
__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":128
*
* def load(self, Viewer viewer):
* CHKERR( TSLoad(self.ts, viewer.vwr) ) # <<<<<<<<<<<<<<
*
* def destroy(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(50, 128, __pyx_L1_error)
/* "petsc4py/PETSc/TS.pyx":127
* CHKERR( TSView(self.ts, cviewer) )
*
* def load(self, Viewer viewer): # <<<<<<<<<<<<<<
* CHKERR( TSLoad(self.ts, viewer.vwr) )
*
*/
/* 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":130
* CHKERR( TSLoad(self.ts, viewer.vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( TSDestroy(&self.ts) )
* return self
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2TS_6destroy[] = "TS.destroy(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("destroy (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_6destroy(((struct PyPetscTSObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6destroy(struct PyPetscTSObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PetscErrorCode __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("destroy", 0);
/* "petsc4py/PETSc/TS.pyx":131
*
* def destroy(self):
* 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(50, 131, __pyx_L1_error)
/* "petsc4py/PETSc/TS.pyx":132
* def destroy(self):
* CHKERR( TSDestroy(&self.ts) )
* return self # <<<<<<<<<<<<<<
*
* def create(self, comm=None):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/TS.pyx":130
* CHKERR( TSLoad(self.ts, viewer.vwr) )
*
* def destroy(self): # <<<<<<<<<<<<<<
* CHKERR( TSDestroy(&self.ts) )
* return self
*/
/* 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":134
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscTS newts = NULL
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2TS_8create[] = "TS.create(self, comm=None)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_comm = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0};
PyObject* values[1] = {0};
values[0] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (kw_args > 0) {
PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm);
if (value) { values[0] = value; kw_args--; }
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(50, 134, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
}
__pyx_v_comm = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(50, 134, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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":135
*
* def create(self, comm=None):
* 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(PyErr_Occurred())) __PYX_ERR(50, 135, __pyx_L1_error)
__pyx_v_ccomm = __pyx_t_1;
/* "petsc4py/PETSc/TS.pyx":136
* def create(self, comm=None):
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscTS newts = NULL # <<<<<<<<<<<<<<
* CHKERR( TSCreate(ccomm, &newts) )
* PetscCLEAR(self.obj); self.ts = newts
*/
__pyx_v_newts = NULL;
/* "petsc4py/PETSc/TS.pyx":137
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscTS newts = NULL
* CHKERR( TSCreate(ccomm, &newts) ) # <<<<<<<<<<<<<<
* 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(50, 137, __pyx_L1_error)
/* "petsc4py/PETSc/TS.pyx":138
* cdef PetscTS newts = NULL
* CHKERR( TSCreate(ccomm, &newts) )
* PetscCLEAR(self.obj); self.ts = newts # <<<<<<<<<<<<<<
* return self
*
*/
(void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
__pyx_v_self->ts = __pyx_v_newts;
/* "petsc4py/PETSc/TS.pyx":139
* CHKERR( TSCreate(ccomm, &newts) )
* PetscCLEAR(self.obj); self.ts = newts
* return self # <<<<<<<<<<<<<<
*
* def clone(self):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
/* "petsc4py/PETSc/TS.pyx":134
* return self
*
* def create(self, comm=None): # <<<<<<<<<<<<<<
* cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
* cdef PetscTS newts = NULL
*/
/* 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":141
* return self
*
* def clone(self): # <<<<<<<<<<<<<<
* cdef TS ts = TS()
* CHKERR( TSClone(self.ts, &ts.ts) )
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_11clone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2TS_10clone[] = "TS.clone(self)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_11clone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("clone (wrapper)", 0);
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
__Pyx_RaiseArgtupleInvalid("clone", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clone", 0))) return NULL;
__pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_10clone(((struct PyPetscTSObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_10clone(struct PyPetscTSObject *__pyx_v_self) {
struct PyPetscTSObject *__pyx_v_ts = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PetscErrorCode __pyx_t_2;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("clone", 0);
/* "petsc4py/PETSc/TS.pyx":142
*
* def clone(self):
* cdef TS ts = TS() # <<<<<<<<<<<<<<
* CHKERR( TSClone(self.ts, &ts.ts) )
* return ts
*/
__pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ts = ((struct PyPetscTSObject *)__pyx_t_1);
__pyx_t_1 = 0;
/* "petsc4py/PETSc/TS.pyx":143
* def clone(self):
* cdef TS ts = TS()
* CHKERR( TSClone(self.ts, &ts.ts) ) # <<<<<<<<<<<<<<
* return ts
*
*/
__pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSClone(__pyx_v_self->ts, (&__pyx_v_ts->ts))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 143, __pyx_L1_error)
/* "petsc4py/PETSc/TS.pyx":144
* cdef TS ts = TS()
* CHKERR( TSClone(self.ts, &ts.ts) )
* return ts # <<<<<<<<<<<<<<
*
* def setType(self, ts_type):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(((PyObject *)__pyx_v_ts));
__pyx_r = ((PyObject *)__pyx_v_ts);
goto __pyx_L0;
/* "petsc4py/PETSc/TS.pyx":141
* return self
*
* def clone(self): # <<<<<<<<<<<<<<
* cdef TS ts = TS()
* CHKERR( TSClone(self.ts, &ts.ts) )
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("petsc4py.PETSc.TS.clone", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ts);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "petsc4py/PETSc/TS.pyx":146
* return ts
*
* def setType(self, ts_type): # <<<<<<<<<<<<<<
* cdef PetscTSType cval = NULL
* ts_type = str2bytes(ts_type, &cval)
*/
/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_13setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8petsc4py_5PETSc_2TS_12setType[] = "TS.setType(self, ts_type)";
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_13setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ts_type = 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);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts_type,0};
PyObject* values[1] = {0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ts_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(50, 146, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
}
__pyx_v_ts_type = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(50, 146, __pyx_L3_error)
__pyx_L3_error:;
__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 */
__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"